Author: Jonas Devlieghere Date: 2020-08-05T15:27:34-07:00 New Revision: df46f174db5bbedb66d77041308d48e701c77e96
URL: https://github.com/llvm/llvm-project/commit/df46f174db5bbedb66d77041308d48e701c77e96 DIFF: https://github.com/llvm/llvm-project/commit/df46f174db5bbedb66d77041308d48e701c77e96.diff LOG: [lldb] Modify the `skipIfRemote` decorator so we can skip all PExpect tests. This patch modifies the skipIfRemote decorator so it can apply to a whole class, which allows us to skip all PExpect tests as a whole. Differential revision: https://reviews.llvm.org/D85365 Added: Modified: lldb/packages/Python/lldbsuite/test/decorators.py lldb/packages/Python/lldbsuite/test/lldbpexpect.py lldb/test/API/commands/expression/multiline-completion/TestMultilineCompletion.py lldb/test/API/commands/gui/basic/TestGuiBasic.py lldb/test/API/commands/gui/basicdebug/TestGuiBasicDebug.py lldb/test/API/commands/gui/breakpoints/TestGuiBreakpoints.py lldb/test/API/driver/batch_mode/TestBatchMode.py Removed: ################################################################################ diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py index 873952e4c91a..a472e1c4c52e 100644 --- a/lldb/packages/Python/lldbsuite/test/decorators.py +++ b/lldb/packages/Python/lldbsuite/test/decorators.py @@ -502,9 +502,7 @@ def is_out_of_tree_debugserver(): def skipIfRemote(func): """Decorate the item to skip tests if testing remotely.""" - def is_remote(): - return "skip on remote platform" if lldb.remote_platform else None - return skipTestIfFn(is_remote)(func) + return unittest2.skipIf(lldb.remote_platform, "skip on remote platform")(func) def skipIfNoSBHeaders(func): diff --git a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py index d599bc397622..86216ec034cd 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py +++ b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py @@ -11,6 +11,7 @@ import lldb from .lldbtest import * from . import lldbutil +from lldbsuite.test.decorators import * if sys.platform.startswith('win32'): # llvm.org/pr22274: need a pexpect replacement for windows @@ -19,6 +20,7 @@ class PExpectTest(object): else: import pexpect + @skipIfRemote class PExpectTest(TestBase): NO_DEBUG_INFO_TESTCASE = True diff --git a/lldb/test/API/commands/expression/multiline-completion/TestMultilineCompletion.py b/lldb/test/API/commands/expression/multiline-completion/TestMultilineCompletion.py index 9b2b71230e52..e4935d0e2b84 100644 --- a/lldb/test/API/commands/expression/multiline-completion/TestMultilineCompletion.py +++ b/lldb/test/API/commands/expression/multiline-completion/TestMultilineCompletion.py @@ -14,7 +14,6 @@ class MultilineCompletionTest(PExpectTest): # PExpect uses many timeouts internally and doesn't play well # under ASAN on a loaded machine.. @skipIfAsan - @skipIfRemote # test is written to explicitly "run" the binary @skipIfEditlineSupportMissing def test_basic_completion(self): """Test that we can complete a simple multiline expression""" diff --git a/lldb/test/API/commands/gui/basic/TestGuiBasic.py b/lldb/test/API/commands/gui/basic/TestGuiBasic.py index 2dcc7d08e6eb..d501b266cc12 100644 --- a/lldb/test/API/commands/gui/basic/TestGuiBasic.py +++ b/lldb/test/API/commands/gui/basic/TestGuiBasic.py @@ -15,7 +15,6 @@ class BasicGuiCommandTest(PExpectTest): # under ASAN on a loaded machine.. @skipIfAsan @skipIfCursesSupportMissing - @skipIfRemote # "run" command will not work correctly for remote debug def test_gui(self): self.build() diff --git a/lldb/test/API/commands/gui/basicdebug/TestGuiBasicDebug.py b/lldb/test/API/commands/gui/basicdebug/TestGuiBasicDebug.py index 5c3d0d7369b4..ed5daf57a444 100644 --- a/lldb/test/API/commands/gui/basicdebug/TestGuiBasicDebug.py +++ b/lldb/test/API/commands/gui/basicdebug/TestGuiBasicDebug.py @@ -15,7 +15,6 @@ class TestGuiBasicDebugCommandTest(PExpectTest): # under ASAN on a loaded machine.. @skipIfAsan @skipIfCursesSupportMissing - @skipIfRemote # "run" command will not work correctly for remote debug @expectedFailureAll(archs=["aarch64"], oslist=["linux"]) def test_gui(self): self.build() diff --git a/lldb/test/API/commands/gui/breakpoints/TestGuiBreakpoints.py b/lldb/test/API/commands/gui/breakpoints/TestGuiBreakpoints.py index 13f5e1380a74..3d075c013262 100644 --- a/lldb/test/API/commands/gui/breakpoints/TestGuiBreakpoints.py +++ b/lldb/test/API/commands/gui/breakpoints/TestGuiBreakpoints.py @@ -15,7 +15,6 @@ class TestGuiBasicDebugCommandTest(PExpectTest): # under ASAN on a loaded machine.. @skipIfAsan @skipIfCursesSupportMissing - @skipIfRemote # "run" command will not work correctly for remote debug def test_gui(self): self.build() diff --git a/lldb/test/API/driver/batch_mode/TestBatchMode.py b/lldb/test/API/driver/batch_mode/TestBatchMode.py index 9639c707a25a..df6cc87d3c34 100644 --- a/lldb/test/API/driver/batch_mode/TestBatchMode.py +++ b/lldb/test/API/driver/batch_mode/TestBatchMode.py @@ -16,7 +16,6 @@ class DriverBatchModeTest(PExpectTest): mydir = TestBase.compute_mydir(__file__) source = 'main.c' - @skipIfRemote # test not remote-ready llvm.org/pr24813 @expectedFlakeyFreeBSD("llvm.org/pr25172 fails rarely on the buildbot") def test_batch_mode_run_crash(self): """Test that the lldb driver's batch mode works correctly.""" @@ -47,7 +46,6 @@ def test_batch_mode_run_crash(self): self.expect_prompt() self.expect("frame variable touch_me_not", substrs='(char *) touch_me_not') - @skipIfRemote # test not remote-ready llvm.org/pr24813 @expectedFlakeyFreeBSD("llvm.org/pr25172 fails rarely on the buildbot") def test_batch_mode_run_exit(self): """Test that the lldb driver's batch mode works correctly.""" @@ -77,7 +75,6 @@ def test_batch_mode_run_exit(self): import pexpect child.expect(pexpect.EOF) - @skipIfRemote @expectedFlakeyFreeBSD("llvm.org/pr25172 fails rarely on the buildbot") def test_batch_mode_launch_stop_at_entry(self): """Test that the lldb driver's batch mode works correctly for process launch.""" @@ -101,7 +98,7 @@ def test_batch_mode_launch_stop_at_entry(self): child.expect_exact("continue") # The App should have not have crashed: child.expect_exact("Got there on time and it did not crash.") - + # Then lldb should exit. child.expect_exact("exited") import pexpect @@ -112,7 +109,6 @@ def closeVictim(self): self.victim.close() self.victim = None - @skipIfRemote # test not remote-ready llvm.org/pr24813 @expectedFlakeyFreeBSD("llvm.org/pr25172 fails rarely on the buildbot") @expectedFailureNetBSD def test_batch_mode_attach_exit(self): _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits