class AttachDeniedTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
@skipIfWindows
@skipIfiOSSimulator
exe = self.getBuildArtifact(exe_name)
# Use a file as a synchronization point between test and inferior.
- pid_file_path = lldbutil.append_to_process_working_directory(
+ pid_file_path = lldbutil.append_to_process_working_directory(self,
"pid_file_%d" % (int(time.time())))
self.addTearDownHook(
lambda: self.run_platform_command(
class ChangeProcessGroupTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
def setUp(self):
# Call super's setUp().
exe = self.getBuildArtifact("a.out")
# Use a file as a synchronization point between test and inferior.
- pid_file_path = lldbutil.append_to_process_working_directory(
+ pid_file_path = lldbutil.append_to_process_working_directory(self,
"pid_file_%d" % (int(time.time())))
self.addTearDownHook(
lambda: self.run_platform_command(
def launch(self, executable, args):
if self._install_remote:
src_path = executable
- dst_path = lldbutil.append_to_process_working_directory(
- os.path.basename(executable))
+ dst_path = lldbutil.join_remote_paths(
+ lldb.remote_platform.GetWorkingDirectory(), os.path.basename(executable))
dst_file_spec = lldb.SBFileSpec(dst_path, False)
err = lldb.remote_platform.Install(
if lldb.remote_platform:
# We must set the remote install location if we want the shared library
# to get uploaded to the remote target
- remote_shlib_path = lldbutil.append_to_process_working_directory(
+ remote_shlib_path = lldbutil.append_to_process_working_directory(self,
os.path.basename(local_shlib_path))
shlib_module.SetRemoteInstallFileSpec(
lldb.SBFileSpec(remote_shlib_path, False))
return os.path.join(*paths).replace(os.path.sep, '/')
-def append_to_process_working_directory(*paths):
+def append_to_process_working_directory(test, *paths):
remote = lldb.remote_platform
if remote:
return join_remote_paths(remote.GetWorkingDirectory(), *paths)
- return os.path.join(os.getcwd(), *paths)
+ return os.path.join(test.getBuildDir(), *paths)
# ==================================================
# Utility functions to get the correct signal number
self.get_description()
@add_test_categories(['pyapi'])
- def test_launch_new_process_and_redirect_stdout(self):
- """Exercise SBTarget.Launch() API."""
- self.build()
- self.launch_new_process_and_redirect_stdout()
-
- @add_test_categories(['pyapi'])
def test_resolve_symbol_context_with_address(self):
"""Exercise SBTarget.ResolveSymbolContextForAddress() API."""
self.build()
substrs=['a.out', 'Target', 'Module', 'Breakpoint'])
@not_remote_testsuite_ready
- def launch_new_process_and_redirect_stdout(self):
+ @add_test_categories(['pyapi'])
+ @no_debug_info_test
+ def test_launch_new_process_and_redirect_stdout(self):
"""Exercise SBTaget.Launch() API with redirected stdout."""
+ self.build()
exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
# Now launch the process, do not stop at entry point, and redirect stdout to "stdout.txt" file.
# The inferior should run to completion after "process.Continue()"
# call.
- local_path = "stdout.txt"
+ local_path = self.getBuildArtifact("stdout.txt")
+ if os.path.exists(local_path):
+ os.remove(local_path)
+
if lldb.remote_platform:
- stdout_path = lldbutil.append_to_process_working_directory(
+ stdout_path = lldbutil.append_to_process_working_directory(self,
"lldb-stdout-redirect.txt")
else:
stdout_path = local_path
# The 'stdout.txt' file should now exist.
self.assertTrue(
- os.path.isfile("stdout.txt"),
+ os.path.isfile(local_path),
"'stdout.txt' exists due to redirected stdout via SBTarget.Launch() API.")
# Read the output file produced by running the program.
- with open('stdout.txt', 'r') as f:
+ with open(local_path, 'r') as f:
output = f.read()
- # Let's delete the 'stdout.txt' file as a cleanup step.
- try:
- os.remove("stdout.txt")
- pass
- except OSError:
- pass
-
self.expect(output, exe=False,
substrs=["a(1)", "b(2)", "a(3)"])
self.test_sequence.add_log_lines([
'read packet: $jModulesInfo:[{"file":"%s","triple":"%s"}]]#00' % (
- lldbutil.append_to_process_working_directory("a.out"),
+ lldbutil.append_to_process_working_directory(self, "a.out"),
info["triple"].decode('hex')),
{"direction": "send",
"regex": r'^\$\[{(.*)}\]\]#[0-9A-Fa-f]{2}',
inferior_exe_path = self.getBuildArtifact("a.out")
if lldb.remote_platform:
- remote_path = lldbutil.append_to_process_working_directory(
+ remote_path = lldbutil.append_to_process_working_directory(self,
os.path.basename(inferior_exe_path))
remote_file_spec = lldb.SBFileSpec(remote_path, False)
err = lldb.remote_platform.Install(lldb.SBFileSpec(
exe_path = self.getBuildArtifact("a.out")
if not lldb.remote_platform:
return [exe_path]
- remote_path = lldbutil.append_to_process_working_directory(
+ remote_path = lldbutil.append_to_process_working_directory(self,
os.path.basename(exe_path))
remote_file_spec = lldb.SBFileSpec(remote_path, False)
err = lldb.remote_platform.Install(lldb.SBFileSpec(exe_path, True),