diff options
| author | Damien | 2013-12-29 18:21:02 +0000 |
|---|---|---|
| committer | Damien | 2013-12-29 18:21:02 +0000 |
| commit | 2eda70874ef193c609207db2ba87324244afcf84 (patch) | |
| tree | 5a570df6296c40f7774d6d25cd3cc4c38fc1e1ff /tests/bytecode/run-tests | |
| parent | de690d128bbec4f53e8a7d6149738a6facae4382 (diff) | |
Add tests to test compiler and emitted byte code.
Diffstat (limited to 'tests/bytecode/run-tests')
| -rwxr-xr-x | tests/bytecode/run-tests | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/bytecode/run-tests b/tests/bytecode/run-tests new file mode 100755 index 000000000..6d8b9cd39 --- /dev/null +++ b/tests/bytecode/run-tests @@ -0,0 +1,30 @@ +#!/bin/bash + +CPYTHON3=python3.3 +MP_CPY=../../unix-cpy/cpy + +RM=/bin/rm + +mkdir -p output + +function run_test_on_dir() { + echo "" + echo "Testing directory $1..." + echo "" + + for file in $1/*.py + do + basename=$(basename $file .py) + + $CPYTHON3 -B -c "import compileall; compileall.compile_file('$file', quiet=True)" + #/usr/lib/python3.3/compileall.py $file + $CPYTHON3 -B unpyc.py $1/__pycache__/$basename.cpython-33.pyc > output/$basename.pycout + + $MP_CPY $file | $CPYTHON3 -B check.py output/$basename.pycout + done + + echo "" +} + +run_test_on_dir mp-tests +run_test_on_dir pylib-tests |
