mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-03-14 03:25:15 +01:00
test: optionally print subtest number
The idea is that $test_count could be used in tests to label intermediate files. The output enabled by this patch (and --debug) helps figure out which OUTPUT.nn file belongs to which test in case several subtests write to OUTPUT.$test_count
This commit is contained in:
parent
6dcd575d7b
commit
451c57d19a
1 changed files with 12 additions and 0 deletions
|
@ -116,6 +116,16 @@ do
|
|||
esac
|
||||
done
|
||||
|
||||
if test -n "$debug"; then
|
||||
print_subtest () {
|
||||
printf " %-4s" "[$((test_count - 1))]"
|
||||
}
|
||||
else
|
||||
print_subtest () {
|
||||
true
|
||||
}
|
||||
fi
|
||||
|
||||
if test -n "$color"; then
|
||||
say_color () {
|
||||
(
|
||||
|
@ -132,6 +142,7 @@ if test -n "$color"; then
|
|||
printf " "
|
||||
printf "$@"
|
||||
tput sgr0
|
||||
print_subtest
|
||||
)
|
||||
}
|
||||
else
|
||||
|
@ -140,6 +151,7 @@ else
|
|||
shift
|
||||
printf " "
|
||||
printf "$@"
|
||||
print_subtest
|
||||
}
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue