Skip to contentSkip to conversation

runtests: check for existence of /usr/bin/time

PATCH Mathieu Desnoyers 1 participant 1 message Nov 14, 2012 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 1 line · * Simon Marchi ([email protected]) wrote:

Otherwise, if /usr/bin/time does not exist, the tests won't run at all.

Hrm, wouldn't it be better if configure.ac checks that time is there ?

Thanks,

Mathieu

Quoted 57 lines
---
 tests/runtests-batch.sh |    8 +++++++-
 tests/runtests.sh       |    8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)
tests/runtests-batch.sh +7 -1
index 6c2340d..d11609e 100755
@@ -1,8 +1,14 @@
 #!/bin/sh
 
+if [ -x /usr/bin/time ]; then
+	TIME_COMMAND="/usr/bin/time -a -o runnall.detail.log"
+else
+	TIME_COMMAND=""
+fi
+
 #for a in test_urcu_gc test_urcu_gc_mb test_urcu_qsbr_gc; do
 for a in test_urcu_gc; do
 	echo "./${a} $*" | tee -a runall.detail.log
-	/usr/bin/time -a -o runall.detail.log ./${a} $*
+	$TIME_COMMAND ./${a} $*
 done
 
tests/runtests.sh +7 -1
index 79e54df..563ebd3 100755
@@ -1,10 +1,16 @@
 #!/bin/sh
 
+if [ -x /usr/bin/time ]; then
+	TIME_COMMAND="/usr/bin/time -a -o runnall.detail.log"
+else
+	TIME_COMMAND=""
+fi
+
 for a in test_urcu_gc test_urcu_signal_gc test_urcu_mb_gc test_urcu_qsbr_gc \
 	test_urcu_lgc test_urcu_signal_lgc test_urcu_mb_lgc test_urcu_qsbr_lgc \
 	test_urcu test_urcu_signal test_urcu_mb test_urcu_qsbr \
 	test_rwlock test_perthreadlock test_mutex; do
 	echo "./${a} $*" | tee -a runall.detail.log
-	/usr/bin/time -a -o runall.detail.log ./${a} $*
+	$TIME_COMMAND ./${a} $*
 done
 
Signature · 7 lines
1.7.1


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 4 lines
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com