summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/hello_world/TestHelloWorld.py
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2015-09-30 10:12:40 +0000
committerTamas Berghammer <tberghammer@google.com>2015-09-30 10:12:40 +0000
commitc8fd130a2cbf7ade53d05e597f9d48e8c2f37442 (patch)
tree3c9cfb6d1674ee147e83fb80c6ab25e0444ad958 /lldb/test/python_api/hello_world/TestHelloWorld.py
parentebfd72493cc68b085d3feac59f032acb518f4163 (diff)
downloadbcm5719-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/python_api/hello_world/TestHelloWorld.py')
-rw-r--r--lldb/test/python_api/hello_world/TestHelloWorld.py104
1 files changed, 19 insertions, 85 deletions
diff --git a/lldb/test/python_api/hello_world/TestHelloWorld.py b/lldb/test/python_api/hello_world/TestHelloWorld.py
index e9cd7783a65..8e586c8dcdf 100644
--- a/lldb/test/python_api/hello_world/TestHelloWorld.py
+++ b/lldb/test/python_api/hello_world/TestHelloWorld.py
@@ -9,82 +9,7 @@ from lldbtest import *
class HelloWorldTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
-
- @skipUnlessDarwin
- @python_api_test
- @dsym_test
- def test_with_dsym_and_process_launch_api(self):
- """Create target, breakpoint, launch a process, and then kill it.
-
- Use dsym info and process launch API.
- """
- self.buildDsym(dictionary=self.d)
- self.setTearDownCleanup(dictionary=self.d)
- self.hello_world_python()
-
- @python_api_test
- @dwarf_test
- def test_with_dwarf_and_process_launch_api(self):
- """Create target, breakpoint, launch a process, and then kill it.
-
- Use dwarf debug map and process launch API.
- """
- self.buildDwarf(dictionary=self.d)
- self.setTearDownCleanup(dictionary=self.d)
- self.hello_world_python()
-
- @not_remote_testsuite_ready
- @skipUnlessDarwin
- @python_api_test
- @dsym_test
- def test_with_dsym_and_attach_to_process_with_id_api(self):
- """Create target, spawn a process, and attach to it with process id.
-
- Use dsym info and attach to process with id API.
- """
- self.buildDsym(dictionary=self.d)
- self.setTearDownCleanup(dictionary=self.d)
- self.hello_world_attach_with_id_api()
-
- @python_api_test
- @dwarf_test
- @expectedFailurei386 # llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly
- @expectedFailureWindows("llvm.org/pr24600")
- def test_with_dwarf_and_attach_to_process_with_id_api(self):
- """Create target, spawn a process, and attach to it with process id.
-
- Use dwarf map (no dsym) and attach to process with id API.
- """
- self.buildDwarf(dictionary=self.d)
- self.setTearDownCleanup(dictionary=self.d)
- self.hello_world_attach_with_id_api()
-
- @not_remote_testsuite_ready
- @skipUnlessDarwin
- @python_api_test
- @dsym_test
- def test_with_dsym_and_attach_to_process_with_name_api(self):
- """Create target, spawn a process, and attach to it with process name.
-
- Use dsym info and attach to process with name API.
- """
- self.buildDsym(dictionary=self.d)
- self.setTearDownCleanup(dictionary=self.d)
- self.hello_world_attach_with_name_api()
-
- @python_api_test
- @dwarf_test
- @expectedFailurei386 # llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly
- @expectedFailureWindows("llvm.org/pr24600")
- def test_with_dwarf_and_attach_to_process_with_name_api(self):
- """Create target, spawn a process, and attach to it with process name.
-
- Use dwarf map (no dsym) and attach to process with name API.
- """
- self.buildDwarf(dictionary=self.d)
- self.setTearDownCleanup(dictionary=self.d)
- self.hello_world_attach_with_name_api()
-
+
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -101,9 +26,11 @@ class HelloWorldTestCase(TestBase):
# Call super's tearDown().
TestBase.tearDown(self)
- def hello_world_python(self):
+ @python_api_test
+ def test_with_process_launch_api(self):
"""Create target, breakpoint, launch a process, and then kill it."""
-
+ self.build(dictionary=self.d)
+ self.setTearDownCleanup(dictionary=self.d)
target = self.dbg.CreateTarget(self.exe)
breakpoint = target.BreakpointCreateByLocation("main.c", self.line1)
@@ -142,9 +69,13 @@ class HelloWorldTestCase(TestBase):
# The breakpoint should have a hit count of 1.
self.assertTrue(breakpoint.GetHitCount() == 1, BREAKPOINT_HIT_ONCE)
- def hello_world_attach_with_id_api(self):
- """Create target, spawn a process, and attach to it by id."""
-
+ @python_api_test
+ @expectedFailurei386 # llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly
+ @expectedFailureWindows("llvm.org/pr24600")
+ def test_with_attach_to_process_with_id_api(self):
+ """Create target, spawn a process, and attach to it with process id."""
+ self.build(dictionary=self.d)
+ self.setTearDownCleanup(dictionary=self.d)
target = self.dbg.CreateTarget(self.exe)
# Spawn a new process
@@ -167,9 +98,13 @@ class HelloWorldTestCase(TestBase):
substrs = ['main.c:%d' % self.line2,
'(int)argc=3'])
- def hello_world_attach_with_name_api(self):
- """Create target, spawn a process, and attach to it by name."""
-
+ @python_api_test
+ @expectedFailurei386 # llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly
+ @expectedFailureWindows("llvm.org/pr24600")
+ def test_with_attach_to_process_with_name_api(self):
+ """Create target, spawn a process, and attach to it with process name."""
+ self.build(dictionary=self.d)
+ self.setTearDownCleanup(dictionary=self.d)
target = self.dbg.CreateTarget(self.exe)
# Spawn a new process
@@ -205,7 +140,6 @@ class HelloWorldTestCase(TestBase):
substrs = ['main.c:%d' % self.line2,
'(int)argc=3'])
-
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
OpenPOWER on IntegriCloud