From 1ecc507e2a5f004ef7b0a6d39708bec58f09012e Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Wed, 21 Aug 2019 00:27:30 +0000 Subject: Update a few tests that may change the platform to save & restore the platform in the setUp/tearDown methods. I want to migrate the re-instatement of the correct plaform to the setUp base method but haven't had time to look at that yet, so I want to land this handful of fixes until I get to it. Differential revision: https://reviews.llvm.org/D66331 llvm-svn: 369484 --- .../functionalities/postmortem/elf-core/gcore/TestGCore.py | 9 +++++++-- .../postmortem/elf-core/thread_crash/TestLinuxCoreThreads.py | 10 ++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/postmortem') diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/gcore/TestGCore.py b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/gcore/TestGCore.py index 1cfdc85c409..e69a4b5e359 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/gcore/TestGCore.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/gcore/TestGCore.py @@ -15,7 +15,13 @@ class GCoreTestCase(TestBase): NO_DEBUG_INFO_TESTCASE = True mydir = TestBase.compute_mydir(__file__) - _initial_platform = lldb.DBG.GetSelectedPlatform() + def setUp(self): + super(GCoreTestCase, self).setUp() + self._initial_platform = lldb.DBG.GetSelectedPlatform() + + def tearDown(self): + lldb.DBG.SetSelectedPlatform(self._initial_platform) + super(GCoreTestCase, self).tearDown() _i386_pid = 5586 _x86_64_pid = 5669 @@ -47,4 +53,3 @@ class GCoreTestCase(TestBase): self.assertEqual(signal, 19) self.dbg.DeleteTarget(target) - lldb.DBG.SetSelectedPlatform(self._initial_platform) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/thread_crash/TestLinuxCoreThreads.py b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/thread_crash/TestLinuxCoreThreads.py index 4de7a24bb22..b167b3fdf3b 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/thread_crash/TestLinuxCoreThreads.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/thread_crash/TestLinuxCoreThreads.py @@ -15,7 +15,14 @@ class LinuxCoreThreadsTestCase(TestBase): NO_DEBUG_INFO_TESTCASE = True mydir = TestBase.compute_mydir(__file__) - _initial_platform = lldb.DBG.GetSelectedPlatform() + + def setUp(self): + super(LinuxCoreThreadsTestCase, self).setUp() + self._initial_platform = lldb.DBG.GetSelectedPlatform() + + def tearDown(self): + lldb.DBG.SetSelectedPlatform(self._initial_platform) + super(LinuxCoreThreadsTestCase, self).tearDown() _i386_pid = 5193 _x86_64_pid = 5222 @@ -56,4 +63,3 @@ class LinuxCoreThreadsTestCase(TestBase): self.assertEqual(signal, 0) self.dbg.DeleteTarget(target) - lldb.DBG.SetSelectedPlatform(self._initial_platform) -- cgit v1.2.3