Also output everything a script piped to stdout and stderr in case a test
fails to run.
run(){
rm -f failing_output
rm -f output
+ rm -f stdout
${RUN_COMMAND} > stdout 2>&1
RETURN_VALUE=$?
- [ -f output ] || cp stdout output
- rm -f stdout
+ [ -f output ] || mv stdout output
if [ $RETURN_VALUE -ne 0 ]; then
mv output failing_output
echo "${TEST_FULL}: RUN failed. ------ Result: `pwd`/failing_output"
echo "${TEST_FULL}: RUN failed. ------ Partial output:"
cat failing_output
+ if [ -f stdout ]; then
+ echo ""
+ echo "${TEST_FULL}: RUN failed. ------ Additional output on stdout/stderr:"
+ echo ""
+ cat stdout
+ fi
exit 1
fi
}
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams