Replace sys.platform skips in tests with @skip decorators which check against remote platform.

Adds @skipIfPlatform and @skipUnlessPlatform decorators which will skip if /
unless the target platform is in the provided platform list.

Test Plan:
ninja check-lldb shows no regressions.
When running cross platform, tests which cannot run on the target platform are
skipped.

Differential Revision: http://reviews.llvm.org/D8665

llvm-svn: 233547
diff --git a/lldb/test/python_api/breakpoint/TestBreakpointAPI.py b/lldb/test/python_api/breakpoint/TestBreakpointAPI.py
index ed3402d..0a4e7fa 100644
--- a/lldb/test/python_api/breakpoint/TestBreakpointAPI.py
+++ b/lldb/test/python_api/breakpoint/TestBreakpointAPI.py
@@ -12,7 +12,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_breakpoint_is_valid_with_dsym(self):
diff --git a/lldb/test/python_api/class_members/TestSBTypeClassMembers.py b/lldb/test/python_api/class_members/TestSBTypeClassMembers.py
index 554cc31..c3af671 100644
--- a/lldb/test/python_api/class_members/TestSBTypeClassMembers.py
+++ b/lldb/test/python_api/class_members/TestSBTypeClassMembers.py
@@ -12,7 +12,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym(self):
@@ -22,7 +22,7 @@
         self.setTearDownCleanup(dictionary=d)
         self.type_api(self.exe_name)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dwarf_test
     def test_with_dwarf(self):
diff --git a/lldb/test/python_api/event/TestEvents.py b/lldb/test/python_api/event/TestEvents.py
index 62c1f50..d79ba33 100644
--- a/lldb/test/python_api/event/TestEvents.py
+++ b/lldb/test/python_api/event/TestEvents.py
@@ -12,7 +12,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_listen_for_and_print_event_with_dsym(self):
@@ -20,9 +20,7 @@
         self.buildDsym()
         self.do_listen_for_and_print_event()
 
-    @unittest2.skipUnless((sys.platform.startswith("darwin") or
-                           sys.platform.startswith("freebsd")),
-                          "requires Darwin or FreeBSD")
+    @skipUnlessPlatform(["darwin", "macosx", "freebsd"])
     @python_api_test
     @dwarf_test
     def test_listen_for_and_print_event_with_dwarf(self):
@@ -30,7 +28,7 @@
         self.buildDwarf()
         self.do_listen_for_and_print_event()
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_wait_for_event_with_dsym(self):
@@ -46,7 +44,7 @@
         self.buildDwarf()
         self.do_wait_for_event()
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_add_listener_to_broadcaster_with_dsym(self):
diff --git a/lldb/test/python_api/findvalue_duplist/TestSBFrameFindValue.py b/lldb/test/python_api/findvalue_duplist/TestSBFrameFindValue.py
index 6a3b2b0..41d782e 100644
--- a/lldb/test/python_api/findvalue_duplist/TestSBFrameFindValue.py
+++ b/lldb/test/python_api/findvalue_duplist/TestSBFrameFindValue.py
@@ -10,7 +10,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym_formatters_api(self):
diff --git a/lldb/test/python_api/formatters/TestFormattersSBAPI.py b/lldb/test/python_api/formatters/TestFormattersSBAPI.py
index 67aa639..c860473 100644
--- a/lldb/test/python_api/formatters/TestFormattersSBAPI.py
+++ b/lldb/test/python_api/formatters/TestFormattersSBAPI.py
@@ -10,7 +10,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym_formatters_api(self):
diff --git a/lldb/test/python_api/frame/TestFrames.py b/lldb/test/python_api/frame/TestFrames.py
index c820e1b..068aa4c 100644
--- a/lldb/test/python_api/frame/TestFrames.py
+++ b/lldb/test/python_api/frame/TestFrames.py
@@ -13,7 +13,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_get_arg_vals_for_call_stack_with_dsym(self):
diff --git a/lldb/test/python_api/frame/inlines/TestInlinedFrame.py b/lldb/test/python_api/frame/inlines/TestInlinedFrame.py
index 25e9b35..217b87e 100644
--- a/lldb/test/python_api/frame/inlines/TestInlinedFrame.py
+++ b/lldb/test/python_api/frame/inlines/TestInlinedFrame.py
@@ -12,7 +12,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_stop_at_outer_inline_with_dsym(self):
diff --git a/lldb/test/python_api/function_symbol/TestDisasmAPI.py b/lldb/test/python_api/function_symbol/TestDisasmAPI.py
index 6ec69ab..d7270ba 100644
--- a/lldb/test/python_api/function_symbol/TestDisasmAPI.py
+++ b/lldb/test/python_api/function_symbol/TestDisasmAPI.py
@@ -12,7 +12,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym(self):
diff --git a/lldb/test/python_api/function_symbol/TestSymbolAPI.py b/lldb/test/python_api/function_symbol/TestSymbolAPI.py
index dfb8fad..6a315f2 100644
--- a/lldb/test/python_api/function_symbol/TestSymbolAPI.py
+++ b/lldb/test/python_api/function_symbol/TestSymbolAPI.py
@@ -12,7 +12,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym(self):
diff --git a/lldb/test/python_api/hello_world/TestHelloWorld.py b/lldb/test/python_api/hello_world/TestHelloWorld.py
index cf24889..a94ceee 100644
--- a/lldb/test/python_api/hello_world/TestHelloWorld.py
+++ b/lldb/test/python_api/hello_world/TestHelloWorld.py
@@ -10,7 +10,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym_and_process_launch_api(self):
@@ -34,7 +34,7 @@
         self.hello_world_python()
 
     @not_remote_testsuite_ready
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym_and_attach_to_process_with_id_api(self):
@@ -59,7 +59,7 @@
         self.hello_world_attach_with_id_api()
 
     @not_remote_testsuite_ready
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym_and_attach_to_process_with_name_api(self):
diff --git a/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py b/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py
index 2eeb34f..c57535c 100644
--- a/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py
+++ b/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py
@@ -9,7 +9,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym_and_process_launch_api(self):
diff --git a/lldb/test/python_api/objc_type/TestObjCType.py b/lldb/test/python_api/objc_type/TestObjCType.py
index ff26ae8..ba3687a 100644
--- a/lldb/test/python_api/objc_type/TestObjCType.py
+++ b/lldb/test/python_api/objc_type/TestObjCType.py
@@ -12,7 +12,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym(self):
@@ -20,7 +20,7 @@
         self.buildDsym()
         self.objc_sbtype_test()
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dwarf_test
     def test_with_dwarf(self):
diff --git a/lldb/test/python_api/process/TestProcessAPI.py b/lldb/test/python_api/process/TestProcessAPI.py
index 6ce4d0b..6bc255a 100644
--- a/lldb/test/python_api/process/TestProcessAPI.py
+++ b/lldb/test/python_api/process/TestProcessAPI.py
@@ -12,7 +12,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_read_memory_with_dsym(self):
@@ -27,7 +27,7 @@
         self.buildDwarf()
         self.read_memory()
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_write_memory_with_dsym(self):
@@ -42,7 +42,7 @@
         self.buildDwarf()
         self.write_memory()
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_access_my_int_with_dsym(self):
diff --git a/lldb/test/python_api/process/io/TestProcessIO.py b/lldb/test/python_api/process/io/TestProcessIO.py
index 8181a94..66ac0bd 100644
--- a/lldb/test/python_api/process/io/TestProcessIO.py
+++ b/lldb/test/python_api/process/io/TestProcessIO.py
@@ -10,7 +10,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "dsym requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_stdin_by_api_with_dsym(self):
@@ -18,7 +18,7 @@
         self.buildDsym()
         self.do_stdin_by_api()
 
-    @unittest2.skipIf(sys.platform.startswith("win32"), "stdio manipulation unsupported on Windows")
+    @skipIfWindows # stdio manipulation unsupported on Windows
     @python_api_test
     @dwarf_test
     def test_stdin_by_api_with_dwarf(self):
@@ -26,7 +26,7 @@
         self.buildDwarf()
         self.do_stdin_by_api()
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "dsym requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_stdin_redirection_with_dsym(self):
@@ -34,7 +34,7 @@
         self.buildDsym()
         self.do_stdin_redirection()
 
-    @unittest2.skipIf(sys.platform.startswith("win32"), "stdio manipulation unsupported on Windows")
+    @skipIfWindows # stdio manipulation unsupported on Windows
     @python_api_test
     @dwarf_test
     def test_stdin_redirection_with_dwarf(self):
@@ -42,7 +42,7 @@
         self.buildDwarf()
         self.do_stdin_redirection()
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "dsym requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_stdout_redirection_with_dsym(self):
@@ -50,7 +50,7 @@
         self.buildDsym()
         self.do_stdout_redirection()
 
-    @unittest2.skipIf(sys.platform.startswith("win32"), "stdio manipulation unsupported on Windows")
+    @skipIfWindows # stdio manipulation unsupported on Windows
     @python_api_test
     @dwarf_test
     def test_stdout_redirection_with_dwarf(self):
@@ -58,7 +58,7 @@
         self.buildDwarf()
         self.do_stdout_redirection()
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "dsym requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_stderr_redirection_with_dsym(self):
@@ -66,7 +66,7 @@
         self.buildDsym()
         self.do_stderr_redirection()
 
-    @unittest2.skipIf(sys.platform.startswith("win32"), "stdio manipulation unsupported on Windows")
+    @skipIfWindows # stdio manipulation unsupported on Windows
     @python_api_test
     @dwarf_test
     def test_stderr_redirection_with_dwarf(self):
@@ -74,7 +74,7 @@
         self.buildDwarf()
         self.do_stderr_redirection()
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "dsym requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_stdout_stderr_redirection_with_dsym(self):
@@ -82,7 +82,7 @@
         self.buildDsym()
         self.do_stdout_stderr_redirection()
 
-    @unittest2.skipIf(sys.platform.startswith("win32"), "stdio manipulation unsupported on Windows")
+    @skipIfWindows # stdio manipulation unsupported on Windows
     @python_api_test
     @dwarf_test
     def test_stdout_stderr_redirection_with_dwarf(self):
diff --git a/lldb/test/python_api/rdar-12481949/Test-rdar-12481949.py b/lldb/test/python_api/rdar-12481949/Test-rdar-12481949.py
index 808e64b..4905785 100644
--- a/lldb/test/python_api/rdar-12481949/Test-rdar-12481949.py
+++ b/lldb/test/python_api/rdar-12481949/Test-rdar-12481949.py
@@ -13,7 +13,7 @@
     # test for rdar://problem/12481949
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @dsym_test
     def test_with_dsym_and_run_command(self):
         """Check that SBValue.GetValueAsSigned() does the right thing for a 32-bit -1."""
diff --git a/lldb/test/python_api/sbdata/TestSBData.py b/lldb/test/python_api/sbdata/TestSBData.py
index 82a7d05..4429da5 100644
--- a/lldb/test/python_api/sbdata/TestSBData.py
+++ b/lldb/test/python_api/sbdata/TestSBData.py
@@ -11,7 +11,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym_and_run_command(self):
diff --git a/lldb/test/python_api/sbvalue_persist/TestSBValuePersist.py b/lldb/test/python_api/sbvalue_persist/TestSBValuePersist.py
index d05274f..407d417 100644
--- a/lldb/test/python_api/sbvalue_persist/TestSBValuePersist.py
+++ b/lldb/test/python_api/sbvalue_persist/TestSBValuePersist.py
@@ -10,7 +10,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym(self):
diff --git a/lldb/test/python_api/section/TestSectionAPI.py b/lldb/test/python_api/section/TestSectionAPI.py
index de13717..6c7b4f5 100755
--- a/lldb/test/python_api/section/TestSectionAPI.py
+++ b/lldb/test/python_api/section/TestSectionAPI.py
@@ -9,7 +9,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_get_target_byte_size_with_dsym(self):
diff --git a/lldb/test/python_api/symbol-context/TestSymbolContext.py b/lldb/test/python_api/symbol-context/TestSymbolContext.py
index 88fc715..c7a49bb 100644
--- a/lldb/test/python_api/symbol-context/TestSymbolContext.py
+++ b/lldb/test/python_api/symbol-context/TestSymbolContext.py
@@ -12,7 +12,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym(self):
diff --git a/lldb/test/python_api/target/TestTargetAPI.py b/lldb/test/python_api/target/TestTargetAPI.py
index 37c0192..2494c0f 100644
--- a/lldb/test/python_api/target/TestTargetAPI.py
+++ b/lldb/test/python_api/target/TestTargetAPI.py
@@ -12,7 +12,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_find_global_variables_with_dsym(self):
@@ -38,7 +38,7 @@
         self.setTearDownCleanup(dictionary=d)
         self.find_global_variables('b.out')
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_find_functions_with_dsym(self):
@@ -57,7 +57,7 @@
         self.setTearDownCleanup(dictionary=d)
         self.find_functions('b.out')
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_get_description_with_dsym(self):
@@ -72,7 +72,7 @@
         self.buildDwarf()
         self.get_description()
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     @expectedFailureDarwin("llvm.org/pr20273")
@@ -89,7 +89,7 @@
         self.buildDwarf()
         self.launch_new_process_and_redirect_stdout()
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_resolve_symbol_context_with_address_with_dsym(self):
@@ -104,7 +104,7 @@
         self.buildDwarf()
         self.resolve_symbol_context_with_address()
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_get_platform_with_dsym(self):
@@ -125,7 +125,7 @@
         platform = target.platform
         self.assertTrue(platform, VALID_PLATFORM)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_get_data_byte_size_with_dsym(self):
@@ -144,7 +144,7 @@
         target = self.create_simple_target('b.out')
         self.assertEquals(target.data_byte_size, 1)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_get_code_byte_size_with_dsym(self):
@@ -163,7 +163,7 @@
         target = self.create_simple_target('b.out')
         self.assertEquals(target.code_byte_size, 1)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_resolve_file_address_with_dsym(self):
@@ -182,7 +182,7 @@
         target = self.create_simple_target('b.out')
         self.resolve_file_address(target)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_read_memory_with_dsym(self):
diff --git a/lldb/test/python_api/thread/TestThreadAPI.py b/lldb/test/python_api/thread/TestThreadAPI.py
index 875273a..cd82faa 100644
--- a/lldb/test/python_api/thread/TestThreadAPI.py
+++ b/lldb/test/python_api/thread/TestThreadAPI.py
@@ -12,7 +12,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_get_process_with_dsym(self):
@@ -27,7 +27,7 @@
         self.buildDwarf()
         self.get_process()
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_get_stop_description_with_dsym(self):
@@ -42,7 +42,7 @@
         self.buildDwarf()
         self.get_stop_description()
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_run_to_address_with_dsym(self):
@@ -63,7 +63,7 @@
         self.setTearDownCleanup(dictionary=d)
         self.run_to_address(self.exe_name)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_step_out_of_malloc_into_function_b_with_dsym(self):
@@ -86,7 +86,7 @@
         self.setTearDownCleanup(dictionary=d)
         self.step_out_of_malloc_into_function_b(self.exe_name)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_step_over_3_times_with_dsym(self):
diff --git a/lldb/test/python_api/type/TestTypeList.py b/lldb/test/python_api/type/TestTypeList.py
index 71d1f45..19f178e 100644
--- a/lldb/test/python_api/type/TestTypeList.py
+++ b/lldb/test/python_api/type/TestTypeList.py
@@ -12,7 +12,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym(self):
diff --git a/lldb/test/python_api/value/TestValueAPI.py b/lldb/test/python_api/value/TestValueAPI.py
index a170692..6023976 100644
--- a/lldb/test/python_api/value/TestValueAPI.py
+++ b/lldb/test/python_api/value/TestValueAPI.py
@@ -12,7 +12,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym(self):
diff --git a/lldb/test/python_api/value/change_values/TestChangeValueAPI.py b/lldb/test/python_api/value/change_values/TestChangeValueAPI.py
index 22aa49c..5e8e081 100644
--- a/lldb/test/python_api/value/change_values/TestChangeValueAPI.py
+++ b/lldb/test/python_api/value/change_values/TestChangeValueAPI.py
@@ -12,7 +12,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_change_value_with_dsym(self):
diff --git a/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py b/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py
index 68905f3..6a1224bc 100644
--- a/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py
+++ b/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py
@@ -13,7 +13,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym(self):
diff --git a/lldb/test/python_api/value_var_update/TestValueVarUpdate.py b/lldb/test/python_api/value_var_update/TestValueVarUpdate.py
index 3959823..5fb6893 100644
--- a/lldb/test/python_api/value_var_update/TestValueVarUpdate.py
+++ b/lldb/test/python_api/value_var_update/TestValueVarUpdate.py
@@ -10,7 +10,7 @@
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_with_dsym_and_process_launch_api(self):
diff --git a/lldb/test/python_api/watchpoint/TestSetWatchpoint.py b/lldb/test/python_api/watchpoint/TestSetWatchpoint.py
index f4dd7ab..8c567c1 100644
--- a/lldb/test/python_api/watchpoint/TestSetWatchpoint.py
+++ b/lldb/test/python_api/watchpoint/TestSetWatchpoint.py
@@ -20,7 +20,7 @@
         # Find the line number to break inside main().
         self.line = line_number(self.source, '// Set break point at this line.')
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_watch_val_with_dsym(self):
diff --git a/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py b/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
index 512f1c2..1412b9e 100644
--- a/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
+++ b/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
@@ -20,7 +20,7 @@
         # Find the line number to break inside main().
         self.line = line_number(self.source, '// Set break point at this line.')
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_set_watch_ignore_count_with_dsym(self):
diff --git a/lldb/test/python_api/watchpoint/TestWatchpointIter.py b/lldb/test/python_api/watchpoint/TestWatchpointIter.py
index 76514ee..592c040 100644
--- a/lldb/test/python_api/watchpoint/TestWatchpointIter.py
+++ b/lldb/test/python_api/watchpoint/TestWatchpointIter.py
@@ -20,7 +20,7 @@
         # Find the line number to break inside main().
         self.line = line_number(self.source, '// Set break point at this line.')
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_watch_iter_with_dsym(self):
diff --git a/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py b/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
index 3c164c5..ae48e84 100644
--- a/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
+++ b/lldb/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
@@ -25,7 +25,7 @@
         self.exe_name = self.testMethodName
         self.d = {'CXX_SOURCES': self.source, 'EXE': self.exe_name}
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @dsym_test
     def test_watchpoint_cond_api_with_dsym(self):
         """Test watchpoint condition API."""
diff --git a/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py b/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
index 98ff4a8..4a02179 100644
--- a/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
+++ b/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
@@ -22,7 +22,7 @@
         # This is for verifying that watch location works.
         self.violating_func = "do_bad_thing_with_location";
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_watch_location_with_dsym(self):
diff --git a/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py b/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
index 2b62e0e..83ac795 100644
--- a/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
+++ b/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
@@ -22,7 +22,7 @@
         # This is for verifying that watch location works.
         self.violating_func = "do_bad_thing_with_location";
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_watch_address_with_dsym(self):
@@ -38,7 +38,7 @@
         self.buildDwarf()
         self.do_set_watchaddress()
 
-    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
+    @skipUnlessDarwin
     @python_api_test
     @dsym_test
     def test_watch_address_with_invalid_watch_size_with_dsym(self):