diff --git a/test.sh b/test.sh index 9914b7d..8b157b2 100755 --- a/test.sh +++ b/test.sh @@ -15,6 +15,9 @@ # Please don't do weird things shopt -s nullglob +# Find where test.sh is so that we can find the tests/ folder relative to it +SPECDIR="$(dirname "$0")" + # Run the test suite against a binary # $1 is executable # $2, if any, is test results folder @@ -50,7 +53,7 @@ runTests() { # and ti's served as table for test results in results.toml echo "[$TIMESTAMP-$commit]" >> $TESTDIR/results.toml echo "$TIMESTAMP-$commit" > "$TESTDIR"/latest - for test in tests/*.bats; do + for test in "$SPECDIR"/tests/*.bats; do testname="$(basename $test .bats)" echo " Testfile "$testname"" @@ -67,7 +70,7 @@ runTests() { done else # No output folder - for test in tests/*.bats; do + for test in "$SPECDIR"/tests/*.bats; do testname="$(basename $test .bats)" echo " Testfile "$testname"" # No output folder, don't save to disk