diff --git a/.gitignore b/.gitignore index 6237ddae6..9bb0f983a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ *.kdev4 /.kdev4 __pycache__ +tests-out \ No newline at end of file diff --git a/README.markdown b/README.markdown index 787435ce7..f1faa0f48 100644 --- a/README.markdown +++ b/README.markdown @@ -26,7 +26,8 @@ https://github.com/zrax/pycdc * Build the generated project or makefile * For projects (e.g. MSVC), open the generated project file and build it * For makefiles, just run `make` - * To run tests (on \*nix or MSYS), run `make check` + * To run tests (on \*nix or MSYS), run `make check JOBS=4` (optional + `FILTER=xxxx` to run only certain tests) ## Usage **To run pycdas**, the PYC Disassembler: diff --git a/tests/all_tests.sh b/tests/all_tests.sh index 2e3dd6c4c..a58b12af4 100755 --- a/tests/all_tests.sh +++ b/tests/all_tests.sh @@ -1,13 +1,9 @@ #!/bin/bash -srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)" +cd "$(dirname "$0")"/.. +jobs=${JOBS:-4} +filter=${FILTER:-""} -test_status=0 -test_files=( "$srcdir"/tests/tokenized/*.txt ) -for tf in "${test_files[@]}"; do - test_name="$(basename "$tf")" - test_name="${test_name%.txt}" - "$srcdir"/tests/decompyle_test.sh $test_name tests || test_status=1 -done - -exit $test_status +find tests/tokenized -type f -name '*.txt' -a -name "*${filter}*" -print0 | \ + xargs -0 -I '{}' -P $jobs \ + bash -c 'echo -e "$(tests/decompyle_test.sh "$(basename -s .txt "{}")" tests-out)"'