From e24b8a03b967ffd3f605520ded9663a8e953c231 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Wed, 21 Jan 2015 22:51:59 +0000 Subject: [PATCH] Speed these tests up quite significantly by using the SB API instead of running the "continue" command at each step 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 --- .../data-formatter-stl/libcxx/map/Makefile | 3 -- .../libcxx/map/TestDataFormatterLibccMap.py | 30 ++++++++----------- .../data-formatter-stl/libcxx/map/main.cpp | 4 --- .../data-formatter-stl/libcxx/multimap/Makefile | 3 -- .../multimap/TestDataFormatterLibccMultiMap.py | 34 +++++++++------------- .../data-formatter-stl/libcxx/multimap/main.cpp | 4 --- 6 files changed, 26 insertions(+), 52 deletions(-) diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/Makefile b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/Makefile index f2f2b3f2..d473b14 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/Makefile +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/Makefile @@ -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 diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py index 542abaf..4807cb9 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py @@ -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', diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/main.cpp b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/main.cpp index 6e40b43..6247ca8 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/main.cpp +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/main.cpp @@ -1,8 +1,4 @@ #include -#ifdef _LIBCPP_INLINE_VISIBILITY -#undef _LIBCPP_INLINE_VISIBILITY -#endif -#define _LIBCPP_INLINE_VISIBILITY #include #define intint_map std::map diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/Makefile b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/Makefile index e681e09..d473b14 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/Makefile +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/Makefile @@ -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 diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py index 9cdf807..39d948c 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py @@ -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', diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/main.cpp b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/main.cpp index f1a6e2a..e838599 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/main.cpp +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/main.cpp @@ -1,8 +1,4 @@ #include -#ifdef _LIBCPP_INLINE_VISIBILITY -#undef _LIBCPP_INLINE_VISIBILITY -#endif -#define _LIBCPP_INLINE_VISIBILITY #include #define intint_map std::multimap -- 2.7.4