diff options
Diffstat (limited to 'tests/run_python_generator_tests.sh')
-rwxr-xr-x | tests/run_python_generator_tests.sh | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/run_python_generator_tests.sh b/tests/run_python_generator_tests.sh index 64b39c6..e11b8f5 100755 --- a/tests/run_python_generator_tests.sh +++ b/tests/run_python_generator_tests.sh @@ -3,22 +3,26 @@ set -euxo pipefail mkdir -p out/ +OUT_DIR="$(pwd)/out" + +# move to `pdl-compiler` directory +cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." &> /dev/null sed -e 's/little_endian_packets/big_endian_packets/' \ -e '/Start: little_endian_only/,/End: little_endian_only/d' \ - < tests/canonical/le_test_file.pdl > out/be_test_file.pdl + < tests/canonical/le_test_file.pdl > "$OUT_DIR"/be_test_file.pdl -pdlc tests/canonical/le_test_file.pdl > out/le_test_file.json -pdlc out/be_test_file.pdl > out/be_test_file.json +pdlc tests/canonical/le_test_file.pdl > "$OUT_DIR"/le_test_file.json +pdlc "$OUT_DIR"/be_test_file.pdl > "$OUT_DIR"/be_test_file.json python3 scripts/generate_python_backend.py \ - --input out/le_test_file.json \ - --output out/le_backend.py \ + --input "$OUT_DIR"/le_test_file.json \ + --output "$OUT_DIR"/le_backend.py \ --custom-type-location tests.custom_types python3 scripts/generate_python_backend.py \ - --input out/be_test_file.json \ - --output out/be_backend.py \ + --input "$OUT_DIR"/be_test_file.json \ + --output "$OUT_DIR"/be_backend.py \ --custom-type-location tests.custom_types -export PYTHONPATH="./out:.:${PYTHONPATH:-}" +export PYTHONPATH="$OUT_DIR:.:${PYTHONPATH:-}" python3 tests/python_generator_test.py |