[PATCH 2/3] test: print empty line at the beginning of test script, not at end

Tomi Ollila tomi.ollila at iki.fi
Tue Nov 12 12:41:07 PST 2013


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                          | 1 +
 test/test-lib.sh                           | 9 ++++++---
 test/test.expected-output/test-verbose-no  | 1 +
 test/test.expected-output/test-verbose-yes | 1 +
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/test/notmuch-test b/test/notmuch-test
index 18593f6..d6fdd3a 100755
--- a/test/notmuch-test
+++ b/test/notmuch-test
@@ -98,6 +98,7 @@ done
 trap - HUP INT TERM
 
 # Report results
+echo
 ./aggregate-results.sh test-results/*
 ev=$?
 
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 808bb7f..e022e46 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -190,7 +190,12 @@ then
 	exit 0
 fi
 
-echo $this_test: "Testing ${test_description}"
+print_test_description ()
+{
+	echo
+	echo $this_test: "Testing ${test_description}"
+}
+print_test_description
 
 exec 5>&1
 
@@ -968,8 +973,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
diff --git a/test/test.expected-output/test-verbose-no b/test/test.expected-output/test-verbose-no
index 0bca754..1a2ff61 100644
--- a/test/test.expected-output/test-verbose-no
+++ b/test/test.expected-output/test-verbose-no
@@ -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
diff --git a/test/test.expected-output/test-verbose-yes b/test/test.expected-output/test-verbose-yes
index ebe5187..d25466e 100644
--- a/test/test.expected-output/test-verbose-yes
+++ b/test/test.expected-output/test-verbose-yes
@@ -1,3 +1,4 @@
+
 test-verbose: Testing the verbosity options of the test framework itself.
 hello stdout
 hello stderr
-- 
1.8.3.1



More information about the notmuch mailing list