From f6c83b2b802ef540afcdeccdee76f006629737bd Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Sat, 28 Feb 2015 16:25:00 -0600 Subject: runtest.py: cleanup orphan test processes. --- docs/TODO | 2 +- runtest.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/TODO b/docs/TODO index 8abbf6c..e586f52 100644 --- a/docs/TODO +++ b/docs/TODO @@ -9,8 +9,8 @@ All: of iterations per second - redefine (defmacro!) as (def! (macro*)) - runtest expect fixes: - - fix C#, VB and Lua * stop using expect, so we can drop --raw option + - fix C#, VB - fix long line splitting in runtest - regular expression matching in runtest - add re (use in rep) everywhere and use that (to avoid printing) diff --git a/runtest.py b/runtest.py index 858c634..e90fc68 100755 --- a/runtest.py +++ b/runtest.py @@ -72,6 +72,12 @@ class Runner(): def write(self, str): self.stdout.write(str) + def cleanup(self): + if self.p: + self.p.terminate() + self.p = None + + args = parser.parse_args(sys.argv[1:]) test_data = args.test_file.read().split('\n') @@ -127,6 +133,7 @@ def assert_prompt(timeout): else: print "Did not get 'user> ' or 'mal-user> ' prompt" print " Got : %s" % repr(r.buf) + r.cleanup() sys.exit(1) @@ -164,7 +171,9 @@ while test_data: fail_cnt += 1 except: print "Got Exception" + r.cleanup() sys.exit(1) +r.cleanup() if fail_cnt > 0: print "FAILURES: %d" % fail_cnt -- cgit v1.2.3