[lldb] Fix TestDataFormatterGenericList
authorPavel Labath <pavel@labath.sk>
Wed, 8 Dec 2021 12:38:35 +0000 (13:38 +0100)
committerPavel Labath <pavel@labath.sk>
Wed, 8 Dec 2021 12:38:35 +0000 (13:38 +0100)
Test is using "next" commands to make progress in the process. D115137
added an additional statement to the program, without adding a command
to step over it. This only seemed to matter for the libc++ flavour of
the test, possibly because libstdc++ list is "empty" in its
uninitialized state.

Since moving with step commands is a treacherous, this patch adds a
run-to-breakpoint command to the test. It only does this for the
affected step, but one may consider doing it elsewhere too.

lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/list/TestDataFormatterGenericList.py

index d430351..82fe84e 100644 (file)
@@ -161,7 +161,9 @@ class GenericListDataFormatterTestCase(TestBase):
 
         self.runCmd("type format delete int")
 
-        self.runCmd("n")
+        lldbutil.run_break_set_by_file_and_line(self, "main.cpp",
+                self.optional_line)
+        self.runCmd("continue")
 
         self.expect("frame variable text_list",
                     substrs=['size=0',
@@ -259,4 +261,4 @@ class GenericListDataFormatterTestCase(TestBase):
 
     @add_test_categories(["libc++"])
     def test_ptr_and_ref_libcpp(self):
-        self.do_test_ptr_and_ref(USE_LIBCPP)
\ No newline at end of file
+        self.do_test_ptr_and_ref(USE_LIBCPP)