diff options
| author | Joel Martin <github@martintribe.org> | 2015-02-28 16:25:00 -0600 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2015-02-28 16:25:00 -0600 |
| commit | f6c83b2b802ef540afcdeccdee76f006629737bd (patch) | |
| tree | b2807fbecab5c6bfbbbbcd94ff74fec40150d2d8 | |
| parent | 3e0b36dcee99ddfd7ea0e04a382c1ad3858fc45f (diff) | |
| download | mal-f6c83b2b802ef540afcdeccdee76f006629737bd.tar.gz mal-f6c83b2b802ef540afcdeccdee76f006629737bd.zip | |
runtest.py: cleanup orphan test processes.
| -rw-r--r-- | docs/TODO | 2 | ||||
| -rwxr-xr-x | runtest.py | 9 |
2 files changed, 10 insertions, 1 deletions
@@ -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) @@ -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 |
