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 .
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
}