summaryrefslogtreecommitdiffstatshomepage
path: root/tests/bytecode/run-tests
blob: 06878fe61e0118746dd71e7b14ee4110f14a7e6a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash

CPYTHON3=python3.4
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.4/compileall.py $file
        $CPYTHON3 -B unpyc.py $1/__pycache__/$basename.cpython-34.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