From: Carl Worth Date: Thu, 22 Apr 2010 20:22:08 +0000 (-0700) Subject: test: When a test fails, show diff only (save complete output to a file) X-Git-Tag: 0.3~118 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=01f03cf098c01116f68354b3bb8bd3eb8bcb581b;p=notmuch.git test: When a test fails, show diff only (save complete output to a file) We're starting to get test output that's fairly long, so it's much kinder to just show a diff rather than displaying the complete expected and actual output. To allow the user to investigate things after the fact, we save the expected and actual output to files named test-${test_number}.expected and test-${test_number}.output . --- diff --git a/test/notmuch-test b/test/notmuch-test index c6703f0e..676b66ec 100755 --- a/test/notmuch-test +++ b/test/notmuch-test @@ -168,8 +168,10 @@ pass_if_equal () echo " PASS" else echo " FAIL" - echo " Expected output: $expected" - echo " Actual output: $output" + testname=test-$(printf "%03d" $tests) + echo "$expected" > $testname.expected + echo "$output" > $testname.output + diff -u $testname.expected $testname.output || true test_failures=$((test_failures + 1)) fi }