test runner

This commit is contained in:
bronku 2025-11-21 16:51:17 +01:00
parent 87fb5da13d
commit c499eceaa3
2 changed files with 16 additions and 1 deletions

View file

@ -30,6 +30,6 @@ run: $(TARGET)
$(TARGET)
test: $(TARGET)
$(TARGET) --file test/lexer/1.in --dump-tokens
test/tester.sh
.PHONY: clean run test

15
test/tester.sh Executable file
View file

@ -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"