diff options
author | Carl Worth <cworth@cworth.org> | 2010-04-22 13:22:08 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-04-22 13:22:08 -0700 |
commit | 01f03cf098c01116f68354b3bb8bd3eb8bcb581b (patch) | |
tree | e47d90f42ae869c06ddff1b3b10feb81e98cf44e | |
parent | 9a3d4a0f2a193e1f45e70592ebe7dc01fdfdb7c2 (diff) |
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 .
-rwxr-xr-x | test/notmuch-test | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/notmuch-test b/test/notmuch-test index c6703f0..676b66e 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 } |