From 3752edb28ea2facab25da4db747c7d0fdcb0ffc2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 25 Jan 2018 12:13:19 +0100 Subject: [PATCH] [rt46602] Assign default values to variables set by command line options and consistently treat them as integers (cherry picked from commit fe51c34df3c137dcd29650599158123536cb55f2) --- bin/tests/system/clean.sh | 4 +++- bin/tests/system/testsummary.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/tests/system/clean.sh b/bin/tests/system/clean.sh index f31c5a17e5e..84c369e0af5 100644 --- a/bin/tests/system/clean.sh +++ b/bin/tests/system/clean.sh @@ -19,6 +19,8 @@ SYSTEMTESTTOP=. # the tests will call "testsummary.sh", which will concatenate all test output # files into a single systests.output. +runall=0 + while getopts "r" flag; do case $flag in r) runall=1 ;; @@ -35,7 +37,7 @@ fi systest=$1 shift -if [ "$runall" = "" ]; then +if [ $runall -eq 0 ]; then rm -f $systest/test.output fi diff --git a/bin/tests/system/testsummary.sh b/bin/tests/system/testsummary.sh index 1c2a0c0251c..45beed8ab26 100644 --- a/bin/tests/system/testsummary.sh +++ b/bin/tests/system/testsummary.sh @@ -24,6 +24,8 @@ SYSTEMTESTTOP=. . $SYSTEMTESTTOP/conf.sh +keepfile=0 + while getopts "n" flag; do case $flag in n) keepfile=1 ;; @@ -32,7 +34,7 @@ while getopts "n" flag; do done cat */test.output > systests.output 2> /dev/null -if [ "$keepfile" = "" ]; then +if [ $keepfile -eq 0 ]; then rm -f */test.output fi -- 2.47.3