diff options
author | Darren Hart <dvhltc@us.ibm.com> | 2009-11-17 15:57:18 -0800 |
---|---|---|
committer | Darren Hart <dvhltc@us.ibm.com> | 2009-11-17 15:57:18 -0800 |
commit | 75d24c0f07ffc1827b46e276fd585b678bd1eb01 (patch) | |
tree | 9e31cf0a65cb53d02f5939ab6545380023a90fc6 | |
parent | f26619a0decd0b2241d792dcda00eb8f2db4581d (diff) | |
download | futextest-75d24c0f07ffc1827b46e276fd585b678bd1eb01.tar.gz |
Use binary variable in bash to pass USE_COLOR to subdir run.sh scripts
Bash doesn't distinguish between unset variables and zero-length
strings. Use a binary variable USE_COLOR to pass color test results
instead.
Signed-off-by: Darren Hart <dvhltc@us.ibm.com>
-rwxr-xr-x | functional/run.sh | 13 | ||||
-rwxr-xr-x | performance/run.sh | 13 | ||||
-rwxr-xr-x | run.sh | 7 | ||||
-rwxr-xr-x | stress/run.sh | 12 |
4 files changed, 42 insertions, 3 deletions
diff --git a/functional/run.sh b/functional/run.sh index d377c5f..959b389 100755 --- a/functional/run.sh +++ b/functional/run.sh @@ -32,6 +32,19 @@ # ############################################################################### +# Test for a color capable console +if [ -z "$USE_COLOR" ]; then + tput setf 7 + if [ $? -eq 0 ]; then + USE_COLOR=1 + tput sgr0 + fi +fi +if [ "$USE_COLOR" -eq 1 ]; then + COLOR="-c" +fi + + echo # requeue pi testing # without timeouts diff --git a/performance/run.sh b/performance/run.sh index 655fc39..c5acf10 100755 --- a/performance/run.sh +++ b/performance/run.sh @@ -32,4 +32,17 @@ # ############################################################################### +# Test for a color capable console +if [ -z "$USE_COLOR" ]; then + tput setf 7 + if [ $? -eq 0 ]; then + USE_COLOR=1 + tput sgr0 + fi +fi +if [ "$USE_COLOR" -eq 1 ]; then + COLOR="-c" +fi + + exit 0 @@ -33,13 +33,14 @@ # ############################################################################### -COLOR="" +# Test for a color capable shell and pass the result to the subdir scripts +USE_COLOR=0 tput setf 7 if [ $? -eq 0 ]; then - COLOR="-c" + USE_COLOR=1 tput sgr0 fi -export COLOR +export USE_COLOR (cd functional; ./run.sh) (cd performance; ./run.sh) diff --git a/stress/run.sh b/stress/run.sh index 655fc39..fb4317b 100755 --- a/stress/run.sh +++ b/stress/run.sh @@ -32,4 +32,16 @@ # ############################################################################### +# Test for a color capable console +if [ -z "$USE_COLOR" ]; then + tput setf 7 + if [ $? -eq 0 ]; then + USE_COLOR=1 + tput sgr0 + fi +fi +if [ "$USE_COLOR" -eq 1 ]; then + COLOR="-c" +fi + exit 0 |