updated tester

This commit is contained in:
bronku 2025-12-06 13:01:30 +01:00
parent 08c95294f6
commit b011a5d94c

View file

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