python2ruby/test/tester.sh
2025-12-06 13:01:30 +01:00

29 lines
728 B
Bash
Executable file

#!/bin/bash
cd "$(dirname "$0")"
for test in lexer/*.in; do
name=$(basename "$test" .in)
echo "Testing $test"
if ! ../build/py2rb --dump-tokens --no-output --no-parsing < "$test" | diff - "lexer/${name}.out"; then
echo "FAILED: $test"
exit 1
fi
done
for test in parser/*.in; do
name=$(basename "$test" .in)
echo "Testing $test"
if ! ../build/py2rb --dump-ast --no-output < "$test" | diff - "parser/${name}.out"; then
echo "FAILED: $test"
exit 1
fi
done
for test in ruby/*.in; do
name=$(basename "$test" .in)
echo "Testing $test"
if ! ../build/py2rb < "$test" | diff - "ruby/${name}.out"; then
echo "FAILED: $test"
exit 1
fi
done