From 11b62d449fe02912e82651e1755be9fd8d81fd0a Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Mon, 3 Aug 2015 21:43:23 -0500 Subject: [PATCH] Testsuite: Also output stdout/stderr in case of a regular output file Also output everything a script piped to stdout and stderr in case a test fails to run. --- cmake/scripts/run_test.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/scripts/run_test.sh b/cmake/scripts/run_test.sh index 229d7a66a9..9a2ff609ff 100644 --- a/cmake/scripts/run_test.sh +++ b/cmake/scripts/run_test.sh @@ -39,12 +39,12 @@ COMPARISON_FILE="$6" 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 @@ -53,6 +53,12 @@ run(){ 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 } -- 2.39.5