From e41573afc45f19bafdd4fc546a181347994698fb Mon Sep 17 00:00:00 2001 From: Soonho Kong Date: Mon, 6 Oct 2014 11:18:36 -0700 Subject: [PATCH] chore(tests/*/test.sh): change working dir; avoid using ls in for-loop --- tests/lean/test.sh | 3 ++- tests/lua/test.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/lean/test.sh b/tests/lean/test.sh index 0a54f2f9d8..35dfca742e 100755 --- a/tests/lean/test.sh +++ b/tests/lean/test.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +cd "$(dirname "$0")" if [ $# -ne 2 -a $# -ne 1 ]; then echo "Usage: test.sh [lean-executable-path] [yes/no]?" exit 1 @@ -12,7 +13,7 @@ else INTERACTIVE=$2 fi NUM_ERRORS=0 -for f in `ls *.lean`; do +for f in *.lean; do echo "-- testing $f" $LEAN -t config.lean $f &> $f.produced.out if test -f $f.expected.out; then diff --git a/tests/lua/test.sh b/tests/lua/test.sh index 473c636419..9bdcf1e5ba 100755 --- a/tests/lua/test.sh +++ b/tests/lua/test.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +cd "$(dirname "$0")" if [ $# -ne 1 ]; then echo "Usage: test.sh [lean-executable-path]" exit 1 @@ -6,7 +7,7 @@ fi ulimit -s unlimited LEAN=$1 NUM_ERRORS=0 -for f in `ls *.lua`; do +for f in *.lua; do echo "-- testing $f" if $LEAN extra.lua $f > $f.produced.out; then echo "-- worked"