diff options
author | Tim Newsome <tim@sifive.com> | 2017-02-24 13:52:50 -0800 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2017-02-24 13:52:50 -0800 |
commit | 2d9d6e87125e79f99c3c65fcb160f97c8e6f23d0 (patch) | |
tree | a9c09145864d7c9479ec62ec15045ba0f6be6e47 | |
parent | 41afc80e8b816e361388e0025a42108bde55b6a1 (diff) | |
download | riscv-tests-2d9d6e87125e79f99c3c65fcb160f97c8e6f23d0.zip riscv-tests-2d9d6e87125e79f99c3c65fcb160f97c8e6f23d0.tar.gz riscv-tests-2d9d6e87125e79f99c3c65fcb160f97c8e6f23d0.tar.bz2 |
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.
-rwxr-xr-x | debug/gdbserver.py | 3 | ||||
-rw-r--r-- | 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: |