]> git.cworth.org Git - obsolete/notmuch-old/blobdiff - test/notmuch-test
test: When a test fails, show diff only (save complete output to a file)
[obsolete/notmuch-old] / test / notmuch-test
index c6703f0e52b42edfedb228423c8f9bca74275a8f..676b66ec76b822de914a34bd0e66bef2c6a4f35d 100755 (executable)
@@ -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
 }