[lttng-dev] [PATCH urcu] runtests: check for existence of /usr/bin/time
Mathieu Desnoyers
mathieu.desnoyers at efficios.com
Wed Nov 14 17:00:00 EST 2012
* Simon Marchi (simon.marchi at polymtl.ca) 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
>
> Signed-off-by: Simon Marchi <simon.marchi at polymtl.ca>
> ---
> tests/runtests-batch.sh | 8 +++++++-
> tests/runtests.sh | 8 +++++++-
> 2 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/tests/runtests-batch.sh b/tests/runtests-batch.sh
> index 6c2340d..d11609e 100755
> --- a/tests/runtests-batch.sh
> +++ b/tests/runtests-batch.sh
> @@ -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
>
> diff --git a/tests/runtests.sh b/tests/runtests.sh
> index 79e54df..563ebd3 100755
> --- a/tests/runtests.sh
> +++ b/tests/runtests.sh
> @@ -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
>
> --
> 1.7.1
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list