Add assert to save me from myself.
authorTim Newsome <tim@sifive.com>
Fri, 24 Feb 2017 21:52:50 +0000 (13:52 -0800)
committerTim Newsome <tim@sifive.com>
Fri, 24 Feb 2017 21:52:50 +0000 (13:52 -0800)
spike passes the download test, but needs a 15 minute timeout. That's
too ridiculous to put in here, but 60s is reasonable.

debug/gdbserver.py
debug/testlib.py

index 39396f9025e3c07b847a56fbdfda4a7a2817d8e5..6690ad92c85f1dfbe6fbc9c614a073478253acac 100755 (executable)
@@ -580,6 +580,7 @@ class DownloadTest(GdbTest):
         self.download_c.write("uint32_t length = %d;\n" % length)
         self.download_c.write("uint8_t d[%d] = {\n" % length)
         self.crc = 0
+        assert length % 16 == 0
         for i in range(length / 16):
             self.download_c.write("  /* 0x%04x */ " % (i * 16))
             for _ in range(16):
@@ -603,7 +604,7 @@ class DownloadTest(GdbTest):
     def test(self):
         self.gdb.load()
         self.gdb.command("b _exit")
-        self.gdb.c()
+        self.gdb.c(timeout=60)
         assertEqual(self.gdb.p("status"), self.crc)
         os.unlink(self.download_c.name)
 
index 11ea4fb5d3099fa40aa5ad6a0aaa5ceaec65f5dc..03ee0b4c3024eef87e87d6f869d1c5402799c5c9 100644 (file)
@@ -58,7 +58,7 @@ class Spike(object):
         if cmd:
             cmd = shlex.split(cmd)
         else:
-            cmd = ["spike", "-l"]
+            cmd = ["spike"]
         if xlen == 32:
             cmd += ["--isa", "RV32"]
 
@@ -281,9 +281,9 @@ class Gdb(object):
         self.child.expect(r"\(gdb\)", timeout=timeout)
         return self.child.before.strip()
 
-    def c(self, wait=True):
+    def c(self, wait=True, timeout=-1):
         if wait:
-            output = self.command("c")
+            output = self.command("c", timeout=timeout)
             assert "Continuing" in output
             return output
         else: