From 38940619c632e7e67c7c34cd3c7ec0cc9ae329f9 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Mon, 26 Feb 2018 10:37:08 -0800 Subject: [PATCH] Do not destroy systests.output if there are no test.output files --- bin/tests/system/testsummary.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/tests/system/testsummary.sh b/bin/tests/system/testsummary.sh index 9d6c2f3939..06c356671a 100644 --- a/bin/tests/system/testsummary.sh +++ b/bin/tests/system/testsummary.sh @@ -35,9 +35,14 @@ while getopts "n" flag; do esac done -cat */test.output > systests.output 2> /dev/null -if [ $keepfile -eq 0 ]; then - rm -f */test.output +if [ `ls */test.output 2> /dev/null | wc -l` -eq 0 ]; then + echowarn "I:No 'test.output' files were found." + echowarn "I:Printing summary from pre-existing 'systests.output'." +else + cat */test.output > systests.output + if [ $keepfile -eq 0 ]; then + rm -f */test.output + fi fi status=0 -- GitLab