test: Leave tmp.<testname> for broken tests

Previously, this directory was only preserved for failing tests. But
it's important to be able to easily debug known-broken tests, so
preserve the actual vs. expected output for those as well.
This commit is contained in:
Carl Worth 2010-12-07 14:24:00 -08:00
parent a18a15326c
commit b41aab78f2
2 changed files with 7 additions and 1 deletions

View file

@ -71,6 +71,7 @@ output=$(cd ..; ./test-verbose -v 2>&1 | suppress_diff_date)
expected=$(cat $EXPECTED/test-verbose-yes | suppress_diff_date) expected=$(cat $EXPECTED/test-verbose-yes | suppress_diff_date)
# Do not include the results of test-verbose in totals # Do not include the results of test-verbose in totals
rm $TEST_DIRECTORY/test-results/test-verbose-* rm $TEST_DIRECTORY/test-results/test-verbose-*
rm -r $TEST_DIRECTORY/tmp.test-verbose
test_expect_equal "$output" "$expected" test_expect_equal "$output" "$expected"

View file

@ -454,6 +454,9 @@ test_expect_equal_failure ()
test_known_broken_ok_ "$test_subtest_name" test_known_broken_ok_ "$test_subtest_name"
else else
test_known_broken_failure_ "$test_subtest_name" test_known_broken_failure_ "$test_subtest_name"
testname=$this_test.$test_count
echo "$expected" > $testname.expected
echo "$output" > $testname.output
fi fi
fi fi
} }
@ -754,7 +757,9 @@ test_done () {
echo echo
if [ "$test_failure" = "0" ]; then if [ "$test_failure" = "0" ]; then
if [ "$test_broken" = "0" ]; then
rm -rf "$remove_tmp" rm -rf "$remove_tmp"
fi
exit 0 exit 0
else else
exit 1 exit 1