Skip to content

Commit

Permalink
Add test for new OpenOCD riscv info command. (riscv-software-src#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
timsifive committed Dec 18, 2020
1 parent f7e9ef1 commit 3496243
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions debug/gdbserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,19 @@ def srec_parse(line):
def readable_binary_string(s):
return "".join("%02x" % ord(c) for c in s)

class InfoTest(GdbTest):
def test(self):
output = self.gdb.command("monitor riscv info")
info = {}
for line in output.splitlines():
if re.search(r"Found \d+ triggers", line):
continue
if re.search(r"Disabling abstract command writes to CSRs.", line):
continue
k, v = line.strip().split()
info[k] = v
assertEqual(int(info.get("hart.xlen")), self.hart.xlen)

class SimpleRegisterTest(GdbTest):
def check_reg(self, name, alias):
a = random.randrange(1<<self.hart.xlen)
Expand Down

0 comments on commit 3496243

Please sign in to comment.