diff --git a/test/test_perf_cli.sh b/test/test_perf_cli.sh index 1eed7dce..abcbb08b 100755 --- a/test/test_perf_cli.sh +++ b/test/test_perf_cli.sh @@ -19,7 +19,9 @@ s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi # -f %e gives elapsed wall clock time but is not available on all systems # so we use time -p for POSIX compliance and awk to get wall clock time # Note sometimes time -p is used and sometimes $TIMEFN, cant get it to work same everywhere +# time function (this is a mess to get right on freebsd/linux) : ${TIMEFN:=time -p} # portability: 2>&1 | awk '/real/ {print $2}' +if ! $TIMEFN true; then err "A working time function" "'$TIMEFN' does not work"; fi APPNAME=example diff --git a/test/test_perf_netconf.sh b/test/test_perf_netconf.sh index d523e4b4..441ecc4b 100755 --- a/test/test_perf_netconf.sh +++ b/test/test_perf_netconf.sh @@ -20,7 +20,9 @@ s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi # -f %e gives elapsed wall clock time but is not available on all systems # so we use time -p for POSIX compliance and awk to get wall clock time # Note sometimes time -p is used and sometimes $TIMEFN, cant get it to work same everywhere +# time function (this is a mess to get right on freebsd/linux) : ${TIMEFN:=time -p} # portability: 2>&1 | awk '/real/ {print $2}' +if ! $TIMEFN true; then err "A working time function" "'$TIMEFN' does not work"; fi APPNAME=example diff --git a/test/test_perf_restconf.sh b/test/test_perf_restconf.sh index 49dc2c3a..e6d3c58c 100755 --- a/test/test_perf_restconf.sh +++ b/test/test_perf_restconf.sh @@ -21,6 +21,7 @@ s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi # so we use time -p for POSIX compliance and awk to get wall clock time # Note sometimes time -p is used and sometimes $TIMEFN, cant get it to work same everywhere : ${TIMEFN:=time -p} # portability: 2>&1 | awk '/real/ {print $2}' +if ! $TIMEFN true; then err "A working time function" "'$TIMEFN' does not work"; fi APPNAME=example diff --git a/test/test_perf_state.sh b/test/test_perf_state.sh index 020353d6..6c93787b 100755 --- a/test/test_perf_state.sh +++ b/test/test_perf_state.sh @@ -20,6 +20,7 @@ fin=$dir/fin # time function (this is a mess to get right on freebsd/linux) : ${TIMEFN:=time -p} # portability: 2>&1 | awk '/real/ {print $2}' +if ! $TIMEFN true; then err "A working time function" "'$TIMEFN' does not work"; fi APPNAME=example diff --git a/test/test_perf_state_only.sh b/test/test_perf_state_only.sh index 471ed06b..66ae3b18 100755 --- a/test/test_perf_state_only.sh +++ b/test/test_perf_state_only.sh @@ -20,6 +20,7 @@ s="$_" ; . ./lib.sh || if [ "$s" = $0 ]; then exit 0; else return 0; fi # time function (this is a mess to get right on freebsd/linux) : ${TIMEFN:=time -p} # portability: 2>&1 | awk '/real/ {print $2}' +if ! $TIMEFN true; then err "A working time function" "'$TIMEFN' does not work"; fi APPNAME=example