python2ruby/test/tester.sh
2025-12-01 11:26:42 +01:00

43 lines
No EOL
1,023 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 "=== Ruby output TESTS ==="
for test in ruby/*.in; do
name=$(basename "$test" .in)
echo "Testing ruby output/$name..."
if ! ../build/py2rb < "$test" | diff - "ruby/${name}.out"; then
echo "FAILED: ruby output/$name"
exit 1
fi
done
echo "✓ All ruby output tests passed"
. .
echo ""
echo "SUCCESS: All tests passed"