| 1 |
#!/bin/sh |
| 2 |
set -e |
| 3 |
|
| 4 |
trap 'rm -f main' EXIT |
| 5 |
|
| 6 |
# Compile the upstream CLI runner against the installed shared library. |
| 7 |
# Named 'main' since tests/922_py_compile.py hardcodes './main' as the |
| 8 |
# interpreter name when spawning sub-processes via os.system(). |
| 9 |
# PK_ENABLE_OS=1 matches the default CMake build configuration. |
| 10 |
gcc -std=c11 -o main src2/main.c \ |
| 11 |
-DPK_ENABLE_OS=1 -lpocketpy -lm -ldl |
| 12 |
|
| 13 |
# Run the upstream test scripts using the compiled runner. |
| 14 |
failed=0 |
| 15 |
for f in $(find tests -maxdepth 1 -name '*.py' | sort); do |
| 16 |
echo "> $f" |
| 17 |
if ! ./main "$f"; then |
| 18 |
echo "FAILED: $f" |
| 19 |
failed=1 |
| 20 |
fi |
| 21 |
done |
| 22 |
|
| 23 |
if [ "$failed" -ne 0 ]; then |
| 24 |
echo "One or more test scripts failed" |
| 25 |
exit 1 |
| 26 |
fi |
| 27 |
|
| 28 |
echo "All test scripts passed" |