test: print empty line at the beginning of test script, not at end
authorTomi Ollila <tomi.ollila@iki.fi>
Mon, 25 Nov 2013 17:08:18 +0000 (19:08 +0200)
committerDavid Bremner <david@tethera.net>
Mon, 9 Dec 2013 15:25:41 +0000 (23:25 +0800)
In preparation for quiet mode print empty line before writing the
test description. This is done now in function designed for it --
it will also be called when test fails.

test/notmuch-test
test/test-lib.sh
test/test.expected-output/test-verbose-no
test/test.expected-output/test-verbose-yes

index 18593f61d23b14d8386e901eeaeec3b5305fc944..d6fdd3a5d7f3a07d2db111643c80e40fb29a5698 100755 (executable)
@@ -98,6 +98,7 @@ done
 trap - HUP INT TERM
 
 # Report results
+echo
 ./aggregate-results.sh test-results/*
 ev=$?
 
index 6e475452805524193a9900c7a1b418fa13753c93..34e0db68d36cf08e286570cc6e71e75cf4f58287 100644 (file)
@@ -190,7 +190,15 @@ then
        exit 0
 fi
 
-echo $this_test: "Testing ${test_description}"
+test_description_printed=
+print_test_description ()
+{
+       test -z "$test_description_printed" || return 0
+       echo
+       echo $this_test: "Testing ${test_description}"
+       test_description_printed=1
+}
+print_test_description
 
 exec 5>&1
 
@@ -979,8 +987,6 @@ test_done () {
        echo "failed $test_failure" >> $test_results_path
        echo "" >> $test_results_path
 
-       echo
-
        [ -n "$EMACS_SERVER" ] && test_emacs '(kill-emacs)'
 
        if [ "$test_failure" = "0" ]; then
index 0bca7540f0e76d4e62ff3dc9b4bcdb2bbfb4b3bc..1a2ff6196bbefb28123f534e37e94257b6157db2 100644 (file)
@@ -1,3 +1,4 @@
+
 test-verbose: Testing the verbosity options of the test framework itself.
  PASS   print something in test_expect_success and pass
  FAIL   print something in test_expect_success and fail
index ebe5187444a0d5a7ecae776a1900d8024948ebf2..d25466e9dc00a9b6556a8d92ee659f89669ac133 100644 (file)
@@ -1,3 +1,4 @@
+
 test-verbose: Testing the verbosity options of the test framework itself.
 hello stdout
 hello stderr