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
diff --git a/lldb/test/lang/objc/blocks/TestObjCIvarsInBlocks.py b/lldb/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
index 844f981..281c155 100644
--- a/lldb/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
+++ b/lldb/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
@@ -10,26 +10,6 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- # This test requires the 2.0 runtime, so it will fail on i386.
- @expectedFailurei386
- @python_api_test
- @dsym_test
- def test_with_dsym_and_python_api(self):
- """Test printing the ivars of the self when captured in blocks"""
- self.buildDsym()
- self.ivars_in_blocks()
-
- @skipUnlessDarwin
- @python_api_test
- # This test requires the 2.0 runtime, so it will fail on i386.
- @expectedFailurei386
- @dwarf_test
- def test_with_dwarf_and_python_api(self):
- """Test printing the ivars of the self when captured in blocks"""
- self.buildDwarf()
- self.ivars_in_blocks()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -38,8 +18,12 @@
self.class_source = "ivars-in-blocks.m"
self.class_source_file_spec = lldb.SBFileSpec(self.class_source)
- def ivars_in_blocks (self):
+ @skipUnlessDarwin
+ @python_api_test
+ @expectedFailurei386 # This test requires the 2.0 runtime, so it will fail on i386.
+ def test_with_python_api(self):
"""Test printing the ivars of the self when captured in blocks"""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
target = self.dbg.CreateTarget(exe)
diff --git a/lldb/test/lang/objc/forward-decl/TestForwardDecl.py b/lldb/test/lang/objc/forward-decl/TestForwardDecl.py
index 89ee974..4b21e35 100644
--- a/lldb/test/lang/objc/forward-decl/TestForwardDecl.py
+++ b/lldb/test/lang/objc/forward-decl/TestForwardDecl.py
@@ -10,18 +10,6 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @dsym_test
- def test_expr_with_dsym(self):
- self.buildDsym()
- self.expr()
-
- @skipUnlessDarwin
- @dwarf_test
- def test_expr_with_dwarf(self):
- self.buildDwarf()
- self.expr()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -30,7 +18,10 @@
self.line = line_number(self.source, '// Set breakpoint 0 here.')
self.shlib_names = ["Container"]
- def common_setup(self):
+ @skipUnlessDarwin
+ def test_expr(self):
+ self.build()
+
# Create a target by the debugger.
target = self.dbg.CreateTarget("a.out")
self.assertTrue(target, VALID_TARGET)
@@ -55,9 +46,6 @@
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
substrs = [' resolved, hit count = 1'])
- def expr(self):
- self.common_setup()
-
# This should display correctly.
self.expect("expression [j getMember]", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ["= 0x"])
diff --git a/lldb/test/lang/objc/foundation/TestConstStrings.py b/lldb/test/lang/objc/foundation/TestConstStrings.py
index ca644ba..a3780e0 100644
--- a/lldb/test/lang/objc/foundation/TestConstStrings.py
+++ b/lldb/test/lang/objc/foundation/TestConstStrings.py
@@ -9,26 +9,11 @@
from lldbtest import *
import lldbutil
-@skipUnlessDarwin
class ConstStringTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
d = {'OBJC_SOURCES': 'const-strings.m'}
- @dsym_test
- def test_break_with_dsym(self):
- """Test constant string generation amd comparison by the expression parser."""
- self.buildDsym(dictionary=self.d)
- self.setTearDownCleanup(self.d)
- self.objc_const_strings()
-
- @dwarf_test
- def test_break_with_dwarf(self):
- """Test constant string generation amd comparison by the expression parser."""
- self.buildDwarf(dictionary=self.d)
- self.setTearDownCleanup(self.d)
- self.objc_const_strings()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -36,8 +21,12 @@
self.main_source = "const-strings.m"
self.line = line_number(self.main_source, '// Set breakpoint here.')
- def objc_const_strings(self):
+ @skipUnlessDarwin
+ def test_break(self):
"""Test constant string generation amd comparison by the expression parser."""
+ self.build(dictionary=self.d)
+ self.setTearDownCleanup(self.d)
+
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
diff --git a/lldb/test/lang/objc/foundation/TestFoundationDisassembly.py b/lldb/test/lang/objc/foundation/TestFoundationDisassembly.py
index 4fa78d8..3fb6792 100644
--- a/lldb/test/lang/objc/foundation/TestFoundationDisassembly.py
+++ b/lldb/test/lang/objc/foundation/TestFoundationDisassembly.py
@@ -18,7 +18,7 @@
@unittest2.skipIf(TestBase.skipLongRunningTest(), "Skip this long running test")
def test_foundation_disasm(self):
"""Do 'disassemble -n func' on each and every 'Code' symbol entry from the Foundation.framework."""
- self.buildDefault()
+ self.build()
# Enable synchronous mode
self.dbg.SetAsync(False)
@@ -61,21 +61,10 @@
self.runCmd('disassemble -n "%s"' % func)
- @dsym_test
- def test_simple_disasm_with_dsym(self):
+ def test_simple_disasm(self):
"""Test the lldb 'disassemble' command"""
- self.buildDsym()
- self.do_simple_disasm()
+ self.build()
- @dwarf_test
- def test_simple_disasm_with_dwarf(self):
- """Test the lldb 'disassemble' command"""
- self.buildDwarf()
- self.do_simple_disasm()
-
- def do_simple_disasm(self):
- """Do a bunch of simple disassemble commands."""
-
# Create a target by the debugger.
target = self.dbg.CreateTarget("a.out")
self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/test/lang/objc/foundation/TestObjCMethods.py b/lldb/test/lang/objc/foundation/TestObjCMethods.py
index 44aefdc..5be2e3c 100644
--- a/lldb/test/lang/objc/foundation/TestObjCMethods.py
+++ b/lldb/test/lang/objc/foundation/TestObjCMethods.py
@@ -16,50 +16,16 @@
mydir = TestBase.compute_mydir(__file__)
- @dsym_test
- def test_break_with_dsym(self):
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Find the line number to break inside main().
+ self.main_source = "main.m"
+ self.line = line_number(self.main_source, '// Set break point at this line.')
+
+ def test_break(self):
"""Test setting objc breakpoints using '_regexp-break' and 'breakpoint set'."""
- self.buildDsym()
- self.break_on_objc_methods()
-
- @dwarf_test
- def test_break_with_dwarf(self):
- """Test setting objc breakpoints using '_regexp-break' and 'breakpoint set'."""
- self.buildDwarf()
- self.break_on_objc_methods()
-
- #@unittest2.expectedFailure
- # rdar://problem/8542091
- # rdar://problem/8492646
- @dsym_test
- def test_data_type_and_expr_with_dsym(self):
- """Lookup objective-c data types and evaluate expressions."""
- self.buildDsym()
- self.data_type_and_expr_objc()
-
- #@unittest2.expectedFailure
- # rdar://problem/8542091
- # rdar://problem/8492646
- @dwarf_test
- def test_data_type_and_expr_with_dwarf(self):
- """Lookup objective-c data types and evaluate expressions."""
- self.buildDwarf()
- self.data_type_and_expr_objc()
-
- @python_api_test
- @dsym_test
- def test_print_ivars_correctly_with_dsym (self):
- self.buildDsym()
- self.print_ivars_correctly()
-
- @python_api_test
- @dwarf_test
- def test_print_ivars_correctly_with_dwarf (self):
- self.buildDwarf()
- self.print_ivars_correctly()
-
- def break_on_objc_methods(self):
- """Test setting objc breakpoints using '_regexp-break' and 'breakpoint set'."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -113,64 +79,12 @@
self.expect("thread backtrace", "Stop at -[NSAutoreleasePool release]",
substrs = ["Foundation`-[NSAutoreleasePool release]"])
- @dsym_test
- def test_expression_lookups_objc_dsym(self):
- """Test running an expression detect spurious debug info lookups (dSYM)."""
- self.buildDsym()
- self.expression_lookups_objc()
-
- @dwarf_test
- def test_expression_lookups_objc_dwarf(self):
- """Test running an expression detect spurious debug info lookups (DWARF)."""
- self.buildDwarf()
- self.expression_lookups_objc()
-
- def expression_lookups_objc (self):
- """Test running an expression and make sure we don't search all dwarf files for any internal names (anything that contains '__lldb')."""
- exe = os.path.join(os.getcwd(), "a.out")
- self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
-
- # Stop at -[MyString initWithNSString:].
- lldbutil.run_break_set_by_symbol (self, '-[MyString initWithNSString:]', num_expected_locations=1, sym_exact=True)
-
- self.runCmd("run", RUN_SUCCEEDED)
-
- global file_index
- # Log any DWARF lookups
- ++file_index
- logfile = os.path.join(os.getcwd(), "dwarf-lookups-" + self.getArchitecture() + "-" + str(file_index) + ".txt")
- self.runCmd("log enable -f %s dwarf lookups" % (logfile))
- self.runCmd("expr self")
- self.runCmd("log disable dwarf lookups")
-
- def cleanup():
- if os.path.exists (logfile):
- os.unlink (logfile)
-
- self.addTearDownHook(cleanup)
-
- if os.path.exists (logfile):
- f = open(logfile)
- lines = f.readlines()
- num_errors = 0
- for line in lines:
- if string.find(line, "$__lldb") != -1:
- if num_errors == 0:
- print "error: found spurious name lookups when evaluating an expression:"
- num_errors += 1
- print line,
- self.assertTrue(num_errors == 0, "Spurious lookups detected")
- f.close()
-
- def setUp(self):
- # Call super's setUp().
- TestBase.setUp(self)
- # Find the line number to break inside main().
- self.main_source = "main.m"
- self.line = line_number(self.main_source, '// Set break point at this line.')
-
- def data_type_and_expr_objc(self):
+ #@unittest2.expectedFailure
+ # rdar://problem/8542091
+ # rdar://problem/8492646
+ def test_data_type_and_expr(self):
"""Lookup objective-c data types and evaluate expressions."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -258,9 +172,11 @@
self.expect("expression --object-description -- my", "Object description displayed correctly",
patterns = ["Hello from.*a.out.*with timestamp: "])
- # See: <rdar://problem/8717050> lldb needs to use the ObjC runtime symbols for ivar offsets
- # Only fails for the ObjC 2.0 runtime.
- def print_ivars_correctly(self) :
+ @python_api_test
+ def test_print_ivars_correctly (self):
+ self.build()
+ # See: <rdar://problem/8717050> lldb needs to use the ObjC runtime symbols for ivar offsets
+ # Only fails for the ObjC 2.0 runtime.
exe = os.path.join(os.getcwd(), "a.out")
target = self.dbg.CreateTarget(exe)
@@ -304,7 +220,45 @@
my_str_value = int(my_str_var.GetValue(), 0)
self.assertTrue(str_value == my_str_value, "Got the correct value for my->str")
+
+ def test_expression_lookups_objc(self):
+ """Test running an expression detect spurious debug info lookups (DWARF)."""
+ self.build()
+ exe = os.path.join(os.getcwd(), "a.out")
+ self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+ # Stop at -[MyString initWithNSString:].
+ lldbutil.run_break_set_by_symbol (self, '-[MyString initWithNSString:]', num_expected_locations=1, sym_exact=True)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ global file_index
+ # Log any DWARF lookups
+ ++file_index
+ logfile = os.path.join(os.getcwd(), "dwarf-lookups-" + self.getArchitecture() + "-" + str(file_index) + ".txt")
+ self.runCmd("log enable -f %s dwarf lookups" % (logfile))
+ self.runCmd("expr self")
+ self.runCmd("log disable dwarf lookups")
+ def cleanup():
+ if os.path.exists (logfile):
+ os.unlink (logfile)
+
+ self.addTearDownHook(cleanup)
+
+ if os.path.exists (logfile):
+ f = open(logfile)
+ lines = f.readlines()
+ num_errors = 0
+ for line in lines:
+ if string.find(line, "$__lldb") != -1:
+ if num_errors == 0:
+ print "error: found spurious name lookups when evaluating an expression:"
+ num_errors += 1
+ print line,
+ self.assertTrue(num_errors == 0, "Spurious lookups detected")
+ f.close()
+
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
diff --git a/lldb/test/lang/objc/foundation/TestObjCMethods2.py b/lldb/test/lang/objc/foundation/TestObjCMethods2.py
index 88fcfc1..59eb995 100644
--- a/lldb/test/lang/objc/foundation/TestObjCMethods2.py
+++ b/lldb/test/lang/objc/foundation/TestObjCMethods2.py
@@ -12,81 +12,7 @@
class FoundationTestCase2(TestBase):
mydir = TestBase.compute_mydir(__file__)
-
- @dsym_test
- def test_more_expr_commands_with_dsym(self):
- """More expression commands for objective-c."""
- self.buildDsym()
- self.more_expr_objc()
-
- @dwarf_test
- def test_more_expr_commands_with_dwarf(self):
- """More expression commands for objective-c."""
- self.buildDwarf()
- self.more_expr_objc()
-
- @dsym_test
- def test_NSArray_expr_commands_with_dsym(self):
- """Test expression commands for NSArray."""
- self.buildDsym()
- self.NSArray_expr()
-
- @dwarf_test
- def test_NSArray_expr_commands_with_dwarf(self):
- """Test expression commands for NSArray."""
- self.buildDwarf()
- self.NSArray_expr()
-
- @dsym_test
- def test_NSString_expr_commands_with_dsym(self):
- """Test expression commands for NSString."""
- self.buildDsym()
- self.NSString_expr()
-
- @dwarf_test
- def test_NSString_expr_commands_with_dwarf(self):
- """Test expression commands for NSString."""
- self.buildDwarf()
- self.NSString_expr()
-
- @dsym_test
- def test_MyString_dump_with_dsym(self):
- """Test dump of a known Objective-C object by dereferencing it."""
- self.buildDsym()
- self.MyString_dump()
-
- @dwarf_test
- def test_MyString_dump_with_dwarf(self):
- """Test dump of a known Objective-C object by dereferencing it."""
- self.buildDwarf()
- self.MyString_dump()
-
- @expectedFailurei386
- @dsym_test
- def test_NSError_po_with_dsym(self):
- """Test that po of the result of an unknown method doesn't require a cast."""
- self.buildDsym()
- self.NSError_po()
-
- @expectedFailurei386
- @dwarf_test
- def test_NSError_po_with_dwarf(self):
- """Test that po of the result of an unknown method doesn't require a cast."""
- self.buildDsym()
- self.NSError_po()
-
- @dsym_test
- def test_NSError_p_with_dsym(self):
- """Test that p of the result of an unknown method does require a cast."""
- self.buildDsym()
- self.NSError_p()
-
- @dwarf_test
- def test_NSError_p_with_dwarf(self):
- """Test that p of the result of an unknown method does require a cast."""
- self.buildDsym()
- self.NSError_p()
-
+
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -97,9 +23,10 @@
self.lines.append(line_number('main.m', '// Break here for NSString tests'))
self.lines.append(line_number('main.m', '// Break here for description test'))
self.lines.append(line_number('main.m', '// Set break point at this line'))
-
- def more_expr_objc(self):
+
+ def test_more_expr_commands(self):
"""More expression commands for objective-c."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -133,8 +60,9 @@
self.runCmd("process continue")
- def NSArray_expr(self):
+ def test_NSArray_expr_commands(self):
"""Test expression commands for NSArray."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -158,8 +86,9 @@
patterns = ["\(int\) \$.* = 3"])
self.runCmd("process continue")
- def NSString_expr(self):
+ def test_NSString_expr_commands(self):
"""Test expression commands for NSString."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -186,8 +115,9 @@
self.expect('expression str = [NSString stringWithCString: "new"]')
self.runCmd("process continue")
- def MyString_dump(self):
+ def test_MyString_dump(self):
"""Test dump of a known Objective-C object by dereferencing it."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -201,8 +131,10 @@
patterns = ["\(MyString\) \$.* = ", "\(MyBase\)", "\(NSObject\)", "\(Class\)"])
self.runCmd("process continue")
- def NSError_po(self):
+ @expectedFailurei386
+ def test_NSError_po(self):
"""Test that po of the result of an unknown method doesn't require a cast."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -215,9 +147,10 @@
self.expect('po [NSError errorWithDomain:@"Hello" code:35 userInfo:@{@"NSDescription" : @"be completed."}]',
substrs = ["Error Domain=Hello", "Code=35", "be completed."])
self.runCmd("process continue")
-
- def NSError_p(self):
+
+ def test_NSError_p(self):
"""Test that p of the result of an unknown method does require a cast."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
diff --git a/lldb/test/lang/objc/foundation/TestObjectDescriptionAPI.py b/lldb/test/lang/objc/foundation/TestObjectDescriptionAPI.py
index 39d69b8..0831032 100644
--- a/lldb/test/lang/objc/foundation/TestObjectDescriptionAPI.py
+++ b/lldb/test/lang/objc/foundation/TestObjectDescriptionAPI.py
@@ -12,28 +12,6 @@
mydir = TestBase.compute_mydir(__file__)
- # rdar://problem/10857337
- @skipUnlessDarwin
- @python_api_test
- @dsym_test
- def test_find_global_variables_then_object_description_with_dsym(self):
- """Exercise SBTaget.FindGlobalVariables() API."""
- d = {'EXE': 'a.out'}
- self.buildDsym(dictionary=d)
- self.setTearDownCleanup(dictionary=d)
- self.find_global_variables_then_object_description('a.out')
-
- # rdar://problem/10857337
- @skipUnlessDarwin
- @python_api_test
- @dwarf_test
- def test_find_global_variables_then_object_description_with_dwarf(self):
- """Exercise SBTarget.FindGlobalVariables() API."""
- d = {'EXE': 'b.out'}
- self.buildDwarf(dictionary=d)
- self.setTearDownCleanup(dictionary=d)
- self.find_global_variables_then_object_description('b.out')
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -41,9 +19,15 @@
self.source = 'main.m'
self.line = line_number(self.source, '// Set break point at this line.')
- def find_global_variables_then_object_description(self, exe_name):
- """Exercise SBTaget.FindGlobalVariables() followed by SBValue.GetObjectDescription()."""
- exe = os.path.join(os.getcwd(), exe_name)
+ # rdar://problem/10857337
+ @skipUnlessDarwin
+ @python_api_test
+ def test_find_global_variables_then_object_description(self):
+ """Exercise SBTarget.FindGlobalVariables() API."""
+ d = {'EXE': 'b.out'}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(dictionary=d)
+ exe = os.path.join(os.getcwd(), 'b.out')
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/lldb/test/lang/objc/foundation/TestRuntimeTypes.py b/lldb/test/lang/objc/foundation/TestRuntimeTypes.py
index 20e38a6..55e9713 100644
--- a/lldb/test/lang/objc/foundation/TestRuntimeTypes.py
+++ b/lldb/test/lang/objc/foundation/TestRuntimeTypes.py
@@ -13,23 +13,12 @@
mydir = TestBase.compute_mydir(__file__)
- @dsym_test
- def test_break_with_dsym(self):
+ def test_break(self):
"""Test setting objc breakpoints using '_regexp-break' and 'breakpoint set'."""
- # This only applies to the v2 runtime
- if self.getArchitecture() == 'x86_64':
- self.buildDsym()
- self.runtime_types()
+ if self.getArchitecture() != 'x86_64':
+ self.skipTest("This only applies to the v2 runtime")
- @dwarf_test
- def test_break_with_dwarf(self):
- """Test setting objc breakpoints using '_regexp-break' and 'breakpoint set'."""
- # This only applies to the v2 runtime
- if self.getArchitecture() == 'x86_64':
- self.buildDwarf()
- self.runtime_types()
-
- def runtime_types(self):
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
diff --git a/lldb/test/lang/objc/foundation/TestSymbolTable.py b/lldb/test/lang/objc/foundation/TestSymbolTable.py
index 70ca088..0d23816 100644
--- a/lldb/test/lang/objc/foundation/TestSymbolTable.py
+++ b/lldb/test/lang/objc/foundation/TestSymbolTable.py
@@ -25,21 +25,9 @@
]
@python_api_test
- @dsym_test
- def test_with_dsym_and_python_api(self):
+ def test_with_python_api(self):
"""Test symbol table access with Python APIs."""
- self.buildDsym()
- self.symtab_access_python()
-
- @python_api_test
- @dwarf_test
- def test_with_dwarf_and_python_api(self):
- """Test symbol table access with Python APIs."""
- self.buildDwarf()
- self.symtab_access_python()
-
- def symtab_access_python(self):
- """Test symbol table access with Python APIs."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
diff --git a/lldb/test/lang/objc/hidden-ivars/TestHiddenIvars.py b/lldb/test/lang/objc/hidden-ivars/TestHiddenIvars.py
index a7d52b0..405aa31 100644
--- a/lldb/test/lang/objc/hidden-ivars/TestHiddenIvars.py
+++ b/lldb/test/lang/objc/hidden-ivars/TestHiddenIvars.py
@@ -11,80 +11,6 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @dsym_test
- def test_expr_with_dsym(self):
- if self.getArchitecture() == 'i386':
- self.skipTest("requires modern objc runtime")
- else:
- self.buildDsym()
- self.expr(False)
-
- @skipUnlessDarwin
- @dsym_test
- def test_expr_stripped_with_dsym(self):
- if self.getArchitecture() == 'i386':
- self.skipTest("requires modern objc runtime")
- else:
- self.buildDsym()
- self.expr(True)
-
- @skipUnlessDarwin
- @dwarf_test
- def test_expr_with_dwarf(self):
- if self.getArchitecture() == 'i386':
- self.skipTest("requires modern objc runtime")
- else:
- self.buildDwarf()
- self.expr(False)
-
- @skipUnlessDarwin
- @dsym_test
- def test_frame_variable_with_dsym(self):
- if self.getArchitecture() == 'i386':
- self.skipTest("requires modern objc runtime")
- else:
- self.buildDsym()
- self.frame_var(False)
-
- @skipUnlessDarwin
- @dsym_test
- def test_frame_variable_stripped_with_dsym(self):
- if self.getArchitecture() == 'i386':
- self.skipTest("requires modern objc runtime")
- else:
- self.buildDsym()
- self.frame_var(True)
-
- @skipUnlessDarwin
- @dwarf_test
- def test_frame_variable_with_dwarf(self):
- if self.getArchitecture() == 'i386':
- self.skipTest("requires modern objc runtime")
- else:
- self.buildDwarf()
- self.frame_var(False)
-
- @unittest2.expectedFailure("rdar://18683637")
- @skipUnlessDarwin
- @dsym_test
- def test_frame_variable_across_modules_with_dsym(self):
- if self.getArchitecture() == 'i386':
- self.skipTest("requires modern objc runtime")
- else:
- self.buildDsym()
- self.frame_var_type_access_across_module()
-
- @unittest2.expectedFailure("rdar://18683637")
- @skipUnlessDarwin
- @dwarf_test
- def test_frame_variable_across_modules_with_dwarf(self):
- if self.getArchitecture() == 'i386':
- self.skipTest("requires modern objc runtime")
- else:
- self.buildDwarf()
- self.frame_var_type_access_across_module()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -94,6 +20,48 @@
# The makefile names of the shared libraries as they appear in DYLIB_NAME.
# The names should have no loading "lib" or extension as they will be localized
self.shlib_names = ["InternalDefiner"]
+
+ @skipUnlessDarwin
+ def test_expr_stripped(self):
+ if self.getArchitecture() == 'i386':
+ self.skipTest("requires modern objc runtime")
+ else:
+ self.build()
+ self.expr(True)
+
+ @skipUnlessDarwin
+ def test_expr(self):
+ if self.getArchitecture() == 'i386':
+ self.skipTest("requires modern objc runtime")
+ else:
+ self.build()
+ self.expr(False)
+
+ @skipUnlessDarwin
+ def test_frame_variable_stripped(self):
+ if self.getArchitecture() == 'i386':
+ self.skipTest("requires modern objc runtime")
+ else:
+ self.build()
+ self.frame_var(True)
+
+ @skipUnlessDarwin
+ def test_frame_variable(self):
+ if self.getArchitecture() == 'i386':
+ self.skipTest("requires modern objc runtime")
+ else:
+ self.build()
+ self.frame_var(False)
+
+ @unittest2.expectedFailure("rdar://18683637")
+ @skipUnlessDarwin
+ def test_frame_variable_across_modules(self):
+ if self.getArchitecture() == 'i386':
+ self.skipTest("requires modern objc runtime")
+ else:
+ self.build()
+ self.common_setup(False)
+ self.expect("frame variable k->bar", VARIABLES_DISPLAYED_CORRECTLY, substrs = ["= 3"])
def common_setup(self, strip):
@@ -196,11 +164,6 @@
else:
self.expect("frame variable *k", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ["foo = 2", "bar = 3", '_filteredDataSource = 0x', '"2 objects"'])
-
- def frame_var_type_access_across_module(self):
- self.common_setup(False)
-
- self.expect("frame variable k->bar", VARIABLES_DISPLAYED_CORRECTLY, substrs = ["= 3"])
if __name__ == '__main__':
diff --git a/lldb/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py b/lldb/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
index d908449..b614d75 100644
--- a/lldb/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
+++ b/lldb/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
@@ -22,23 +22,14 @@
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
+ @no_debug_info_test
def test_imp_ivar_type(self):
"""Test that dynamically discovered ivars of type IMP do not crash LLDB"""
if self.getArchitecture() == 'i386':
# rdar://problem/9946499
self.skipTest("Dynamic types for ObjC V1 runtime not implemented")
- self.buildReproCase()
- self.runTheTest()
-
- def setUp(self):
- # Call super's setUp().
- TestBase.setUp(self)
-
- def buildReproCase (self):
+
execute_command("make repro")
-
- def runTheTest(self):
- """MakeTest that dynamically discovered ivars of type IMP do not crash LLDB"""
def cleanup():
execute_command("make cleanup")
self.addTearDownHook(cleanup)
@@ -46,7 +37,6 @@
exe = os.path.join(os.getcwd(), "a.out")
# Create a target from the debugger.
-
target = self.dbg.CreateTarget (exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/test/lang/objc/modules-auto-import/TestModulesAutoImport.py b/lldb/test/lang/objc/modules-auto-import/TestModulesAutoImport.py
index b875dfc..8a11c24 100644
--- a/lldb/test/lang/objc/modules-auto-import/TestModulesAutoImport.py
+++ b/lldb/test/lang/objc/modules-auto-import/TestModulesAutoImport.py
@@ -14,37 +14,18 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @dsym_test
- @unittest2.expectedFailure("rdar://problem/19991953")
- def test_expr_with_dsym(self):
- self.buildDsym()
- self.expr()
-
- @dwarf_test
- @skipIfFreeBSD
- @skipIfLinux
- @skipIfWindows
- @expectedFailureDarwin # clang: error: unknown argument: '-gmodules'
- def test_expr_with_dwarf(self):
- self.buildDwarf()
- self.expr()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
# Find the line number to break inside main().
self.line = line_number('main.m', '// Set breakpoint 0 here.')
- def applies(self):
- if platform.system() != "Darwin":
- return False
- if StrictVersion('12.0.0') > platform.release():
- return False
-
- return True
-
- def common_setup(self):
+ @skipUnlessDarwin
+ @unittest2.expectedFailure("rdar://problem/19991953")
+ @expectedFailureDarwin # clang: error: unknown argument: '-gmodules'
+ @unittest2.skipIf(platform.system() != "Darwin" or StrictVersion('12.0.0') > platform.release(), "Only supported on Darwin 12.0.0+")
+ def test_expr(self):
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -62,12 +43,6 @@
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
substrs = [' resolved, hit count = 1'])
- def expr(self):
- if not self.applies():
- return
-
- self.common_setup()
-
self.runCmd("settings set target.auto-import-clang-modules true")
self.expect("p getpid()", VARIABLES_DISPLAYED_CORRECTLY,
diff --git a/lldb/test/lang/objc/modules-incomplete/TestIncompleteModules.py b/lldb/test/lang/objc/modules-incomplete/TestIncompleteModules.py
index b552fd5..60bb82d 100644
--- a/lldb/test/lang/objc/modules-incomplete/TestIncompleteModules.py
+++ b/lldb/test/lang/objc/modules-incomplete/TestIncompleteModules.py
@@ -14,36 +14,17 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @dsym_test
- @unittest2.expectedFailure("rdar://20416388")
- def test_expr_with_dsym(self):
- self.buildDsym()
- self.expr()
-
- @dwarf_test
- @skipIfFreeBSD
- @skipIfLinux
- @unittest2.expectedFailure("rdar://20416388")
- def test_expr_with_dwarf(self):
- self.buildDwarf()
- self.expr()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
# Find the line number to break inside main().
self.line = line_number('main.m', '// Set breakpoint 0 here.')
- def applies(self):
- if platform.system() != "Darwin":
- return False
- if StrictVersion('12.0.0') > platform.release():
- return False
-
- return True
-
- def common_setup(self):
+ @skipUnlessDarwin
+ @unittest2.expectedFailure("rdar://20416388")
+ @unittest2.skipIf(platform.system() != "Darwin" or StrictVersion('12.0.0') > platform.release(), "Only supported on Darwin 12.0.0+")
+ def test_expr(self):
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -61,12 +42,6 @@
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
substrs = [' resolved, hit count = 1'])
- def expr(self):
- if not self.applies():
- return
-
- self.common_setup()
-
self.runCmd("settings set target.clang-module-search-paths \"" + os.getcwd() + "\"")
self.expect("expr @import myModule; 3", VARIABLES_DISPLAYED_CORRECTLY,
diff --git a/lldb/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py b/lldb/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
index e74cd82..02ac9d7 100644
--- a/lldb/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
+++ b/lldb/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
@@ -14,35 +14,16 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @dsym_test
- def test_expr_with_dsym(self):
- self.buildDsym()
- self.expr()
-
- @dwarf_test
- @skipIfFreeBSD
- @skipIfLinux
- @skipIfWindows
- def test_expr_with_dwarf(self):
- self.buildDwarf()
- self.expr()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
# Find the line number to break inside main().
self.line = line_number('main.m', '// Set breakpoint here.')
- def applies(self):
- if platform.system() != "Darwin":
- return False
- if StrictVersion('12.0.0') > platform.release():
- return False
-
- return True
-
- def common_setup(self):
+ @skipUnlessDarwin
+ @unittest2.skipIf(platform.system() != "Darwin" or StrictVersion('12.0.0') > platform.release(), "Only supported on Darwin 12.0.0+")
+ def test_expr(self):
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -60,12 +41,6 @@
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
substrs = [' resolved, hit count = 1'])
- def expr(self):
- if not self.applies():
- return
-
- self.common_setup()
-
self.runCmd("settings set target.clang-module-search-paths \"" + os.getcwd() + "\"")
self.expect("expr @import myModule; 3", VARIABLES_DISPLAYED_CORRECTLY,
diff --git a/lldb/test/lang/objc/modules/TestObjCModules.py b/lldb/test/lang/objc/modules/TestObjCModules.py
index 09a5bfa..b3a5d13 100644
--- a/lldb/test/lang/objc/modules/TestObjCModules.py
+++ b/lldb/test/lang/objc/modules/TestObjCModules.py
@@ -14,35 +14,20 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @dsym_test
- @unittest2.expectedFailure("rdar://20416388")
- def test_expr_with_dsym(self):
- self.buildDsym()
- self.expr()
-
- @dwarf_test
- @skipUnlessDarwin
- @unittest2.expectedFailure("rdar://20416388")
- def test_expr_with_dwarf(self):
- self.buildDwarf()
- self.expr()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
# Find the line number to break inside main().
self.line = line_number('main.m', '// Set breakpoint 0 here.')
- def applies(self):
- if platform.system() != "Darwin":
- return False
- if StrictVersion('12.0.0') > platform.release():
- return False
+ @skipUnlessDarwin
+ @unittest2.expectedFailure("rdar://20416388")
+ @unittest2.skipIf(platform.system() != "Darwin" or StrictVersion('12.0.0') > platform.release(), "Only supported on Darwin 12.0.0+")
+ def test_expr(self):
+ if not self.applies():
+ return
- return True
-
- def common_setup(self):
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -60,12 +45,6 @@
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
substrs = [' resolved, hit count = 1'])
- def expr(self):
- if not self.applies():
- return
-
- self.common_setup()
-
self.expect("expr @import Darwin; 3", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ["int", "3"])
@@ -86,7 +65,7 @@
self.expect("p [NSURL URLWithString:@\"http://lldb.llvm.org\"].scheme", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ["http"])
-
+
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
diff --git a/lldb/test/lang/objc/objc++/TestObjCXX.py b/lldb/test/lang/objc/objc++/TestObjCXX.py
index eeb2bc8..1ae73bd 100644
--- a/lldb/test/lang/objc/objc++/TestObjCXX.py
+++ b/lldb/test/lang/objc/objc++/TestObjCXX.py
@@ -12,25 +12,13 @@
mydir = TestBase.compute_mydir(__file__)
- @dsym_test
- def test_break_with_dsym(self):
- """Test ivars of Objective-C++ classes"""
- if self.getArchitecture() == 'i386':
- self.skipTest("requires Objective-C 2.0 runtime")
- self.buildDsym()
- self.do_testObjCXXClasses()
-
@skipUnlessDarwin
- @dwarf_test
- def test_break_with_dwarf(self):
+ def test_break(self):
"""Test ivars of Objective-C++ classes"""
if self.getArchitecture() == 'i386':
self.skipTest("requires Objective-C 2.0 runtime")
- self.buildDwarf()
- self.do_testObjCXXClasses()
- def do_testObjCXXClasses(self):
- """Test ivars of Objective-C++ classes"""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
diff --git a/lldb/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py b/lldb/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
index d732f67..f7d8d5b 100644
--- a/lldb/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
+++ b/lldb/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
@@ -12,36 +12,21 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @python_api_test
- @dsym_test
- def test_get_baseclass_with_dsym(self):
- """Test fetching ObjC base class info."""
- if self.getArchitecture() == 'i386':
- # rdar://problem/9946499
- self.skipTest("Dynamic types for ObjC V1 runtime not implemented")
- self.buildDsym()
- self.do_get_baseclass_info()
-
- @skipUnlessDarwin
- @python_api_test
- @dwarf_test
- def test_get_baseclass_with_dwarf(self):
- """Test fetching ObjC dynamic values."""
- if self.getArchitecture() == 'i386':
- # rdar://problem/9946499
- self.skipTest("Dynamic types for ObjC V1 runtime not implemented")
- self.buildDwarf()
- self.do_get_baseclass_info()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
self.line = line_number('main.m', '// Set breakpoint here.')
- def do_get_baseclass_info(self):
- """Make sure we get dynamic values correctly both for compiled in classes and dynamic ones"""
+ @skipUnlessDarwin
+ @python_api_test
+ def test_get_baseclass(self):
+ """Test fetching ObjC dynamic values."""
+ if self.getArchitecture() == 'i386':
+ # rdar://problem/9946499
+ self.skipTest("Dynamic types for ObjC V1 runtime not implemented")
+
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
# Create a target from the debugger.
diff --git a/lldb/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py b/lldb/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py
index ad48156..f07adb6 100644
--- a/lldb/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py
+++ b/lldb/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py
@@ -10,22 +10,6 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @python_api_test
-
- @dsym_test
- def test_with_dsym_and_python_api(self):
- """Test expression parser respect for ObjC built-in types."""
- self.buildDsym()
- self.objc_builtin_types()
-
- @python_api_test
- @dwarf_test
- def test_with_dwarf_and_python_api(self):
- """Test expression parser respect for ObjC built-in types."""
- self.buildDwarf()
- self.objc_builtin_types()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -33,9 +17,12 @@
self.main_source = "main.cpp"
self.break_line = line_number(self.main_source, '// Set breakpoint here.')
+ @skipUnlessDarwin
+ @python_api_test
#<rdar://problem/10591460> [regression] Can't print ivar value: error: reference to 'id' is ambiguous
- def objc_builtin_types(self):
+ def test_with_python_api(self):
"""Test expression parser respect for ObjC built-in types."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
target = self.dbg.CreateTarget(exe)
diff --git a/lldb/test/lang/objc/objc-checker/TestObjCCheckers.py b/lldb/test/lang/objc/objc-checker/TestObjCCheckers.py
index 550ce0e..8f816c5 100644
--- a/lldb/test/lang/objc/objc-checker/TestObjCCheckers.py
+++ b/lldb/test/lang/objc/objc-checker/TestObjCCheckers.py
@@ -12,36 +12,21 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @python_api_test
- @dsym_test
- def test_objc_checker_with_dsym(self):
- """Test that checkers catch unrecognized selectors"""
- if self.getArchitecture() == 'i386':
- self.skipTest("requires Objective-C 2.0 runtime")
- self.buildDsym()
- self.do_test_checkers()
-
- @skipUnlessDarwin
- @python_api_test
- @dwarf_test
- def test_objc_checker_with_dwarf(self):
- """Test that checkers catch unrecognized selectors"""
- if self.getArchitecture() == 'i386':
- self.skipTest("requires Objective-C 2.0 runtime")
- self.buildDwarf()
- self.do_test_checkers()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
# Find the line number to break for main.c.
-
self.source_name = 'main.m'
- def do_test_checkers (self):
- """Make sure the dynamic checkers catch messages to unrecognized selectors"""
+ @skipUnlessDarwin
+ @python_api_test
+ def test_objc_checker(self):
+ """Test that checkers catch unrecognized selectors"""
+ if self.getArchitecture() == 'i386':
+ self.skipTest("requires Objective-C 2.0 runtime")
+
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
# Create a target from the debugger.
diff --git a/lldb/test/lang/objc/objc-class-method/TestObjCClassMethod.py b/lldb/test/lang/objc/objc-class-method/TestObjCClassMethod.py
index b3929b9..27b0915 100644
--- a/lldb/test/lang/objc/objc-class-method/TestObjCClassMethod.py
+++ b/lldb/test/lang/objc/objc-class-method/TestObjCClassMethod.py
@@ -10,25 +10,6 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @python_api_test
-
- @expectedFailurei386
- @dsym_test
- def test_with_dsym_and_python_api(self):
- """Test calling functions in class methods."""
- self.buildDsym()
- self.objc_class_method()
-
- @skipUnlessDarwin
- @expectedFailurei386
- @python_api_test
- @dwarf_test
- def test_with_dwarf_and_python_api(self):
- """Test calling functions in class methods."""
- self.buildDwarf()
- self.objc_class_method()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -36,9 +17,13 @@
self.main_source = "class.m"
self.break_line = line_number(self.main_source, '// Set breakpoint here.')
+ @skipUnlessDarwin
+ @expectedFailurei386
+ @python_api_test
#rdar://problem/9745789 "expression" can't call functions in class methods
- def objc_class_method(self):
- """Test calling class methods."""
+ def test_with_python_api(self):
+ """Test calling functions in class methods."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
target = self.dbg.CreateTarget(exe)
@@ -65,7 +50,7 @@
cmd_value = frame.EvaluateExpression ("(int)[Foo doSomethingWithString:@\"Hello\"]")
self.assertTrue (cmd_value.IsValid())
- self.assertTrue (cmd_value.GetValueAsUnsigned() == 5)
+ self.assertTrue (cmd_value.GetValueAsUnsigned() == 5)
if __name__ == '__main__':
import atexit
diff --git a/lldb/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py b/lldb/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py
index fd3ae84..27f6da1 100644
--- a/lldb/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py
+++ b/lldb/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py
@@ -13,24 +13,6 @@
mydir = TestBase.compute_mydir(__file__)
- @dsym_test
- @skipIfi386
- def test_dyn_with_dsym(self):
- """Test that we are able to properly report a usable dynamic type."""
- d = {'EXE': self.exe_name}
- self.buildDsym(dictionary=d)
- self.setTearDownCleanup(dictionary=d)
- self.dyn(self.exe_name)
-
- @dwarf_test
- @skipIfi386
- def test_dyn_with_dwarf(self):
- """Test that we are able to properly report a usable dynamic type."""
- d = {'EXE': self.exe_name}
- self.buildDwarf(dictionary=d)
- self.setTearDownCleanup(dictionary=d)
- self.dyn(self.exe_name)
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -40,9 +22,14 @@
self.main_source = "main.m"
self.line = line_number(self.main_source, '// Set breakpoint here.')
- def dyn(self, exe_name):
+ @skipIfi386
+ def test_dyn(self):
"""Test that we are able to properly report a usable dynamic type."""
- exe = os.path.join(os.getcwd(), exe_name)
+ d = {'EXE': self.exe_name}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(dictionary=d)
+
+ exe = os.path.join(os.getcwd(), self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line (self, self.main_source, self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py b/lldb/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
index 61a69cb..37a7b07 100644
--- a/lldb/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
+++ b/lldb/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
@@ -12,30 +12,6 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @python_api_test
- @dsym_test
- @expectedFailureDarwin("llvm.org/pr20271 rdar://18684107")
- def test_get_dynamic_objc_vals_with_dsym(self):
- """Test fetching ObjC dynamic values."""
- if self.getArchitecture() == 'i386':
- # rdar://problem/9946499
- self.skipTest("Dynamic types for ObjC V1 runtime not implemented")
- self.buildDsym()
- self.do_get_dynamic_vals()
-
- @skipUnlessDarwin
- @python_api_test
- @dwarf_test
- @expectedFailureDarwin("llvm.org/pr20271 rdar://18684107")
- def test_get_objc_dynamic_vals_with_dwarf(self):
- """Test fetching ObjC dynamic values."""
- if self.getArchitecture() == 'i386':
- # rdar://problem/9946499
- self.skipTest("Dynamic types for ObjC V1 runtime not implemented")
- self.buildDwarf()
- self.do_get_dynamic_vals()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -49,15 +25,16 @@
self.main_before_setProperty_line = line_number(self.source_name,
'// Break here to see if we can step into real method.')
- def examine_SourceDerived_ptr (self, object):
- self.assertTrue (object)
- self.assertTrue (object.GetTypeName().find ('SourceDerived') != -1)
- derivedValue = object.GetChildMemberWithName ('_derivedValue')
- self.assertTrue (derivedValue)
- self.assertTrue (int (derivedValue.GetValue(), 0) == 30)
+ @skipUnlessDarwin
+ @python_api_test
+ @expectedFailureDarwin("llvm.org/pr20271 rdar://18684107")
+ def test_get_objc_dynamic_vals(self):
+ """Test fetching ObjC dynamic values."""
+ if self.getArchitecture() == 'i386':
+ # rdar://problem/9946499
+ self.skipTest("Dynamic types for ObjC V1 runtime not implemented")
- def do_get_dynamic_vals(self):
- """Make sure we get dynamic values correctly both for compiled in classes and dynamic ones"""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
# Create a target from the debugger.
@@ -188,6 +165,13 @@
self.examine_SourceDerived_ptr (object_dynamic)
+ def examine_SourceDerived_ptr (self, object):
+ self.assertTrue (object)
+ self.assertTrue (object.GetTypeName().find ('SourceDerived') != -1)
+ derivedValue = object.GetChildMemberWithName ('_derivedValue')
+ self.assertTrue (derivedValue)
+ self.assertTrue (int (derivedValue.GetValue(), 0) == 30)
+
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
diff --git a/lldb/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py b/lldb/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
index d03176b..98d6aa5 100644
--- a/lldb/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
+++ b/lldb/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
@@ -10,22 +10,6 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @python_api_test
- @dsym_test
- def test_with_dsym_and_python_api(self):
- """Test printing ObjC objects that use unbacked properties"""
- self.buildDsym()
- self.objc_ivar_offsets()
-
- @skipUnlessDarwin
- @python_api_test
- @dwarf_test
- def test_with_dwarf_and_python_api(self):
- """Test printing ObjC objects that use unbacked properties"""
- self.buildDwarf()
- self.objc_ivar_offsets()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -33,8 +17,11 @@
self.main_source = "main.m"
self.stop_line = line_number(self.main_source, '// Set breakpoint here.')
- def objc_ivar_offsets(self):
- """Use Python APIs to test stepping into ObjC methods."""
+ @skipUnlessDarwin
+ @python_api_test
+ def test_with_python_api(self):
+ """Test printing ObjC objects that use unbacked properties"""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
target = self.dbg.CreateTarget(exe)
diff --git a/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py b/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
index 56d9eb9..324744f 100644
--- a/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
+++ b/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
@@ -10,14 +10,6 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @python_api_test
- @dsym_test
- def test_with_dsym_and_python_api(self):
- """Test that we can find stripped Objective-C ivars in the runtime"""
- self.buildDsym()
- self.objc_ivar_offsets()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -25,8 +17,11 @@
self.main_source = "main.m"
self.stop_line = line_number(self.main_source, '// Set breakpoint here.')
- def objc_ivar_offsets(self):
+ @skipUnlessDarwin
+ @python_api_test
+ def test_with_python_api(self):
"""Test that we can find stripped Objective-C ivars in the runtime"""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out.stripped")
target = self.dbg.CreateTarget(exe)
diff --git a/lldb/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py b/lldb/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
index 29e86fa..97d8f92 100644
--- a/lldb/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
+++ b/lldb/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
@@ -14,39 +14,17 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @dsym_test
- @expectedFailureAll(
- oslist=['macosx'], compiler='clang', compiler_version=['<', '7.0.0'])
- def test_expr_with_dsym(self):
- self.buildDsym()
- self.expr()
-
- @dwarf_test
- @skipIfFreeBSD
- @skipIfLinux
- @skipIfWindows
- @expectedFailureAll(
- oslist=['macosx'], compiler='clang', compiler_version=['<', '7.0.0'])
- def test_expr_with_dwarf(self):
- self.buildDwarf()
- self.expr()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
# Find the line number to break inside main().
self.line = line_number('main.m', '// Set breakpoint 0 here.')
- def applies(self):
- if platform.system() != "Darwin":
- return False
- if StrictVersion('12.0.0') > platform.release():
- return False
-
- return True
-
- def common_setup(self):
+ @skipUnlessDarwin
+ @expectedFailureAll(oslist=['macosx'], compiler='clang', compiler_version=['<', '7.0.0'])
+ @unittest2.skipIf(platform.system() != "Darwin" or StrictVersion('12.0.0') > platform.release(), "Only supported on Darwin 12.0.0+")
+ def test_expr(self):
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -64,12 +42,6 @@
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
substrs = [' resolved, hit count = 1'])
- def expr(self):
- if not self.applies():
- return
-
- self.common_setup()
-
self.expect("expr --object-description -- immutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ["foo"])
@@ -126,7 +98,6 @@
self.expect("expr -- @((char*)\"Hello world\" + 6)", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ["NSString", "world"])
-
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
diff --git a/lldb/test/lang/objc/objc-optimized/TestObjcOptimized.py b/lldb/test/lang/objc/objc-optimized/TestObjcOptimized.py
index 507e29e..e6a5958 100644
--- a/lldb/test/lang/objc/objc-optimized/TestObjcOptimized.py
+++ b/lldb/test/lang/objc/objc-optimized/TestObjcOptimized.py
@@ -24,20 +24,9 @@
mymethod = "description"
method_spec = "-[%s %s]" % (myclass, mymethod)
- @dsym_test
- def test_break_with_dsym(self):
+ def test_break(self):
"""Test 'expr member' continues to work for optimized build."""
- self.buildDsym()
- self.objc_optimized()
-
- @dwarf_test
- def test_break_with_dwarf(self):
- """Test 'expr member' continues to work for optimized build."""
- self.buildDwarf()
- self.objc_optimized()
-
- def objc_optimized(self):
- """Test 'expr member' continues to work for optimized build."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
diff --git a/lldb/test/lang/objc/objc-property/TestObjCProperty.py b/lldb/test/lang/objc/objc-property/TestObjCProperty.py
index 842ada1..0ed0836 100644
--- a/lldb/test/lang/objc/objc-property/TestObjCProperty.py
+++ b/lldb/test/lang/objc/objc-property/TestObjCProperty.py
@@ -12,36 +12,21 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @python_api_test
- @dsym_test
- def test_objc_properties_with_dsym(self):
- """Test that expr uses the correct property getters and setters"""
- if self.getArchitecture() == 'i386':
- self.skipTest("requires modern objc runtime")
- self.buildDsym()
- self.do_test_properties()
-
- @skipUnlessDarwin
- @python_api_test
- @dwarf_test
- def test_objc_properties_with_dwarf(self):
- """Test that expr uses the correct property getters and setters"""
- if self.getArchitecture() == 'i386':
- self.skipTest("requires modern objc runtime")
- self.buildDwarf()
- self.do_test_properties()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
# Find the line number to break for main.c.
-
self.source_name = 'main.m'
- def run_to_main (self):
+ @skipUnlessDarwin
+ @python_api_test
+ def test_objc_properties(self):
"""Test that expr uses the correct property getters and setters"""
+ if self.getArchitecture() == 'i386':
+ self.skipTest("requires modern objc runtime")
+
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
# Create a target from the debugger.
@@ -65,12 +50,6 @@
threads = lldbutil.get_threads_stopped_at_breakpoint (process, main_bkpt)
self.assertTrue (len(threads) == 1)
thread = threads[0]
- return thread
-
- def do_test_properties (self):
-
- thread = self.run_to_main()
-
frame = thread.GetFrameAtIndex(0)
mine = frame.FindVariable ("mine")
diff --git a/lldb/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py b/lldb/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py
index 894fa22..664494e 100644
--- a/lldb/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py
+++ b/lldb/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py
@@ -10,17 +10,6 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @python_api_test
- #<rdar://problem/12042992>
- @dsym_test
- def test_with_dsym_and_python_api(self):
- """Test calling functions in static methods with a stripped binary."""
- if self.getArchitecture() == 'i386':
- self.skipTest("requires modern objc runtime")
- self.buildDsym()
- self.objc_static_method_stripped()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -28,9 +17,14 @@
self.main_source = "static.m"
self.break_line = line_number(self.main_source, '// Set breakpoint here.')
+ @skipUnlessDarwin
+ @python_api_test
#<rdar://problem/12042992>
- def objc_static_method_stripped(self):
+ def test_with_python_api(self):
"""Test calling functions in static methods with a stripped binary."""
+ if self.getArchitecture() == 'i386':
+ self.skipTest("requires modern objc runtime")
+ self.build()
exe = os.path.join(os.getcwd(), "a.out.stripped")
target = self.dbg.CreateTarget(exe)
diff --git a/lldb/test/lang/objc/objc-static-method/TestObjCStaticMethod.py b/lldb/test/lang/objc/objc-static-method/TestObjCStaticMethod.py
index 84f5210..c54d23b 100644
--- a/lldb/test/lang/objc/objc-static-method/TestObjCStaticMethod.py
+++ b/lldb/test/lang/objc/objc-static-method/TestObjCStaticMethod.py
@@ -10,24 +10,6 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @python_api_test
- #<rdar://problem/9745789> "expression" can't call functions in class methods
- @dsym_test
- def test_with_dsym_and_python_api(self):
- """Test calling functions in static methods."""
- self.buildDsym()
- self.objc_static_method()
-
- @skipUnlessDarwin
- @python_api_test
- #<rdar://problem/9745789> "expression" can't call functions in class methods
- @dwarf_test
- def test_with_dwarf_and_python_api(self):
- """Test calling functions in static methods."""
- self.buildDwarf()
- self.objc_static_method()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -35,9 +17,12 @@
self.main_source = "static.m"
self.break_line = line_number(self.main_source, '// Set breakpoint here.')
- #rdar://problem/9745789 "expression" can't call functions in class methods
- def objc_static_method(self):
+ @skipUnlessDarwin
+ @python_api_test
+ #<rdar://problem/9745789> "expression" can't call functions in class methods
+ def test_with_python_api(self):
"""Test calling functions in static methods."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
target = self.dbg.CreateTarget(exe)
diff --git a/lldb/test/lang/objc/objc-stepping/TestObjCStepping.py b/lldb/test/lang/objc/objc-stepping/TestObjCStepping.py
index d93bae6..0fb8bce 100644
--- a/lldb/test/lang/objc/objc-stepping/TestObjCStepping.py
+++ b/lldb/test/lang/objc/objc-stepping/TestObjCStepping.py
@@ -13,22 +13,6 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @python_api_test
- @dsym_test
- def test_with_dsym_and_python_api(self):
- """Test stepping through ObjC method dispatch in various forms."""
- self.buildDsym()
- self.objc_stepping()
-
- @skipUnlessDarwin
- @python_api_test
- @dwarf_test
- def test_with_dwarf_and_python_api(self):
- """Test stepping through ObjC method dispatch in various forms."""
- self.buildDwarf()
- self.objc_stepping()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -40,8 +24,11 @@
self.sourceBase_returnsStruct_start_line = line_number (self.main_source, '// SourceBase returnsStruct start line.')
self.stepped_past_nil_line = line_number (self.main_source, '// Step over nil should stop here.')
- def objc_stepping(self):
- """Use Python APIs to test stepping into ObjC methods."""
+ @skipUnlessDarwin
+ @python_api_test
+ def test_with_python_api(self):
+ """Test stepping through ObjC method dispatch in various forms."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
target = self.dbg.CreateTarget(exe)
diff --git a/lldb/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py b/lldb/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py
index 5e4106e..47d1ea4 100644
--- a/lldb/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py
+++ b/lldb/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py
@@ -10,22 +10,6 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @python_api_test
- @dsym_test
- def test_with_dsym_and_python_api(self):
- """Test passing structs to Objective-C methods."""
- self.buildDsym()
- self.objc_class_method()
-
- @skipUnlessDarwin
- @python_api_test
- @dwarf_test
- def test_with_dwarf_and_python_api(self):
- """Test passing structs to Objective-C methods."""
- self.buildDwarf()
- self.objc_class_method()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -33,8 +17,11 @@
self.main_source = "test.m"
self.break_line = line_number(self.main_source, '// Set breakpoint here.')
- def objc_class_method(self):
+ @skipUnlessDarwin
+ @python_api_test
+ def test_with_python_api(self):
"""Test passing structs to Objective-C methods."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
target = self.dbg.CreateTarget(exe)
diff --git a/lldb/test/lang/objc/objc-struct-return/TestObjCStructReturn.py b/lldb/test/lang/objc/objc-struct-return/TestObjCStructReturn.py
index c884fe9..27a3c3e 100644
--- a/lldb/test/lang/objc/objc-struct-return/TestObjCStructReturn.py
+++ b/lldb/test/lang/objc/objc-struct-return/TestObjCStructReturn.py
@@ -10,22 +10,6 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @python_api_test
- @dsym_test
- def test_with_dsym_and_python_api(self):
- """Test calling functions in class methods."""
- self.buildDsym()
- self.objc_class_method()
-
- @skipUnlessDarwin
- @python_api_test
- @dwarf_test
- def test_with_dwarf_and_python_api(self):
- """Test calling functions in class methods."""
- self.buildDwarf()
- self.objc_class_method()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -33,8 +17,11 @@
self.main_source = "test.m"
self.break_line = line_number(self.main_source, '// Set breakpoint here.')
- def objc_class_method(self):
- """Test calling class methods."""
+ @skipUnlessDarwin
+ @python_api_test
+ def test_with_python_api(self):
+ """Test calling functions in class methods."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
target = self.dbg.CreateTarget(exe)
diff --git a/lldb/test/lang/objc/objc-super/TestObjCSuper.py b/lldb/test/lang/objc/objc-super/TestObjCSuper.py
index faa97c2..1d1f43b 100644
--- a/lldb/test/lang/objc/objc-super/TestObjCSuper.py
+++ b/lldb/test/lang/objc/objc-super/TestObjCSuper.py
@@ -10,24 +10,6 @@
mydir = TestBase.compute_mydir(__file__)
- @skipUnlessDarwin
- @expectedFailurei386
- @python_api_test
- @dsym_test
- def test_with_dsym_and_python_api(self):
- """Test calling methods on super."""
- self.buildDsym()
- self.objc_super()
-
- @skipUnlessDarwin
- @expectedFailurei386
- @python_api_test
- @dwarf_test
- def test_with_dwarf_and_python_api(self):
- """Test calling methods on super."""
- self.buildDwarf()
- self.objc_super()
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -35,8 +17,12 @@
self.main_source = "class.m"
self.break_line = line_number(self.main_source, '// Set breakpoint here.')
- def objc_super(self):
+ @skipUnlessDarwin
+ @expectedFailurei386
+ @python_api_test
+ def test_with_python_api(self):
"""Test calling methods on super."""
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
target = self.dbg.CreateTarget(exe)
diff --git a/lldb/test/lang/objc/print-obj/TestPrintObj.py b/lldb/test/lang/objc/print-obj/TestPrintObj.py
index c3386bf..f6143b0 100644
--- a/lldb/test/lang/objc/print-obj/TestPrintObj.py
+++ b/lldb/test/lang/objc/print-obj/TestPrintObj.py
@@ -12,22 +12,6 @@
mydir = TestBase.compute_mydir(__file__)
- @dsym_test
- def test_print_obj_with_dsym(self):
- """Test "print object" where another thread blocks the print object from making progress."""
- d = {'EXE': 'a.out'}
- self.buildDsym(dictionary=d)
- self.setTearDownCleanup(dictionary=d)
- self.print_obj('a.out')
-
- @dwarf_test
- def test_print_obj_with_dwarf(self):
- """Test "print object" where another thread blocks the print object from making progress."""
- d = {'EXE': 'b.out'}
- self.buildDwarf(dictionary=d)
- self.setTearDownCleanup(dictionary=d)
- self.print_obj('b.out')
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -36,7 +20,7 @@
# Find the line numbers to break at.
self.line = line_number(self.source, '// Set a breakpoint here.')
- def print_obj(self, exe_name):
+ def test_print_obj(self):
"""
Test "print object" where another thread blocks the print object from making progress.
@@ -45,7 +29,10 @@
try to get the lock already gotten by my_pthread_routime thread, it will
have to switch to running all threads, and that should then succeed.
"""
- exe = os.path.join(os.getcwd(), exe_name)
+ d = {'EXE': 'b.out'}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(dictionary=d)
+ exe = os.path.join(os.getcwd(), 'b.out')
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py b/lldb/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py
index ff860e1..b33741b 100644
--- a/lldb/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py
+++ b/lldb/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py
@@ -13,22 +13,6 @@
mydir = TestBase.compute_mydir(__file__)
- @dsym_test
- def test_method_ret_BOOL_with_dsym(self):
- """Test that objective-c method returning BOOL works correctly."""
- d = {'EXE': self.exe_name}
- self.buildDsym(dictionary=d)
- self.setTearDownCleanup(dictionary=d)
- self.objc_method_ret_BOOL(self.exe_name)
-
- @dwarf_test
- def test_method_ret_BOOL_with_dwarf(self):
- """Test that objective-c method returning BOOL works correctly."""
- d = {'EXE': self.exe_name}
- self.buildDwarf(dictionary=d)
- self.setTearDownCleanup(dictionary=d)
- self.objc_method_ret_BOOL(self.exe_name)
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -38,9 +22,13 @@
self.main_source = "main.m"
self.line = line_number(self.main_source, '// Set breakpoint here.')
- def objc_method_ret_BOOL(self, exe_name):
+ def test_method_ret_BOOL(self):
"""Test that objective-c method returning BOOL works correctly."""
- exe = os.path.join(os.getcwd(), exe_name)
+ d = {'EXE': self.exe_name}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(dictionary=d)
+
+ exe = os.path.join(os.getcwd(), self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/test/lang/objc/rdar-10967107/TestRdar10967107.py b/lldb/test/lang/objc/rdar-10967107/TestRdar10967107.py
index c8f4c1f..17d1015 100644
--- a/lldb/test/lang/objc/rdar-10967107/TestRdar10967107.py
+++ b/lldb/test/lang/objc/rdar-10967107/TestRdar10967107.py
@@ -13,22 +13,6 @@
mydir = TestBase.compute_mydir(__file__)
- @dsym_test
- def test_cfrange_diff_cfgregoriandate_with_dsym(self):
- """Test that CoreFoundation classes CFGregorianDate and CFRange are not improperly uniqued."""
- d = {'EXE': self.exe_name}
- self.buildDsym(dictionary=d)
- self.setTearDownCleanup(dictionary=d)
- self.cfrange_diff_cfgregoriandate(self.exe_name)
-
- @dwarf_test
- def test_cfrange_diff_cfgregoriandate_with_dwarf(self):
- """Test that CoreFoundation classes CFGregorianDate and CFRange are not improperly uniqued."""
- d = {'EXE': self.exe_name}
- self.buildDwarf(dictionary=d)
- self.setTearDownCleanup(dictionary=d)
- self.cfrange_diff_cfgregoriandate(self.exe_name)
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -38,9 +22,13 @@
self.main_source = "main.m"
self.line = line_number(self.main_source, '// Set breakpoint here.')
- def cfrange_diff_cfgregoriandate(self, exe_name):
+ def test_cfrange_diff_cfgregoriandate(self):
"""Test that CoreFoundation classes CFGregorianDate and CFRange are not improperly uniqued."""
- exe = os.path.join(os.getcwd(), exe_name)
+ d = {'EXE': self.exe_name}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(dictionary=d)
+
+ exe = os.path.join(os.getcwd(), self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line (self, self.main_source, self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/test/lang/objc/rdar-11355592/TestRdar11355592.py b/lldb/test/lang/objc/rdar-11355592/TestRdar11355592.py
index 0cbb738..14f85c4 100644
--- a/lldb/test/lang/objc/rdar-11355592/TestRdar11355592.py
+++ b/lldb/test/lang/objc/rdar-11355592/TestRdar11355592.py
@@ -13,22 +13,6 @@
mydir = TestBase.compute_mydir(__file__)
- @dsym_test
- def test_charstar_dyntype_with_dsym(self):
- """Test that we do not attempt to make a dynamic type for a 'const char*'"""
- d = {'EXE': self.exe_name}
- self.buildDsym(dictionary=d)
- self.setTearDownCleanup(dictionary=d)
- self.charstar_dyntype(self.exe_name)
-
- @dwarf_test
- def test_charstar_dyntype_with_dwarf(self):
- """Test that we do not attempt to make a dynamic type for a 'const char*'"""
- d = {'EXE': self.exe_name}
- self.buildDwarf(dictionary=d)
- self.setTearDownCleanup(dictionary=d)
- self.charstar_dyntype(self.exe_name)
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -38,9 +22,13 @@
self.main_source = "main.m"
self.line = line_number(self.main_source, '// Set breakpoint here.')
- def charstar_dyntype(self, exe_name):
+ def test_charstar_dyntype(self):
"""Test that we do not attempt to make a dynamic type for a 'const char*'"""
- exe = os.path.join(os.getcwd(), exe_name)
+ d = {'EXE': self.exe_name}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(dictionary=d)
+
+ exe = os.path.join(os.getcwd(), self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line (self, self.main_source, self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/test/lang/objc/rdar-12408181/TestRdar12408181.py b/lldb/test/lang/objc/rdar-12408181/TestRdar12408181.py
index ddc94ef..d1d2292 100644
--- a/lldb/test/lang/objc/rdar-12408181/TestRdar12408181.py
+++ b/lldb/test/lang/objc/rdar-12408181/TestRdar12408181.py
@@ -13,22 +13,6 @@
mydir = TestBase.compute_mydir(__file__)
- @dsym_test
- def test_nswindow_count_with_dsym(self):
- """Test that we are able to find out how many children NSWindow has."""
- d = {'EXE': self.exe_name}
- self.buildDsym(dictionary=d)
- self.setTearDownCleanup(dictionary=d)
- self.nswindow_count(self.exe_name)
-
- @dwarf_test
- def test_nswindow_count_with_dwarf(self):
- """Test that we are able to find out how many children NSWindow has."""
- d = {'EXE': self.exe_name}
- self.buildDwarf(dictionary=d)
- self.setTearDownCleanup(dictionary=d)
- self.nswindow_count(self.exe_name)
-
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -38,9 +22,13 @@
self.main_source = "main.m"
self.line = line_number(self.main_source, '// Set breakpoint here.')
- def nswindow_count(self, exe_name):
+ def test_nswindow_count(self):
"""Test that we are able to find out how many children NSWindow has."""
- exe = os.path.join(os.getcwd(), exe_name)
+ d = {'EXE': self.exe_name}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(dictionary=d)
+
+ exe = os.path.join(os.getcwd(), self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line (self, self.main_source, self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/test/lang/objc/real-definition/TestRealDefinition.py b/lldb/test/lang/objc/real-definition/TestRealDefinition.py
index 41f0b27..8557423 100644
--- a/lldb/test/lang/objc/real-definition/TestRealDefinition.py
+++ b/lldb/test/lang/objc/real-definition/TestRealDefinition.py
@@ -11,55 +11,11 @@
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
- @dsym_test
- def test_frame_var_after_stop_at_interface_with_dsym(self):
+ def test_frame_var_after_stop_at_interface(self):
"""Test that we can find the implementation for an objective C type"""
if self.getArchitecture() == 'i386':
self.skipTest("requires modern objc runtime")
- self.buildDsym()
- self.stop_at_interface()
-
- @skipUnlessDarwin
- @dwarf_test
- def test_frame_var_after_stop_at_interface_with_dwarf(self):
- """Test that we can find the implementation for an objective C type"""
- if self.getArchitecture() == 'i386':
- self.skipTest("requires modern objc runtime")
- self.buildDwarf()
- self.stop_at_interface()
-
- @skipUnlessDarwin
- @dsym_test
- def test_frame_var_after_stop_at_implementation_with_dsym(self):
- """Test that we can find the implementation for an objective C type"""
- if self.getArchitecture() == 'i386':
- self.skipTest("requires modern objc runtime")
- self.buildDsym()
- self.stop_at_implementation()
-
- @skipUnlessDarwin
- @dwarf_test
- def test_frame_var_after_stop_at_implementation_with_dwarf(self):
- """Test that we can find the implementation for an objective C type"""
- if self.getArchitecture() == 'i386':
- self.skipTest("requires modern objc runtime")
- self.buildDwarf()
- self.stop_at_implementation()
-
- def setUp(self):
- # Call super's setUp().
- TestBase.setUp(self)
-
- def common_setup(self):
- exe = os.path.join(os.getcwd(), "a.out")
- self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
-
- # Break inside the foo function which takes a bar_ptr argument.
- line = line_number('main.m', '// Set breakpoint in main')
- lldbutil.run_break_set_by_file_and_line (self, "main.m", line, num_expected_locations=1, loc_exact=True)
-
- def stop_at_interface(self):
- """Test that we can find the implementation for an objective C type when we stop in the interface"""
+ self.build()
self.common_setup()
line = line_number('Foo.m', '// Set breakpoint where Bar is an interface')
@@ -86,8 +42,12 @@
self.expect("frame variable foo->_bar->_hidden_ivar", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ["(NSString *)", "foo->_bar->_hidden_ivar = 0x"])
- def stop_at_implementation(self):
- """Test that we can find the implementation for an objective C type when we stop in the implementation"""
+ @skipUnlessDarwin
+ def test_frame_var_after_stop_at_implementation(self):
+ """Test that we can find the implementation for an objective C type"""
+ if self.getArchitecture() == 'i386':
+ self.skipTest("requires modern objc runtime")
+ self.build()
self.common_setup()
line = line_number('Bar.m', '// Set breakpoint where Bar is an implementation')
@@ -114,7 +74,14 @@
self.expect("frame variable foo->_bar->_hidden_ivar", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ["(NSString *)", "foo->_bar->_hidden_ivar = 0x"])
-
+ def common_setup(self):
+ exe = os.path.join(os.getcwd(), "a.out")
+ self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+ # Break inside the foo function which takes a bar_ptr argument.
+ line = line_number('main.m', '// Set breakpoint in main')
+ lldbutil.run_break_set_by_file_and_line (self, "main.m", line, num_expected_locations=1, loc_exact=True)
+
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
diff --git a/lldb/test/lang/objc/self/TestObjCSelf.py b/lldb/test/lang/objc/self/TestObjCSelf.py
index 1ed2283..239e2de 100644
--- a/lldb/test/lang/objc/self/TestObjCSelf.py
+++ b/lldb/test/lang/objc/self/TestObjCSelf.py
@@ -10,27 +10,9 @@
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
- @dsym_test
- def test_with_dsym_and_run_command(self):
+ def test_with_run_command(self):
"""Test that the appropriate member variables are available when stopped in Objective-C class and instance methods"""
- self.buildDsym()
- self.self_commands()
-
- @skipUnlessDarwin
- @dwarf_test
- def test_with_dwarf_and_run_command(self):
- """Test that the appropriate member variables are available when stopped in Objective-C class and instance methods"""
- self.buildDwarf()
- self.self_commands()
-
- def setUp(self):
- TestBase.setUp(self)
-
- def set_breakpoint(self, line):
- lldbutil.run_break_set_by_file_and_line (self, "main.m", line, num_expected_locations=1, loc_exact=True)
-
- def self_commands(self):
- """Test that the appropriate member variables are available when stopped in Objective-C class and instance methods"""
+ self.build()
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
self.set_breakpoint(line_number('main.m', '// breakpoint 1'))
@@ -50,6 +32,9 @@
self.expect("expression -- s_a",
startstr = "(int) $1 = 5")
+ def set_breakpoint(self, line):
+ lldbutil.run_break_set_by_file_and_line (self, "main.m", line, num_expected_locations=1, loc_exact=True)
+
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()