Properly clean up spike.
authorTim Newsome <tim@sifive.com>
Sun, 13 Mar 2016 23:23:59 +0000 (16:23 -0700)
committerTim Newsome <tim@sifive.com>
Mon, 23 May 2016 19:12:10 +0000 (12:12 -0700)
tests/gdbserver-smoke.py
tests/testlib.py

index 9cdac06289d1b14702f8dc6f2a5aae80356a065c..770e77ad1e9c6621642e00811efdb1092d4a996c 100755 (executable)
@@ -16,8 +16,9 @@ class SmokeTest(unittest.TestCase):
         self.gdb.command("target extended-remote localhost:9824")
         self.gdb.command("p i=0");
 
-    def cleanUp(self):
+    def tearDown(self):
         self.spike.kill()
+        self.spike.wait()
 
     def test_turbostep(self):
         """Single step until the program exits. TODO"""
index 1f60ce6b188e10c6fdc55f5af3379eaf54655273..04acbfc32993fe703a7b48f9c2f8bcbbe2449a62 100644 (file)
@@ -26,7 +26,7 @@ def spike(binary, halted=False):
         cmd.append('-H')
     cmd += ['pk', binary]
     logfile = open("spike.log", "w")
-    return subprocess.Popen(cmd, stdout=logfile, stderr=logfile)
+    return subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=logfile, stderr=logfile)
 
 class Gdb(object):
     def __init__(self):