Update test status on Linux
authorDaniel Malea <daniel.malea@intel.com>
Fri, 23 Nov 2012 21:59:29 +0000 (21:59 +0000)
committerDaniel Malea <daniel.malea@intel.com>
Fri, 23 Nov 2012 21:59:29 +0000 (21:59 +0000)
- add decorators @expectedFailLinux and @skipOnLinux
- skip/mark xfail cases due to open bugzillas # 14323, 14416, 14423, 14424, 14425, 14426

Patch by Ashok Thirumurthi!

llvm-svn: 168529

31 files changed:
lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
lldb/test/functionalities/completion/TestCompletion.py
lldb/test/functionalities/load_unload/TestLoadUnload.py
lldb/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
lldb/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
lldb/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
lldb/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
lldb/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
lldb/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py
lldb/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
lldb/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
lldb/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
lldb/test/lang/objc/foundation/TestObjectDescriptionAPI.py
lldb/test/lang/objc/objc++/TestObjCXX.py
lldb/test/lang/objc/objc-checker/TestObjCCheckers.py
lldb/test/lang/objc/objc-class-method/TestObjCClassMethod.py
lldb/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
lldb/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
lldb/test/lang/objc/objc-property/TestObjCProperty.py
lldb/test/lang/objc/objc-static-method/TestObjCStaticMethod.py
lldb/test/lang/objc/objc-stepping/TestObjCStepping.py
lldb/test/lang/objc/self/TestObjCSelf.py
lldb/test/lldbtest.py
lldb/test/python_api/thread/TestThreadAPI.py
lldb/test/python_api/watchpoint/TestSetWatchpoint.py
lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
lldb/test/python_api/watchpoint/TestWatchpointIter.py
lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py

index 7e40148..bb0e177 100644 (file)
@@ -34,18 +34,21 @@ class BreakpointConditionsTestCase(TestBase):
         self.buildDsym()
         self.breakpoint_conditions_python()
 
+    @expectedFailureLinux # bugzilla 14426
     @dwarf_test
     def test_breakpoint_condition_with_dwarf_and_run_command(self):
         """Exercise breakpoint condition with 'breakpoint modify -c <expr> id'."""
         self.buildDwarf()
         self.breakpoint_conditions()
 
+    @expectedFailureLinux # bugzilla 14426
     @dwarf_test
     def test_breakpoint_condition_inline_with_dwarf_and_run_command(self):
         """Exercise breakpoint condition inline with 'breakpoint set'."""
         self.buildDwarf()
         self.breakpoint_conditions(inline=True)
 
+    @expectedFailureLinux # bugzilla 14426
     @python_api_test
     @dwarf_test
     def test_breakpoint_condition_with_dwarf_and_python_api(self):
index 2017a30..ca9e3a1 100644 (file)
@@ -29,6 +29,7 @@ class CommandLineCompletionTestCase(TestBase):
         """Test that 'de' completes to 'detach '."""
         self.complete_from_to('de', 'detach ')
 
+    @expectedFailureLinux # bugzilla 14425
     def test_process_attach_dash_dash_con(self):
         """Test that 'process attach --con' completes to 'process attach --continue '."""
         self.complete_from_to('process attach --con', 'process attach --continue ')
index 62dbd4d..ab4aa50 100644 (file)
@@ -22,6 +22,7 @@ class LoadUnloadTestCase(TestBase):
         self.line_d_function = line_number('d.c',
                                            '// Find this line number within d_dunction().')
 
+    @skipOnLinux # bugzilla 14424 - missing linux Makefiles/testcase support
     def test_modules_search_paths(self):
         """Test target modules list after loading a different copy of the library libd.dylib, and verifies that it works with 'target modules search-paths add'."""
 
@@ -75,7 +76,7 @@ class LoadUnloadTestCase(TestBase):
         self.expect("target modules list", "LLDB successfully locates the relocated dynamic library",
             substrs = [new_dylib])
 
-        
+    @skipOnLinux # bugzilla 14424 - missing linux Makefiles/testcase support
     def test_dyld_library_path(self):
         """Test DYLD_LIBRARY_PATH after moving libd.dylib, which defines d_function, somewhere else."""
 
@@ -130,6 +131,7 @@ class LoadUnloadTestCase(TestBase):
         self.expect("target modules list",
             substrs = [special_dir, os.path.basename(new_dylib)])
 
+    @skipOnLinux # bugzilla 14424 - missing linux Makefiles/testcase support
     def test_lldb_process_load_and_unload_commands(self):
         """Test that lldb process load/unload command work correctly."""
 
@@ -176,6 +178,7 @@ class LoadUnloadTestCase(TestBase):
 
         self.runCmd("process continue")
 
+    @skipOnLinux # bugzilla 14424 - missing linux Makefiles/testcase support
     def test_load_unload(self):
         """Test breakpoint by name works correctly with dlopen'ing."""
 
@@ -215,6 +218,7 @@ class LoadUnloadTestCase(TestBase):
         self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
             substrs = [' resolved, hit count = 2'])
 
+    @skipOnLinux # bugzilla 14424 - missing linux Makefiles/testcase support
     def test_step_over_load (self):
         """Test stepping over code that loads a shared library works correctly."""
 
index 1e0b93b..da734d1 100644 (file)
@@ -21,6 +21,7 @@ class HelloWatchLocationTestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.hello_watchlocation()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_hello_watchlocation_with_dwarf(self):
         """Test watching a location with '-x size' option."""
index d0233b3..8bd70bb 100644 (file)
@@ -19,6 +19,7 @@ class HelloWatchpointTestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.hello_watchpoint()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_hello_watchpoint_with_dwarf_using_watchpoint_set(self):
         """Test a simple sequence of watchpoint creation and watchpoint hit."""
index 2aef5de..48c8d5a 100644 (file)
@@ -21,6 +21,7 @@ class WatchpointForMultipleThreadsTestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.hello_multiple_threads()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchpoint_multiple_threads_with_dwarf(self):
         """Test that lldb watchpoint works for multiple threads."""
@@ -36,6 +37,7 @@ class WatchpointForMultipleThreadsTestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.hello_multiple_threads_wp_set_and_then_delete()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchpoint_multiple_threads_wp_set_and_then_delete_with_dwarf(self):
         """Test that lldb watchpoint works for multiple threads, and after the watchpoint is deleted, the watchpoint event should no longer fires."""
index 339e633..d8e5c86 100644 (file)
@@ -34,6 +34,7 @@ class WatchpointCommandsTestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.normal_read_write_watchpoint()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_rw_watchpoint_with_dwarf(self):
         """Test read_write watchpoint and expect to stop two times."""
@@ -49,6 +50,7 @@ class WatchpointCommandsTestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.delete_read_write_watchpoint()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_rw_watchpoint_delete_with_dwarf(self):
         """Test delete watchpoint and expect not to stop for watchpoint."""
@@ -64,6 +66,7 @@ class WatchpointCommandsTestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.ignore_read_write_watchpoint()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_rw_watchpoint_set_ignore_count_with_dwarf(self):
         """Test watchpoint ignore count and expect to not to stop at all."""
@@ -79,6 +82,7 @@ class WatchpointCommandsTestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.read_write_watchpoint_disable_after_first_stop()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_rw_disable_after_first_stop__with_dwarf(self):
         """Test read_write watchpoint but disable it after the first stop."""
@@ -94,6 +98,7 @@ class WatchpointCommandsTestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.read_write_watchpoint_disable_then_enable()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_rw_disable_then_enable_with_dwarf(self):
         """Test read_write watchpoint, disable initially, then enable it."""
index 543aad7..c7a4fc1 100644 (file)
@@ -33,6 +33,7 @@ class WatchpointLLDBCommandTestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.watchpoint_command()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchpoint_command_with_dwarf(self):
         """Test 'watchpoint command'."""
@@ -48,6 +49,7 @@ class WatchpointLLDBCommandTestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.watchpoint_command_can_disable_a_watchpoint()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchpoint_command_can_disable_a_watchpoint_with_dwarf(self):
         """Test that 'watchpoint command' action can disable a watchpoint after it is triggered."""
index 055697a..814330f 100644 (file)
@@ -33,6 +33,7 @@ class WatchpointPythonCommandTestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.watchpoint_command()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchpoint_command_with_dwarf(self):
         """Test 'watchpoint command'."""
index e6544d6..7964049 100644 (file)
@@ -33,6 +33,7 @@ class WatchpointConditionCmdTestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.watchpoint_condition()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchpoint_cond_with_dwarf(self):
         """Test watchpoint condition."""
index 2172c5f..10e8d75 100644 (file)
@@ -20,6 +20,7 @@ class WatchLocationUsingWatchpointSetTestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.watchlocation_using_watchpoint_set()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchlocation_with_dwarf_using_watchpoint_set(self):
         """Test watching a location with 'watchpoint set expression -w write -x size' option."""
index c294b54..5b3c9fe 100644 (file)
@@ -19,6 +19,7 @@ class CPPBreakpointTestCase(TestBase):
         self.buildDsym()
         self.cpp_exceptions()
 
+    @expectedFailureLinux # bugzilla 14423
     @dwarf_test
     def test_with_dwarf(self):
         """Test lldb exception breakpoint command for CPP."""
index 9371b0f..55ab980 100644 (file)
@@ -20,6 +20,7 @@ class TestObjCIvarsInBlocks(TestBase):
         self.buildDsym()
         self.ivars_in_blocks()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     # This test requires the 2.0 runtime, so it will fail on i386.
     @expectedFailurei386
index 77032a5..1c42553 100644 (file)
@@ -24,6 +24,7 @@ class ObjectDescriptionAPITestCase(TestBase):
         self.find_global_variables_then_object_description('a.out')
 
     # rdar://problem/10857337
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     @dwarf_test
     def test_find_global_variables_then_object_description_with_dwarf(self):
index 8efd5f5..484d729 100644 (file)
@@ -20,6 +20,7 @@ class ObjCXXTestCase(TestBase):
         self.buildDsym()
         self.do_testObjCXXClasses()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @dwarf_test
     def test_break_with_dwarf(self):
         """Test ivars of Objective-C++ classes"""
index 8a33e27..fd3d76c 100644 (file)
@@ -22,6 +22,7 @@ class ObjCCheckerTestCase(TestBase):
         self.buildDsym()
         self.do_test_checkers()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     @dwarf_test
     def test_objc_checker_with_dwarf(self):
index 8f05295..c158385 100644 (file)
@@ -20,6 +20,7 @@ class TestObjCClassMethod(TestBase):
         self.buildDsym()
         self.objc_class_method()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @expectedFailurei386
     @python_api_test
     @dwarf_test
index f9d6adb..40a1281 100644 (file)
@@ -23,6 +23,7 @@ class ObjCDynamicValueTestCase(TestBase):
         self.buildDsym()
         self.do_get_dynamic_vals()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     @dwarf_test
     def test_get_objc_dynamic_vals_with_dwarf(self):
index c67db68..b4d7137 100644 (file)
@@ -18,6 +18,7 @@ class TestObjCIvarOffsets(TestBase):
         self.buildDsym()
         self.objc_ivar_offsets()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     @dwarf_test
     def test_with_dwarf_and_python_api(self):
index eeda344..37249d5 100644 (file)
@@ -22,6 +22,7 @@ class ObjCPropertyTestCase(TestBase):
         self.buildDsym()
         self.do_test_properties()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     @dwarf_test
     def test_objc_properties_with_dwarf(self):
index afcd238..3196830 100644 (file)
@@ -19,6 +19,7 @@ class TestObjCStaticMethod(TestBase):
         self.buildDsym()
         self.objc_static_method()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     #<rdar://problem/9745789> "expression" can't call functions in class methods
     @dwarf_test
index 4a36564..e6376a3 100644 (file)
@@ -18,6 +18,7 @@ class TestObjCStepping(TestBase):
         self.buildDsym()
         self.objc_stepping()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     @dwarf_test
     def test_with_dwarf_and_python_api(self):
index 327c20a..e7733ab 100644 (file)
@@ -16,6 +16,7 @@ class ObjCSelfTestCase(TestBase):
         self.buildDsym()
         self.self_commands()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @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"""
index 5fa0d8c..64024d0 100644 (file)
@@ -410,6 +410,42 @@ def expectedFailurei386(func):
             raise case._UnexpectedSuccess
     return wrapper
 
+def expectedFailureLinux(func):
+    """Decorate the item as a Linux only expectedFailure."""
+    if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+        raise Exception("@expectedFailureLinux can only be used to decorate a test method")
+    @wraps(func)
+    def wrapper(*args, **kwargs):
+        from unittest2 import case
+        self = args[0]
+        platform = sys.platform
+        try:
+            func(*args, **kwargs)
+        except Exception:
+            if "linux" in platform:
+                raise case._ExpectedFailure(sys.exc_info())
+            else:
+                raise
+
+        if "linux" in platform:
+            raise case._UnexpectedSuccess
+    return wrapper
+
+def skipOnLinux(func):
+    """Decorate the item to skip tests that should be skipped on Linux."""
+    if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+        raise Exception("@skipOnLinux can only be used to decorate a test method")
+    @wraps(func)
+    def wrapper(*args, **kwargs):
+        from unittest2 import case
+        self = args[0]
+        platform = sys.platform
+        if "linux" in platform:
+            self.skipTest("skip on linux")
+        else:
+            func(self, *args, **kwargs)
+    return wrapper
+
 class Base(unittest2.TestCase):
     """
     Abstract base for performing lldb (see TestBase) or other generic tests (see
index 93bff1d..85cb615 100644 (file)
@@ -74,6 +74,7 @@ class ThreadAPITestCase(TestBase):
         self.setTearDownCleanup(dictionary=d)
         self.step_out_of_malloc_into_function_b(self.exe_name)
 
+    @expectedFailureLinux # bugzilla 14416
     @python_api_test
     @dwarf_test
     def test_step_out_of_malloc_into_function_b_with_dwarf(self):
index 124dec1..e52665b 100644 (file)
@@ -28,6 +28,7 @@ class SetWatchpointAPITestCase(TestBase):
         self.buildDsym()
         self.do_set_watchpoint()
 
+    @expectedFailureLinux # bugzilla 14416
     @python_api_test
     @dwarf_test
     def test_watch_val_with_dwarf(self):
index ffe7708..e369ef5 100644 (file)
@@ -28,6 +28,7 @@ class WatchpointIgnoreCountTestCase(TestBase):
         self.buildDsym()
         self.do_watchpoint_ignore_count()
 
+    @expectedFailureLinux # bugzilla 14416
     @python_api_test
     @dwarf_test
     def test_set_watch_ignore_count_with_dwarf(self):
index c6d3750..f44864a 100644 (file)
@@ -28,6 +28,7 @@ class WatchpointIteratorTestCase(TestBase):
         self.buildDsym()
         self.do_watchpoint_iter()
 
+    @expectedFailureLinux # bugzilla 14416
     @python_api_test
     @dwarf_test
     def test_watch_iter_with_dwarf(self):
index d3707ba..aac367a 100644 (file)
@@ -33,6 +33,7 @@ class WatchpointConditionAPITestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.watchpoint_condition_api()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchpoint_cond_api_with_dwarf(self):
         """Test watchpoint condition API."""
index 2310fdc..454d7b8 100644 (file)
@@ -30,6 +30,7 @@ class SetWatchlocationAPITestCase(TestBase):
         self.buildDsym()
         self.do_set_watchlocation()
 
+    @expectedFailureLinux # bugzilla 14416
     @python_api_test
     @dwarf_test
     def test_watch_location_with_dwarf(self):
index 407e791..fd0a1aa 100644 (file)
@@ -30,6 +30,7 @@ class TargetWatchAddressAPITestCase(TestBase):
         self.buildDsym()
         self.do_set_watchaddress()
 
+    @expectedFailureLinux # bugzilla 14416
     @python_api_test
     @dwarf_test
     def test_watch_address_with_dwarf(self):