From c499eceaa30aa43c67ed5316b35a9c9b61e4cc80 Mon Sep 17 00:00:00 2001 From: bronku Date: Fri, 21 Nov 2025 16:51:17 +0100 Subject: [PATCH] test runner --- makefile | 2 +- test/tester.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 test/tester.sh diff --git a/makefile b/makefile index 3ab1b0b..824e4c2 100644 --- a/makefile +++ b/makefile @@ -30,6 +30,6 @@ run: $(TARGET) $(TARGET) test: $(TARGET) - $(TARGET) --file test/lexer/1.in --dump-tokens + test/tester.sh .PHONY: clean run test diff --git a/test/tester.sh b/test/tester.sh new file mode 100755 index 0000000..1e4ebc2 --- /dev/null +++ b/test/tester.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +cd "$(dirname "$0")" # Change to script directory + +for test in lexer/*.in; do + name=$(basename "$test" .in) + echo "Testing $name..." + + if ! ../build/py2rb --dump-tokens < "$test" | diff - "lexer/${name}.out"; then + echo "FAILED: $name" + exit 1 + fi +done + +echo "SUCCESS: All tests passed" \ No newline at end of file