# HG changeset patch # User Benoit Boissinot # Date 1147349178 -7200 # Node ID 7e43d68f390089eb6189a582dc112571ce678f25 # Parent 8dafccbcede96ed808f9df528b93f46230984da4 catch KeyboardInterrupt in run-tests diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -242,24 +242,28 @@ PYTHONDIR = os.path.join(INST, "lib", "p COVERAGE_FILE = os.path.join(TESTDIR, ".coverage") try: - install_hg() + try: + install_hg() - tests = 0 - failed = 0 + tests = 0 + failed = 0 - if len(args) == 0: - args = os.listdir(".") - for test in args: - if test.startswith("test-"): - if '~' in test or re.search(r'\.(out|err)$', test): - continue - if not run_one(test): - failed += 1 - tests += 1 + if len(args) == 0: + args = os.listdir(".") + for test in args: + if test.startswith("test-"): + if '~' in test or re.search(r'\.(out|err)$', test): + continue + if not run_one(test): + failed += 1 + tests += 1 - print "\n# Ran %d tests, %d failed." % (tests, failed) - if coverage: - output_coverage() + print "\n# Ran %d tests, %d failed." % (tests, failed) + if coverage: + output_coverage() + except KeyboardInterrupt: + failed = True + print "\ninterrupted!" finally: cleanup_exit()