Add test of compare-sections command.
authorTim Newsome <tim@sifive.com>
Fri, 9 Dec 2016 17:25:03 +0000 (09:25 -0800)
committerTim Newsome <tim@sifive.com>
Fri, 9 Dec 2016 17:25:03 +0000 (09:25 -0800)
debug/gdbserver.py

index d236a97ede389e4e8fa57da21c1c1882ee6f577d..000b52c464954307d4b9ce0e1dfd4de6f1668d71 100755 (executable)
@@ -271,6 +271,16 @@ class DebugTest(GdbTest):
         assertIn("_exit", output)
         assertEqual(self.gdb.p("status"), expected_result)
 
+class DebugCompareSections(DebugTest):
+    def test(self):
+        output = self.gdb.command("compare-sections")
+        matched = 0
+        for line in output.splitlines():
+            if line.startswith("Section"):
+                assert line.endswith("matched.")
+                matched += 1
+        assertGreater(matched, 1)
+
 class DebugFunctionCall(DebugTest):
     def test(self):
         self.gdb.b("main:start")