test: Make test script work relatively to any location

This commit is contained in:
overflowerror 2024-05-17 20:01:51 +02:00
parent 481eafda5d
commit 2d41031965
2 changed files with 5 additions and 2 deletions

View file

@ -14,6 +14,7 @@ BUILTINS = obj/builtins/builtins.o obj/builtins/numbers.o \
obj/builtins/io.o
OBJS = obj/lex.yy.o obj/y.tab.o obj/codegen.o obj/codegen_expr.o \
obj/codegen_stat.o obj/ast.o obj/band.o obj/plugins.o obj/scope.o \
obj/preprocessor.o \
$(PLUGINS) $(BUILTINS) obj/main.o
DEPS = $(OBJS:%.o=%.d)

View file

@ -1,6 +1,8 @@
#/bin/sh
executable="$1"
executable="$(realpath "$1")"
cd "$(dirname "$0")"/cases/
tmpfile="/tmp/$$.tmp"
resultsfile="/tmp/$$.results"
@ -26,7 +28,7 @@ run_testcase() {
rm "$tmpfile";
}
ls cases/*.in test/cases/*.in | sed -E 's/.in$//g' | while read test; do
ls *.in | sed -E 's/.in$//g' | while read test; do
run_testcase "$test"
done