From 00bf930c33d3c59293bc79c638ee8de0eb1a8bee Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 31 Aug 2017 17:25:06 +0200 Subject: [PATCH] tests: show log output for failed tests --- tools/integration-tests.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/integration-tests.sh b/tools/integration-tests.sh index 385f0b876..46b0565b1 100755 --- a/tools/integration-tests.sh +++ b/tools/integration-tests.sh @@ -83,10 +83,18 @@ for TEST in ${TESTS}; do # Run test if (( ${VERBOSE} == 0 )); then timeout ${TIMEOUT} ${TEST} &> ${LOGDIR}/${TESTNAME}.log + RC=$? else - timeout ${TIMEOUT} ${TEST} + timeout ${TIMEOUT} ${TEST} | tee ${LOGDIR}/${TESTNAME}.log + RC=${PIPESTATUS[0]} + fi + + # Show full log in case of an error + if (( ${VERBOSE} == 0 )); then + if (( $RC != 99 )) || (( $RC != 0 )); then + cat ${LOGDIR}/${TESTNAME}.log + fi fi - RC=$? case $RC in 0)