diff options
| author | Tamas Berghammer <tberghammer@google.com> | 2015-09-30 10:12:40 +0000 |
|---|---|---|
| committer | Tamas Berghammer <tberghammer@google.com> | 2015-09-30 10:12:40 +0000 |
| commit | c8fd130a2cbf7ade53d05e597f9d48e8c2f37442 (patch) | |
| tree | 3c9cfb6d1674ee147e83fb80c6ab25e0444ad958 /lldb/test/expression_command | |
| parent | ebfd72493cc68b085d3feac59f032acb518f4163 (diff) | |
| download | bcm5719-llvm-c8fd130a2cbf7ade53d05e597f9d48e8c2f37442.tar.gz bcm5719-llvm-c8fd130a2cbf7ade53d05e597f9d48e8c2f37442.zip | |
Merge dwarf and dsym tests
Currently most of the test files have a separate dwarf and a separate
dsym test with almost identical content (only the build step is
different). With adding dwo symbol file handling to the test suit it
would increase this to a 3-way duplication. The purpose of this change
is to eliminate this redundancy with generating 2 test case (one dwarf
and one dsym) for each test function specified (dwo handling will be
added at a later commit).
Main design goals:
* There should be no boilerplate code in each test file to support the
multiple debug info in most of the tests (custom scenarios are
acceptable in special cases) so adding a new test case is easier and
we can't miss one of the debug info type.
* In case of a test failure, the debug symbols used during the test run
have to be cleanly visible from the output of dotest.py to make
debugging easier both from build bot logs and from local test runs
* Each test case should have a unique, fully qualified name so we can
run exactly 1 test with "-f <test-case>.<test-function>" syntax
* Test output should be grouped based on test files the same way as it
happens now (displaying dwarf/dsym results separately isn't
preferable)
Proposed solution (main logic in lldbtest.py, rest of them are test
cases fixed up for the new style):
* Have only 1 test fuction in the test files what will run for all
debug info separately and this test function should call just
"self.build(...)" to build an inferior with the right debug info
* When a class is created by python (the class object, not the class
instance), we will generate a new test method for each debug info
format in the test class with the name "<test-function>_<debug-info>"
and remove the original test method. This way unittest2 see multiple
test methods (1 for each debug info, pretty much as of now) and will
handle the test selection and the failure reporting correctly (the
debug info will be visible from the end of the test name)
* Add new annotation @no_debug_info_test to disable the generation of
multiple tests for each debug info format when the test don't have an
inferior
Differential revision: http://reviews.llvm.org/D13028
llvm-svn: 248883
Diffstat (limited to 'lldb/test/expression_command')
23 files changed, 40 insertions, 174 deletions
diff --git a/lldb/test/expression_command/call-function/TestCallStdStringFunction.py b/lldb/test/expression_command/call-function/TestCallStdStringFunction.py index da26763bb13..ca09285858e 100644 --- a/lldb/test/expression_command/call-function/TestCallStdStringFunction.py +++ b/lldb/test/expression_command/call-function/TestCallStdStringFunction.py @@ -18,24 +18,12 @@ class ExprCommandCallFunctionTestCase(TestBase): self.line = line_number('main.cpp', '// Please test these expressions while stopped at this line:') - @skipUnlessDarwin - @dsym_test - def test_with_dsym(self): - """Test calling std::String member function.""" - self.buildDsym() - self.call_function() - - @dwarf_test - @expectedFailureFreeBSD('llvm.org/pr17807') # Fails on FreeBSD buildbot @expectedFailureIcc # llvm.org/pr14437, fails with ICC 13.1 + @expectedFailureFreeBSD('llvm.org/pr17807') # Fails on FreeBSD buildbot @expectedFailureWindows("llvm.org/pr21765") - def test_with_dwarf(self): - """Test calling std::String member function.""" - self.buildDwarf() - self.call_function() - - def call_function(self): + def test_with(self): """Test calling std::String member function.""" + self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) # Some versions of GCC encode two locations for the 'return' statement in main.cpp diff --git a/lldb/test/expression_command/call-function/TestCallStopAndContinue.py b/lldb/test/expression_command/call-function/TestCallStopAndContinue.py index 1c50e73e185..1f34ad3addc 100644 --- a/lldb/test/expression_command/call-function/TestCallStopAndContinue.py +++ b/lldb/test/expression_command/call-function/TestCallStopAndContinue.py @@ -20,24 +20,11 @@ class ExprCommandCallStopContinueTestCase(TestBase): self.func_line = line_number ('main.cpp', '{ 5, "five" }') - @skipUnlessDarwin - @dsym_test - @expectedFlakeyDarwin("llvm.org/pr20274") - def test_with_dsym(self): - """Test gathering result from interrupted function call.""" - self.buildDsym() - self.call_function() - - @dwarf_test @expectedFlakeyDarwin("llvm.org/pr20274") @expectedFailureWindows("llvm.org/pr24489: Name lookup not working correctly on Windows") - def test_with_dwarf(self): - """Test gathering result from interrupted function call.""" - self.buildDwarf() - self.call_function() - - def call_function(self): + def test(self): """Test gathering result from interrupted function call.""" + self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) # Some versions of GCC encode two locations for the 'return' statement in main.cpp diff --git a/lldb/test/expression_command/call-function/TestCallUserDefinedFunction.py b/lldb/test/expression_command/call-function/TestCallUserDefinedFunction.py index e9764ef7772..d1a46b1ebed 100644 --- a/lldb/test/expression_command/call-function/TestCallUserDefinedFunction.py +++ b/lldb/test/expression_command/call-function/TestCallUserDefinedFunction.py @@ -22,23 +22,11 @@ class ExprCommandCallUserDefinedFunction(TestBase): # Find the line number to break for main.c. self.line = line_number('main.cpp', '// Please test these expressions while stopped at this line:') - @skipUnlessDarwin - @dsym_test - @expectedFailureDarwin("llvm.org/pr20274") # intermittent failure on MacOSX - def test_with_dsym(self): - """Test return values of user defined function calls.""" - self.buildDsym() - self.call_function() - - @dwarf_test + @expectedFailureDarwin("llvm.org/pr20274", debug_info=["dsym"]) # intermittent failure on MacOSX @expectedFailureWindows("llvm.org/pr24489: Name lookup not working correctly on Windows") - def test_with_dwarf(self): - """Test return values of user defined function calls.""" - self.buildDwarf() - self.call_functions() - - def call_functions(self): + def test(self): """Test return values of user defined function calls.""" + self.build() # Set breakpoint in main and run exe self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) diff --git a/lldb/test/expression_command/call-restarts/TestCallThatRestarts.py b/lldb/test/expression_command/call-restarts/TestCallThatRestarts.py index e6636091b57..289341e5df8 100644 --- a/lldb/test/expression_command/call-restarts/TestCallThatRestarts.py +++ b/lldb/test/expression_command/call-restarts/TestCallThatRestarts.py @@ -18,22 +18,12 @@ class ExprCommandThatRestartsTestCase(TestBase): self.main_source = "lotta-signals.c" self.main_source_spec = lldb.SBFileSpec (self.main_source) - - @skipUnlessDarwin - @dsym_test - @skipIfDarwin # llvm.org/pr19246: intermittent failure - def test_with_dsym(self): - """Test calling std::String member function.""" - self.buildDsym() - self.call_function() - - @dwarf_test @skipIfFreeBSD # llvm.org/pr19246: intermittent failure @skipIfDarwin # llvm.org/pr19246: intermittent failure @skipIfWindows # Test relies on signals, unsupported on Windows - def test_with_dwarf(self): - """Test calling std::String member function.""" - self.buildDwarf() + def test(self): + """Test calling function that hits a signal and restarts.""" + self.build() self.call_function() def check_after_call (self, num_sigchld): @@ -45,9 +35,7 @@ class ExprCommandThatRestartsTestCase(TestBase): frame = self.thread.GetFrameAtIndex(0) self.assertTrue (self.orig_frame_pc == frame.GetPC(), "Restored the zeroth frame correctly") - def call_function(self): - """Test calling function that hits a signal and restarts.""" exe_name = "a.out" exe = os.path.join(os.getcwd(), exe_name) diff --git a/lldb/test/expression_command/call-throws/TestCallThatThrows.py b/lldb/test/expression_command/call-throws/TestCallThatThrows.py index 8d54e268771..7d99d052774 100644 --- a/lldb/test/expression_command/call-throws/TestCallThatThrows.py +++ b/lldb/test/expression_command/call-throws/TestCallThatThrows.py @@ -18,19 +18,10 @@ class ExprCommandWithThrowTestCase(TestBase): self.main_source = "call-throws.m" self.main_source_spec = lldb.SBFileSpec (self.main_source) - - @skipUnlessDarwin - @dsym_test - def test_with_dsym(self): - """Test calling a function that throws and ObjC exception.""" - self.buildDsym() - self.call_function() - @skipUnlessDarwin - @dwarf_test - def test_with_dwarf(self): + def test(self): """Test calling a function that throws and ObjC exception.""" - self.buildDwarf() + self.build() self.call_function() def check_after_call (self): diff --git a/lldb/test/expression_command/char/TestExprsChar.py b/lldb/test/expression_command/char/TestExprsChar.py index 1f4a7a87591..0a8319f95cb 100644 --- a/lldb/test/expression_command/char/TestExprsChar.py +++ b/lldb/test/expression_command/char/TestExprsChar.py @@ -17,7 +17,7 @@ class ExprCharTestCase(TestBase): def do_test(self, dictionary=None): """These basic expression commands should work as expected.""" - self.buildDefault(dictionary = dictionary) + self.build(dictionary = dictionary) target = self.dbg.CreateTarget(self.exe) self.assertTrue(target) diff --git a/lldb/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py b/lldb/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py index be9832c9563..c8a97c70b93 100644 --- a/lldb/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py +++ b/lldb/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py @@ -11,16 +11,9 @@ class ExprSyscallTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @skipUnlessDarwin - @dsym_test - def test_setpgid_with_dsym(self): - self.buildDsym() - self.expr_syscall() - - @dwarf_test @expectedFailureWindows("llvm.org/pr21765") # Also getpid() is not a function on Windows anyway - def test_setpgid_with_dwarf(self): - self.buildDwarf() + def test_setpgid(self): + self.build() self.expr_syscall() def expr_syscall(self): diff --git a/lldb/test/expression_command/formatters/TestFormatters.py b/lldb/test/expression_command/formatters/TestFormatters.py index 721e5884ea3..12cf3e12871 100644 --- a/lldb/test/expression_command/formatters/TestFormatters.py +++ b/lldb/test/expression_command/formatters/TestFormatters.py @@ -18,27 +18,16 @@ class ExprFormattersTestCase(TestBase): self.line = line_number('main.cpp', '// Stop here') - @skipUnlessDarwin - @dsym_test - def test_with_dsym(self): - """Test expr + formatters for good interoperability.""" - self.buildDsym() - self.do_my_test() - @skipIfFreeBSD # llvm.org/pr24691 skipping to avoid crashing the test runner @expectedFailureFreeBSD('llvm.org/pr19011') # Newer Clang omits C1 complete object constructor @expectedFailureFreeBSD('llvm.org/pr24691') # we hit an assertion in clang @expectedFailureWindows("llvm.org/pr21765") @skipIfTargetAndroid() # skipping to avoid crashing the test runner @expectedFailureAndroid('llvm.org/pr24691') # we hit an assertion in clang - @dwarf_test - def test_with_dwarf(self): + def test(self): """Test expr + formatters for good interoperability.""" - self.buildDwarf() - self.do_my_test() + self.build() - def do_my_test(self): - # This is the function to remove the custom formats in order to have a # clean slate for the next test case. def cleanup(): diff --git a/lldb/test/expression_command/issue_11588/Test11588.py b/lldb/test/expression_command/issue_11588/Test11588.py index c78ab5f3230..be631ed1d7d 100644 --- a/lldb/test/expression_command/issue_11588/Test11588.py +++ b/lldb/test/expression_command/issue_11588/Test11588.py @@ -26,7 +26,7 @@ class Issue11581TestCase(TestBase): self.addTearDownHook(cleanup) """valobj.AddressOf() should return correct values.""" - self.buildDefault() + self.build() exe = os.path.join(os.getcwd(), "a.out") diff --git a/lldb/test/expression_command/options/TestExprOptions.py b/lldb/test/expression_command/options/TestExprOptions.py index 2dca24657a3..ae9dcf64277 100644 --- a/lldb/test/expression_command/options/TestExprOptions.py +++ b/lldb/test/expression_command/options/TestExprOptions.py @@ -28,7 +28,7 @@ class ExprOptionsTestCase(TestBase): def test_expr_options(self): """These expression command options should work as expected.""" - self.buildDefault() + self.build() # Set debugger into synchronous mode self.dbg.SetAsync(False) diff --git a/lldb/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py b/lldb/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py index c1c5eb2dbec..f58ccc1706b 100644 --- a/lldb/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py +++ b/lldb/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py @@ -18,26 +18,13 @@ class PersistObjCPointeeType(TestBase): self.line = line_number('main.m','// break here') @skipUnlessDarwin - @dsym_test @expectedFailureAll( bugnumber='http://llvm.org/pr23504', oslist=['macosx'], compiler='clang', compiler_version=['<', '7.0.0']) - def test_with_dsym(self): + def test_with(self): """Test that we can p *objcObject""" - self.buildDsym() - self.do_my_test() + self.build() - @skipUnlessDarwin - @dwarf_test - @expectedFailureAll( - bugnumber='http://llvm.org/pr23504', - oslist=['macosx'], compiler='clang', compiler_version=['<', '7.0.0']) - def test_with_dwarf(self): - """Test that we can p *objcObject""" - self.buildDwarf() - self.do_my_test() - - def do_my_test(self): def cleanup(): pass diff --git a/lldb/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py b/lldb/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py index af21086c006..6ea706a0bcb 100644 --- a/lldb/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py +++ b/lldb/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py @@ -15,21 +15,10 @@ class PersistentPtrUpdateTestCase(TestBase): # Call super's setUp(). TestBase.setUp(self) - @skipUnlessDarwin - @dsym_test - def test_with_dsym(self): + def test(self): """Test that we can have persistent pointer variables""" - self.buildDsym() - self.do_my_test() + self.build() - @skipUnlessDarwin - @dwarf_test - def test_with_dwarf(self): - """Test that we can have persistent pointer variables""" - self.buildDwarf() - self.do_my_test() - - def do_my_test(self): def cleanup(): pass diff --git a/lldb/test/expression_command/persistent_types/TestNestedPersistentTypes.py b/lldb/test/expression_command/persistent_types/TestNestedPersistentTypes.py index 5802d497505..b9269058f37 100644 --- a/lldb/test/expression_command/persistent_types/TestNestedPersistentTypes.py +++ b/lldb/test/expression_command/persistent_types/TestNestedPersistentTypes.py @@ -14,7 +14,7 @@ class NestedPersistentTypesTestCase(TestBase): @expectedFailureWindows("llvm.org/pr21765") def test_persistent_types(self): """Test that nested persistent types work.""" - self.buildDefault() + self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) diff --git a/lldb/test/expression_command/persistent_types/TestPersistentTypes.py b/lldb/test/expression_command/persistent_types/TestPersistentTypes.py index 1f689b8823d..7f0eb648bbd 100644 --- a/lldb/test/expression_command/persistent_types/TestPersistentTypes.py +++ b/lldb/test/expression_command/persistent_types/TestPersistentTypes.py @@ -14,7 +14,7 @@ class PersistenttypesTestCase(TestBase): @expectedFailureWindows("llvm.org/pr21765") def test_persistent_types(self): """Test that lldb persistent types works correctly.""" - self.buildDefault() + self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) diff --git a/lldb/test/expression_command/persistent_variables/TestPersistentVariables.py b/lldb/test/expression_command/persistent_variables/TestPersistentVariables.py index 8e7af009c6a..77d1c251915 100644 --- a/lldb/test/expression_command/persistent_variables/TestPersistentVariables.py +++ b/lldb/test/expression_command/persistent_variables/TestPersistentVariables.py @@ -13,7 +13,7 @@ class PersistentVariablesTestCase(TestBase): def test_persistent_variables(self): """Test that lldb persistent variables works correctly.""" - self.buildDefault() + self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) diff --git a/lldb/test/expression_command/po_verbosity/TestPoVerbosity.py b/lldb/test/expression_command/po_verbosity/TestPoVerbosity.py index dbb9daa8d04..2a9ed7c9779 100644 --- a/lldb/test/expression_command/po_verbosity/TestPoVerbosity.py +++ b/lldb/test/expression_command/po_verbosity/TestPoVerbosity.py @@ -19,20 +19,9 @@ class PoVerbosityTestCase(TestBase): '// Stop here') @skipUnlessDarwin - @dsym_test - def test_with_dsym(self): + def test(self): """Test that the po command acts correctly.""" - self.buildDsym() - self.do_my_test() - - @skipUnlessDarwin - @dwarf_test - def test_with_dwarf(self): - """Test that the po command acts correctly.""" - self.buildDwarf() - self.do_my_test() - - def do_my_test(self): + self.build() # This is the function to remove the custom formats in order to have a # clean slate for the next test case. diff --git a/lldb/test/expression_command/radar_8638051/Test8638051.py b/lldb/test/expression_command/radar_8638051/Test8638051.py index 823c8e12113..fa1f1756dba 100644 --- a/lldb/test/expression_command/radar_8638051/Test8638051.py +++ b/lldb/test/expression_command/radar_8638051/Test8638051.py @@ -13,7 +13,7 @@ class Radar8638051TestCase(TestBase): def test_expr_commands(self): """The following expression commands should not crash.""" - self.buildDefault() + self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) diff --git a/lldb/test/expression_command/radar_9531204/TestPrintfAfterUp.py b/lldb/test/expression_command/radar_9531204/TestPrintfAfterUp.py index 827fddbb6b2..0a1a9b81ffe 100644 --- a/lldb/test/expression_command/radar_9531204/TestPrintfAfterUp.py +++ b/lldb/test/expression_command/radar_9531204/TestPrintfAfterUp.py @@ -16,7 +16,7 @@ class Radar9531204TestCase(TestBase): @expectedFailureWindows("llvm.org/pr21765") def test_expr_commands(self): """The evaluating printf(...) after break stop and then up a stack frame.""" - self.buildDefault() + self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) diff --git a/lldb/test/expression_command/radar_9673664/TestExprHelpExamples.py b/lldb/test/expression_command/radar_9673664/TestExprHelpExamples.py index 71c08523bd0..58f04554ed6 100644 --- a/lldb/test/expression_command/radar_9673664/TestExprHelpExamples.py +++ b/lldb/test/expression_command/radar_9673664/TestExprHelpExamples.py @@ -22,7 +22,7 @@ class Radar9673644TestCase(TestBase): @expectedFailureWindows("llvm.org/pr21765") def test_expr_commands(self): """The following expression commands should just work.""" - self.buildDefault() + self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) diff --git a/lldb/test/expression_command/test/TestExprs.py b/lldb/test/expression_command/test/TestExprs.py index 4d718aa8b1c..3545e34e74a 100644 --- a/lldb/test/expression_command/test/TestExprs.py +++ b/lldb/test/expression_command/test/TestExprs.py @@ -35,7 +35,7 @@ class BasicExprCommandsTestCase(TestBase): def build_and_run(self): """These basic expression commands should work as expected.""" - self.buildDefault() + self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) @@ -98,7 +98,7 @@ class BasicExprCommandsTestCase(TestBase): @expectedFailureWindows # Test crashes def test_evaluate_expression_python(self): """Test SBFrame.EvaluateExpression() API for evaluating an expression.""" - self.buildDefault() + self.build() exe = os.path.join(os.getcwd(), "a.out") @@ -198,7 +198,7 @@ class BasicExprCommandsTestCase(TestBase): @expectedFailureWindows("llvm.org/pr21765") def test_expr_commands_can_handle_quotes(self): """Throw some expression commands with quotes at lldb.""" - self.buildDefault() + self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) diff --git a/lldb/test/expression_command/test/TestExprs2.py b/lldb/test/expression_command/test/TestExprs2.py index 9395d31bac2..5e52c5e94de 100644 --- a/lldb/test/expression_command/test/TestExprs2.py +++ b/lldb/test/expression_command/test/TestExprs2.py @@ -22,7 +22,7 @@ class ExprCommands2TestCase(TestBase): @expectedFailureWindows("llvm.org/pr24489: Name lookup not working correctly on Windows") def test_more_expr_commands(self): """Test some more expression commands.""" - self.buildDefault() + self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) diff --git a/lldb/test/expression_command/timeout/TestCallWithTimeout.py b/lldb/test/expression_command/timeout/TestCallWithTimeout.py index c5b4e06448c..f59cd7564dc 100644 --- a/lldb/test/expression_command/timeout/TestCallWithTimeout.py +++ b/lldb/test/expression_command/timeout/TestCallWithTimeout.py @@ -19,24 +19,13 @@ class ExprCommandWithTimeoutsTestCase(TestBase): self.main_source_spec = lldb.SBFileSpec (self.main_source) - @skipUnlessDarwin - @dsym_test - def test_with_dsym(self): - """Test calling std::String member function.""" - self.buildDsym() - self.call_function() - @expectedFlakeyFreeBSD("llvm.org/pr19605") @expectedFlakeyLinux("llvm.org/pr20275") @expectedFailureWindows("llvm.org/pr21765") - @dwarf_test - def test_with_dwarf(self): + def test(self): """Test calling std::String member function.""" - self.buildDwarf() - self.call_function() + self.build() - def call_function(self): - """Test calling function with timeout.""" exe_name = "a.out" exe = os.path.join(os.getcwd(), exe_name) diff --git a/lldb/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py b/lldb/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py index 9f3a18d6af0..8279a75684e 100644 --- a/lldb/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py +++ b/lldb/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py @@ -21,21 +21,9 @@ class ObjCTypeQueryTestCase(TestBase): "// Set breakpoint here, then do 'expr (NSArray*)array_token'.") @skipUnlessDarwin - @dsym_test - def test_with_dsym(self): - """The expression parser's type search should be wider than the current compilation unit.""" - self.buildDsym() - self.type_query_from_other_cu() - - @skipUnlessDarwin - @dwarf_test - def test_with_dwarf(self): - """The expression parser's type search should be wider than the current compilation unit.""" - self.buildDwarf() - self.type_query_from_other_cu() - - def type_query_from_other_cu(self): + def test(self): """The expression parser's type search should be wider than the current compilation unit.""" + self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True) |

