python2ruby/test/tester.sh
2025-11-27 15:45:18 +01:00

30 lines
No EOL
697 B
Bash
Executable file

#!/bin/bash
cd "$(dirname "$0")"
echo "=== LEXER TESTS ==="
for test in lexer/*.in; do
name=$(basename "$test" .in)
echo "Testing lexer/$name..."
if ! ../build/py2rb --dump-tokens < "$test" | diff - "lexer/${name}.out"; then
echo "FAILED: lexer/$name"
exit 1
fi
done
echo "✓ All lexer tests passed"
echo ""
echo "=== PARSER TESTS ==="
for test in parser/*.in; do
name=$(basename "$test" .in)
echo "Testing parser/$name..."
if ! ../build/py2rb --dump-ast < "$test" | diff - "parser/${name}.out"; then
echo "FAILED: parser/$name"
exit 1
fi
done
echo "✓ All parser tests passed"
echo ""
echo "SUCCESS: All tests passed"