[Lldb-commits] [lldb] r219828 - Make this test case more resilient in the face of line-table and inlining changes

Enrico Granata egranata at apple.com
Wed Oct 15 11:42:45 PDT 2014


Author: enrico
Date: Wed Oct 15 13:42:45 2014
New Revision: 219828

URL: http://llvm.org/viewvc/llvm-project?rev=219828&view=rev
Log:
Make this test case more resilient in the face of line-table and inlining changes

Modified:
    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/main.cpp

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py?rev=219828&r1=219827&r2=219828&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py Wed Oct 15 13:42:45 2014
@@ -29,16 +29,12 @@ class LibcxxVectorDataFormatterTestCase(
     def setUp(self):
         # Call super's setUp().
         TestBase.setUp(self)
-        # Find the line number to break at.
-        self.line = line_number('main.cpp', '// Set break point at this line.')
-        self.line2 = line_number('main.cpp', '// Set second break point at this line.')
 
     def data_formatter_commands(self):
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
-        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line2, num_expected_locations=-1)
+        lldbutil.run_break_set_by_source_regexp (self, regexp="break here")
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -63,7 +59,7 @@ class LibcxxVectorDataFormatterTestCase(
         self.expect("frame variable numbers",
             substrs = ['numbers = size=0'])
 
-        self.runCmd("n")
+        self.runCmd("continue")
         
         # first value added
         self.expect("frame variable numbers",
@@ -72,7 +68,7 @@ class LibcxxVectorDataFormatterTestCase(
                                '}'])
 
         # add some more data
-        self.runCmd("n");self.runCmd("n");self.runCmd("n");
+        self.runCmd("continue");
     
         self.expect("frame variable numbers",
                     substrs = ['numbers = size=4',
@@ -104,7 +100,7 @@ class LibcxxVectorDataFormatterTestCase(
         self.runCmd("type summary delete int_vect")
 
         # add some more data
-        self.runCmd("n");self.runCmd("n");self.runCmd("n");
+        self.runCmd("continue");
 
         self.expect("frame variable numbers",
                     substrs = ['numbers = size=7',
@@ -139,12 +135,12 @@ class LibcxxVectorDataFormatterTestCase(
                     substrs = ['1234']);
 
         # clear out the vector and see that we do the right thing once again
-        self.runCmd("n")
+        self.runCmd("continue")
 
         self.expect("frame variable numbers",
             substrs = ['numbers = size=0'])
 
-        self.runCmd("n")
+        self.runCmd("continue")
 
         # first value added
         self.expect("frame variable numbers",
@@ -153,8 +149,6 @@ class LibcxxVectorDataFormatterTestCase(
                                '}'])
 
         # check if we can display strings
-        self.runCmd("c")
-
         self.expect("frame variable strings",
             substrs = ['goofy',
                        'is',
@@ -179,7 +173,7 @@ class LibcxxVectorDataFormatterTestCase(
                                'is',
                                'smart'])
 
-        self.runCmd("n")
+        self.runCmd("continue")
 
         self.expect("frame variable strings",
                     substrs = ['vector has 4 items'])
@@ -190,7 +184,7 @@ class LibcxxVectorDataFormatterTestCase(
         self.expect("frame variable strings[1]",
                     substrs = ['is']);
 
-        self.runCmd("n")
+        self.runCmd("continue")
 
         self.expect("frame variable strings",
             substrs = ['vector has 0 items'])

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/main.cpp?rev=219828&r1=219827&r2=219828&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/main.cpp (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/main.cpp Wed Oct 15 13:42:45 2014
@@ -10,26 +10,26 @@ typedef std::vector<std::string> string_
 int main()
 {
     int_vect numbers;
-    (numbers.push_back(1));  // Set break point at this line.
-    (numbers.push_back(12));
+    (numbers.push_back(1));  // break here
+    (numbers.push_back(12));  // break here
     (numbers.push_back(123));
     (numbers.push_back(1234));
-    (numbers.push_back(12345));
+    (numbers.push_back(12345)); // break here
     (numbers.push_back(123456));
     (numbers.push_back(1234567));
     
-    numbers.clear();
+    numbers.clear(); // break here
     
-    (numbers.push_back(7));
+    (numbers.push_back(7)); // break here
 
     string_vect strings;
     (strings.push_back(std::string("goofy")));
     (strings.push_back(std::string("is")));
     (strings.push_back(std::string("smart")));
     
-    (strings.push_back(std::string("!!!"))); // Set second break point at this line.
+    (strings.push_back(std::string("!!!"))); // break here
     
-    strings.clear(); 
+    strings.clear();  // break here
     
-    return 0;
+    return 0;  // break here
 }





More information about the lldb-commits mailing list