Skip to content

Commit

Permalink
Revert "[lldb/test] Try to fix TestSBModule failure"
Browse files Browse the repository at this point in the history
This reverts commit 3265164.
  • Loading branch information
medismailben committed Jan 27, 2022
1 parent 3265164 commit a6b5624
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Expand Up @@ -19,8 +19,6 @@ def setUp(self):

def tearDown(self):
TestBase.tearDown(self)
if "SKIP_SCRIPTED_PROCESS_LAUNCH" in os.environ:
del os.environ["SKIP_SCRIPTED_PROCESS_LAUNCH"]

def test_python_plugin_package(self):
"""Test that the lldb python module has a `plugins.scripted_process`
Expand Down Expand Up @@ -55,6 +53,10 @@ def test_invalid_scripted_register_context(self):
self.assertTrue(os.path.isfile(log_file))

os.environ['SKIP_SCRIPTED_PROCESS_LAUNCH'] = '1'
def cleanup():
del os.environ["SKIP_SCRIPTED_PROCESS_LAUNCH"]
self.addTearDownHook(cleanup)

scripted_process_example_relpath = 'invalid_scripted_process.py'
self.runCmd("command script import " + os.path.join(self.getSourceDir(),
scripted_process_example_relpath))
Expand Down Expand Up @@ -87,6 +89,10 @@ def test_scripted_process_and_scripted_thread(self):
self.assertTrue(target, VALID_TARGET)

os.environ['SKIP_SCRIPTED_PROCESS_LAUNCH'] = '1'
def cleanup():
del os.environ["SKIP_SCRIPTED_PROCESS_LAUNCH"]
self.addTearDownHook(cleanup)

scripted_process_example_relpath = 'dummy_scripted_process.py'
self.runCmd("command script import " + os.path.join(self.getSourceDir(),
scripted_process_example_relpath))
Expand Down Expand Up @@ -154,6 +160,10 @@ def test_launch_scripted_process_stack_frames(self):
self.assertTrue(error.Success(), "Reloading main module at offset 0 failed.")

os.environ['SKIP_SCRIPTED_PROCESS_LAUNCH'] = '1'
def cleanup():
del os.environ["SKIP_SCRIPTED_PROCESS_LAUNCH"]
self.addTearDownHook(cleanup)

scripted_process_example_relpath = 'stack_core_scripted_process.py'
self.runCmd("command script import " + os.path.join(self.getSourceDir(),
scripted_process_example_relpath))
Expand Down
4 changes: 2 additions & 2 deletions lldb/test/API/python_api/sbmodule/TestSBModule.py
Expand Up @@ -47,12 +47,12 @@ def test_module_is_file_backed(self):
error = lldb.SBError()
process = target.AttachToProcessWithID(self.dbg.GetListener(),
self.background_pid, error)
self.assertTrue(error.Success(), PROCESS_IS_VALID)
self.assertTrue(error.Success() and process, PROCESS_IS_VALID)
main_module = target.GetModuleAtIndex(0)
self.assertEqual(main_module.GetFileSpec().GetFilename(), "a.out")
self.assertFalse(main_module.IsFileBacked(),
"The module should not be backed by a file on disk.")

error = process.Detach()
error = process.Destroy()
self.assertTrue(error.Success(), "couldn't destroy process %s" % background_process.pid)

0 comments on commit a6b5624

Please sign in to comment.