From 2d9d6e87125e79f99c3c65fcb160f97c8e6f23d0 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Fri, 24 Feb 2017 13:52:50 -0800 Subject: [PATCH] Add assert to save me from myself. 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 | 3 ++- debug/testlib.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/debug/gdbserver.py b/debug/gdbserver.py index 39396f9..6690ad9 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -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) diff --git a/debug/testlib.py b/debug/testlib.py index 11ea4fb..03ee0b4 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -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: -- 2.30.2