aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Hart <dvhltc@us.ibm.com>2009-11-12 21:13:12 -0800
committerDarren Hart <dvhltc@us.ibm.com>2009-11-12 21:15:33 -0800
commitf562a70f03e8a1e57e3236f7f36e65432564daca (patch)
tree68e276b3855dd9035083afa2b774b18b95f76bc7
parent998e584edcdc92c5bce38abdbb60d5c32543d80a (diff)
downloadfutextest-f562a70f03e8a1e57e3236f7f36e65432564daca.tar.gz
Determine if shell is color capable dynamically
Use tput to test for color support in the terminal. If found, use it by default in the run.sh scripts. If not, don't. Signed-off-by: Darren Hart <dvhltc@us.ibm.com>
-rwxr-xr-xfunctional/run.sh46
-rwxr-xr-xrun.sh8
2 files changed, 31 insertions, 23 deletions
diff --git a/functional/run.sh b/functional/run.sh
index d32d6fd..01aea59 100755
--- a/functional/run.sh
+++ b/functional/run.sh
@@ -35,35 +35,35 @@
echo
# requeue pi testing
# without timeouts
-./futex_requeue_pi
-./futex_requeue_pi -c -b
-./futex_requeue_pi -c -b -l
-./futex_requeue_pi -c -b -o
-./futex_requeue_pi -c -l
-./futex_requeue_pi -c -o
+./futex_requeue_pi $COLOR
+./futex_requeue_pi $COLOR -b
+./futex_requeue_pi $COLOR -b -l
+./futex_requeue_pi $COLOR -b -o
+./futex_requeue_pi $COLOR -l
+./futex_requeue_pi $COLOR -o
# with timeouts
-./futex_requeue_pi -c -b -l -t 5000
-./futex_requeue_pi -c -l -t 5000
-./futex_requeue_pi -c -b -l -t 500000
-./futex_requeue_pi -c -l -t 500000
-./futex_requeue_pi -c -b -t 5000
-./futex_requeue_pi -c -t 5000
-./futex_requeue_pi -c -b -t 500000
-./futex_requeue_pi -c -t 500000
-./futex_requeue_pi -c -b -o -t 5000
-./futex_requeue_pi -c -l -t 5000
-./futex_requeue_pi -c -b -o -t 500000
-./futex_requeue_pi -c -l -t 500000
+./futex_requeue_pi $COLOR -b -l -t 5000
+./futex_requeue_pi $COLOR -l -t 5000
+./futex_requeue_pi $COLOR -b -l -t 500000
+./futex_requeue_pi $COLOR -l -t 500000
+./futex_requeue_pi $COLOR -b -t 5000
+./futex_requeue_pi $COLOR -t 5000
+./futex_requeue_pi $COLOR -b -t 500000
+./futex_requeue_pi $COLOR -t 500000
+./futex_requeue_pi $COLOR -b -o -t 5000
+./futex_requeue_pi $COLOR -l -t 5000
+./futex_requeue_pi $COLOR -b -o -t 500000
+./futex_requeue_pi $COLOR -l -t 500000
# with long timeout
-./futex_requeue_pi -c -b -l -t 2000000000
-./futex_requeue_pi -c -l -t 2000000000
+./futex_requeue_pi $COLOR -b -l -t 2000000000
+./futex_requeue_pi $COLOR -l -t 2000000000
echo
-./futex_requeue_pi_mismatched_ops -c
+./futex_requeue_pi_mismatched_ops $COLOR
echo
-./futex_requeue_pi_signal_restart -c
+./futex_requeue_pi_signal_restart $COLOR
echo
-./futex_wait_timeout -c
+./futex_wait_timeout $COLOR
diff --git a/run.sh b/run.sh
index 0c54a74..a85f821 100755
--- a/run.sh
+++ b/run.sh
@@ -33,6 +33,14 @@
#
###############################################################################
+COLOR=""
+tput setf 7
+if [ $? -eq 0 ]; then
+ COLOR="-c"
+ tput sgr0
+fi
+export COLOR
+
(cd functional; ./run.sh)
(cd performance; ./run.sh)
(cd stress; ./run.sh)