diff options
| author | Jani Nikula <jani@nikula.org> | 2017-02-26 19:36:50 +0200 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2017-03-09 08:48:08 -0400 |
| commit | 14c0862baca77882f74fecdafbacb717bccdcfbb (patch) | |
| tree | 57d572e61f8b375849ec51decd06f77bdc9ef872 /test | |
| parent | 740f3296b86ab8e18a6da4949b0db4139298202b (diff) | |
test: suppress diff for broken test without V=1
Known broken tests are, well, known broken. Do not print the result
diff for them unless V=1 is specified. Now that the test description
is printed also when known broken tests fail, the user can also skip
to running the individual failing tests.
Diffstat (limited to 'test')
| -rw-r--r-- | test/Makefile.local | 2 | ||||
| -rw-r--r-- | test/test-lib.sh | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/test/Makefile.local b/test/Makefile.local index f8cf90d0..46805972 100644 --- a/test/Makefile.local +++ b/test/Makefile.local @@ -61,7 +61,7 @@ test-binaries: $(TEST_BINARIES) test: all test-binaries ifeq ($V,) - @echo 'Use "$(MAKE) V=1" to print test headings and PASSing results.' + @echo 'Use "$(MAKE) V=1" to see the details for passing and known broken tests.' @env NOTMUCH_TEST_QUIET=1 ${test_src_dir}/notmuch-test $(OPTIONS) else # The user has explicitly enabled quiet execution. diff --git a/test/test-lib.sh b/test/test-lib.sh index 79dc8419..98203b9b 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -866,7 +866,9 @@ test_failure_message_ () { say_color error "%-6s" "$1" echo " $2" shift 2 - echo "$@" | sed -e 's/^/ /' + if [ "$#" != "0" ]; then + echo "$@" | sed -e 's/^/ /' + fi if test "$verbose" != "t"; then cat test.output; fi } @@ -880,7 +882,11 @@ test_known_broken_ok_ () { test_known_broken_failure_ () { test_reset_state_ test_broken=$(($test_broken+1)) - test_failure_message_ "BROKEN" "$test_subtest_name" "$@" + if [ -z "$NOTMUCH_TEST_QUIET" ]; then + test_failure_message_ "BROKEN" "$test_subtest_name" "$@" + else + test_failure_message_ "BROKEN" "$test_subtest_name" + fi return 1 } |
