Actually test something in regs test.
authorTim Newsome <tim@sifive.com>
Wed, 19 Oct 2016 20:16:47 +0000 (13:16 -0700)
committerTim Newsome <tim@sifive.com>
Wed, 19 Oct 2016 20:16:47 +0000 (13:16 -0700)
debug/openocd.py

index 0c7e7d2a277a5c71d1cf1f067aa5ca4efcdffc7c..4a71035e4f3977ea49794450d373db3af26eac4f 100755 (executable)
@@ -7,7 +7,7 @@ import sys
 
 import targets
 import testlib
-from testlib import assertGreater
+from testlib import assertRegexpMatches
 
 class OpenOcdTest(testlib.BaseTest):
     def __init__(self, target):
@@ -23,8 +23,10 @@ class OpenOcdTest(testlib.BaseTest):
 
 class RegTest(OpenOcdTest):
     def test(self):
+        self.cli.command("halt")
         output = self.cli.command("reg")
-        assertGreater(len(output), 1)
+        assertRegexpMatches(output, r"x18 \(/%d\): 0x[0-9A-F]+" %
+                self.target.xlen)
 
 def main():
     parser = argparse.ArgumentParser(