[Lldb-commits] [lldb] Fix test assertions in TestDAP_stepInTargets.py (PR #96687)

Kendal Harland via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 12 10:42:57 PDT 2024


================
@@ -55,14 +55,23 @@ def test_basic(self):
         self.assertEqual(len(step_in_targets), 3, "expect 3 step in targets")
 
         # Verify the target names are correct.
-        self.assertEqual(step_in_targets[0]["label"], "bar()", "expect bar()")
-        self.assertEqual(step_in_targets[1]["label"], "bar2()", "expect bar2()")
-        self.assertEqual(
-            step_in_targets[2]["label"], "foo(int, int)", "expect foo(int, int)"
-        )
+        # The order of funcA and funcB may change depending on the compiler ABI.
+        funcA_target = None
+        funcB_target = None
+        for target in step_in_targets[0:2]:
+            if "funcB" in target["label"]:
+                funcB_target = target
+            elif "funcA" in target["label"]:
+                funcA_target = target
+            else:
+                self.fail(f"Unexpected step in target: {target}")
+
+        self.assertIsNotNone(funcA_target, "expect funcA")
+        self.assertIsNotNone(funcB_target, "expect funcB")
+        self.assertIn("foo", step_in_targets[2]["label"], "expect foo")
 
-        # Choose to step into second target and verify that we are in bar2()
-        self.stepIn(threadId=tid, targetId=step_in_targets[1]["id"], waitForStop=True)
+        # Choose to step into second target and verify that we are in funcB()
----------------
kendalharland wrote:

I used @expectFailureAll rather than @skipIf, not realizing that the test _must_ fail if the latter is used. Updated in the latest commit. I'll need help landing as I don't have write access. Thank you all for the reviews!

https://github.com/llvm/llvm-project/pull/96687


More information about the lldb-commits mailing list