From 01f03cf098c01116f68354b3bb8bd3eb8bcb581b Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 22 Apr 2010 13:22:08 -0700 Subject: [PATCH] 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 . --- test/notmuch-test | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 } -- 2.43.0