mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 12:28:09 +01:00
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 .
This commit is contained in:
parent
9a3d4a0f2a
commit
01f03cf098
1 changed files with 4 additions and 2 deletions
|
@ -168,8 +168,10 @@ pass_if_equal ()
|
||||||
echo " PASS"
|
echo " PASS"
|
||||||
else
|
else
|
||||||
echo " FAIL"
|
echo " FAIL"
|
||||||
echo " Expected output: $expected"
|
testname=test-$(printf "%03d" $tests)
|
||||||
echo " Actual output: $output"
|
echo "$expected" > $testname.expected
|
||||||
|
echo "$output" > $testname.output
|
||||||
|
diff -u $testname.expected $testname.output || true
|
||||||
test_failures=$((test_failures + 1))
|
test_failures=$((test_failures + 1))
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue