From 71120e32b07b4926e50a10452b3b741c90187a04 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sat, 14 Jan 2017 20:44:47 +0100 Subject: [PATCH 2/2] Add a workaround for "time" builtin on bash (cygwin) --- tests/runtests.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/runtests.sh b/tests/runtests.sh index ab65cf4..8ef4ac9 100755 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -63,7 +63,16 @@ SETUP_PREFIX="${SETUP_PREFIX} -e (register-program \"csi\" (make-pathname ${TEST TYPESDB=../types.db cp $TYPESDB test-repository/types.db -time=`command >/dev/null -v time && echo time || :` +time=time +# On some Bash versions (Cygwin), calling the time builtin from a +# variable breaks, and some systems don't ship with time(1) or a +# builtin... +set +e +$time echo '' > /dev/null 2> /dev/null +if [ "$?" -eq 127 ]; then + time=':' +fi +set -e compile="../csc -types ${TYPESDB} -ignore-repository ${COMPILE_OPTIONS} -o a.out" compile2="../csc -compiler $CHICKEN -v -I${TEST_DIR}/.. -L${TEST_DIR}/.. -include-path ${TEST_DIR}/.." compile_s="../csc -s -types ${TYPESDB} -ignore-repository ${COMPILE_OPTIONS} -v -I${TEST_DIR}/.. -L${TEST_DIR}/.. -include-path ${TEST_DIR}/.." -- 2.1.4