Speed these tests up quite significantly by using the SB API instead of running the...
authorEnrico Granata <egranata@apple.com>
Wed, 21 Jan 2015 22:51:59 +0000 (22:51 +0000)
committerEnrico Granata <egranata@apple.com>
Wed, 21 Jan 2015 22:51:59 +0000 (22:51 +0000)
The reason why one mechanism is so much faster than the other (as in, ~10 seconds vs. ~1 minute) is quite baffling to me at the moment, but these are not process handling tests, so do what's faster

llvm-svn: 226730

lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/Makefile
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/main.cpp
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/Makefile
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/main.cpp

index f2f2b3f..d473b14 100644 (file)
@@ -3,6 +3,3 @@ LEVEL = ../../../../../make
 CXX_SOURCES := main.cpp
 
 include $(LEVEL)/Makefile.rules
-
-CXXFLAGS += -stdlib=libc++ -O0
-LDFLAGS += -stdlib=libc++
\ No newline at end of file
index 542abaf..4807cb9 100644 (file)
@@ -34,7 +34,7 @@ class LibcxxMapDataFormatterTestCase(TestBase):
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")
+        bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -56,14 +56,12 @@ class LibcxxMapDataFormatterTestCase(TestBase):
         self.addTearDownHook(cleanup)
 
         self.expect('image list', substrs = self.getLibcPlusPlusLibs())
-
-        self.runCmd("frame variable ii --show-types")
                 
         self.expect('frame variable ii',
             substrs = ['size=0',
                        '{}'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
 
         self.expect('frame variable ii',
                     substrs = ['size=2',
@@ -74,7 +72,7 @@ class LibcxxMapDataFormatterTestCase(TestBase):
                                'first = 1',
                                'second = 1'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
 
         self.expect('frame variable ii',
                     substrs = ['size=4',
@@ -85,7 +83,7 @@ class LibcxxMapDataFormatterTestCase(TestBase):
                                'first = 3',
                                'second = 1'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
 
         self.expect("frame variable ii",
                     substrs = ['size=8',
@@ -129,8 +127,6 @@ class LibcxxMapDataFormatterTestCase(TestBase):
         self.expect('frame variable ii',
                     substrs = ['size=0',
                                '{}'])
-        
-        self.runCmd("frame variable si --show-types")
 
         self.expect('frame variable si',
                     substrs = ['size=0',
@@ -144,7 +140,7 @@ class LibcxxMapDataFormatterTestCase(TestBase):
                                'first = \"zero\"',
                                'second = 0'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
 
         self.expect("frame variable si",
                     substrs = ['size=4',
@@ -192,20 +188,19 @@ class LibcxxMapDataFormatterTestCase(TestBase):
         #self.expect("expression si[0]", matching=False, error=True,
         #            substrs = ['first = ', 'zero'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
         
         self.expect('frame variable si',
                     substrs = ['size=0',
                                '{}'])
 
-        self.runCmd("continue");
-        self.runCmd("frame variable is --show-types")
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
         
         self.expect('frame variable is',
                     substrs = ['size=0',
                                '{}'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
 
         self.expect("frame variable is",
                     substrs = ['size=4',
@@ -253,20 +248,19 @@ class LibcxxMapDataFormatterTestCase(TestBase):
         #self.expect("expression is[0]", matching=False, error=True,
         #            substrs = ['first = ', 'goofy'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
         
         self.expect('frame variable is',
                     substrs = ['size=0',
                                '{}'])
 
-        self.runCmd("continue");
-        self.runCmd("frame variable ss --show-types")
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
         
         self.expect('frame variable ss',
                     substrs = ['size=0',
                                '{}'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
 
         self.expect("frame variable ss",
                     substrs = ['size=3',
@@ -307,7 +301,7 @@ class LibcxxMapDataFormatterTestCase(TestBase):
         #self.expect("expression ss[3]", matching=False, error=True,
         #            substrs = ['gatto'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
         
         self.expect('frame variable ss',
                     substrs = ['size=0',
index 6e40b43..6247ca8 100644 (file)
@@ -1,8 +1,4 @@
 #include <string>
-#ifdef _LIBCPP_INLINE_VISIBILITY
-#undef _LIBCPP_INLINE_VISIBILITY
-#endif
-#define _LIBCPP_INLINE_VISIBILITY
 #include <map>
 
 #define intint_map std::map<int, int> 
index e681e09..d473b14 100644 (file)
@@ -3,6 +3,3 @@ LEVEL = ../../../../../make
 CXX_SOURCES := main.cpp
 
 include $(LEVEL)/Makefile.rules
-
-CXXFLAGS += -stdlib=libc++ -O0 -std=c++11
-LDFLAGS += -stdlib=libc++
\ No newline at end of file
index 9cdf807..39d948c 100644 (file)
@@ -34,7 +34,7 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")
+        bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -56,14 +56,12 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
         self.addTearDownHook(cleanup)
 
         self.expect('image list', substrs = self.getLibcPlusPlusLibs())
-
-        self.runCmd("frame variable ii --show-types")
                 
         self.expect('frame variable ii',
             substrs = ['size=0',
                        '{}'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
 
         self.expect('frame variable ii',
                     substrs = ['size=2',
@@ -74,7 +72,7 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
                                'first = 1',
                                'second = 1'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
 
         self.expect('frame variable ii',
                     substrs = ['size=4',
@@ -85,7 +83,7 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
                                'first = 3',
                                'second = 1'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
 
         self.expect("frame variable ii",
                     substrs = ['size=8',
@@ -124,19 +122,17 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
         #self.expect("expression ii[8]", matching=False, error=True,
         #            substrs = ['1234567'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
         
         self.expect('frame variable ii',
                     substrs = ['size=0',
                                '{}'])
-        
-        self.runCmd("frame variable si --show-types")
 
         self.expect('frame variable si',
                     substrs = ['size=0',
                                '{}'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
 
         self.expect('frame variable si',
                     substrs = ['size=1',
@@ -144,7 +140,7 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
                                'first = \"zero\"',
                                'second = 0'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
 
         self.expect("frame variable si",
                     substrs = ['size=4',
@@ -192,20 +188,19 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
         #self.expect("expression si[0]", matching=False, error=True,
         #            substrs = ['first = ', 'zero'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
         
         self.expect('frame variable si',
                     substrs = ['size=0',
                                '{}'])
 
-        self.runCmd("continue");
-        self.runCmd("frame variable is --show-types")
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
         
         self.expect('frame variable is',
                     substrs = ['size=0',
                                '{}'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
 
         self.expect("frame variable is",
                     substrs = ['size=4',
@@ -253,20 +248,19 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
         #self.expect("expression is[0]", matching=False, error=True,
         #            substrs = ['first = ', 'goofy'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
         
         self.expect('frame variable is',
                     substrs = ['size=0',
                                '{}'])
 
-        self.runCmd("continue");
-        self.runCmd("frame variable ss --show-types")
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
         
         self.expect('frame variable ss',
                     substrs = ['size=0',
                                '{}'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
 
         self.expect("frame variable ss",
                     substrs = ['size=3',
@@ -307,7 +301,7 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
         #self.expect("expression ss[3]", matching=False, error=True,
         #            substrs = ['gatto'])
 
-        self.runCmd("continue");
+        lldbutil.continue_to_breakpoint(self.process(), bkpt)
         
         self.expect('frame variable ss',
                     substrs = ['size=0',
index f1a6e2a..e838599 100644 (file)
@@ -1,8 +1,4 @@
 #include <string>
-#ifdef _LIBCPP_INLINE_VISIBILITY
-#undef _LIBCPP_INLINE_VISIBILITY
-#endif
-#define _LIBCPP_INLINE_VISIBILITY
 #include <map>
 
 #define intint_map std::multimap<int, int>