aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2015-02-28 16:25:00 -0600
committerJoel Martin <github@martintribe.org>2015-02-28 16:25:00 -0600
commitf6c83b2b802ef540afcdeccdee76f006629737bd (patch)
treeb2807fbecab5c6bfbbbbcd94ff74fec40150d2d8
parent3e0b36dcee99ddfd7ea0e04a382c1ad3858fc45f (diff)
downloadmal-f6c83b2b802ef540afcdeccdee76f006629737bd.tar.gz
mal-f6c83b2b802ef540afcdeccdee76f006629737bd.zip
runtest.py: cleanup orphan test processes.
-rw-r--r--docs/TODO2
-rwxr-xr-xruntest.py9
2 files changed, 10 insertions, 1 deletions
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