Make sure we pass return code back.

This commit is contained in:
rocky
2015-12-13 22:58:20 -05:00
parent 4019b4a946
commit 232b5fe70e
2 changed files with 20 additions and 3 deletions

View File

@@ -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:

View File

@@ -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)