diff --git a/test/Makefile b/test/Makefile index 9930aa48..626232da 100644 --- a/test/Makefile +++ b/test/Makefile @@ -3,16 +3,26 @@ PHONY=check clean dist distclean test test-unit test-functional rmChangeLog clea GIT2CL ?= git2cl PYTHON ?= python -# Set COMILE='--compile' to force compilation before check +# Set COMPILE='--compile' to force compilation before check COMPILE ?= #: Run all tests check: check-short check-2.7-ok +## FIXME: there is a bug in our code that I don't +## find in uncompyle2 that causes this to fail. +## parsing. +## the failing program works if run by itself. +## This leads me to believe the problem is an +## initialization bug? + +#: Check deparsing only, but from a different Python version +check-bytecode: + $(PYTHON) test_pythonlib.py --bytecode-2.5 + #: Run quick tests check-short: $(PYTHON) test_pythonlib.py --base-2.7 --verify $(COMPILE) - $(PYTHON) test_pythonlib.py --bytecode-2.5 #: Run longer Python 2.7's lib files known to be okay check-2.7-ok: diff --git a/test/test_pythonlib.py b/test/test_pythonlib.py index 77e3f34f..41e7217c 100755 --- a/test/test_pythonlib.py +++ b/test/test_pythonlib.py @@ -148,7 +148,14 @@ def do_tests(src_dir, obj_patterns, target_dir, opts): print('Source directory: ', src_dir) print('Output directory: ', target_dir) try: - main(src_dir, target_dir, files, [], do_verify=opts['do_verify']) + _, _, failed_files, failed_verify = \ + main(src_dir, target_dir, files, [], + do_verify=opts['do_verify']) + if failed_files != 0: + exit(2) + elif failed_verify != 0: + exit(3) + except (KeyboardInterrupt, OSError): print() exit(1)