Skip to content

Commit ffb26d9

Browse files
committed
TestHelloWorld: Make compatible with remote testing
The synchronization token handling was not remote-friendly. llvm-svn: 374234
1 parent 09dcfe6 commit ffb26d9

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

lldb/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,19 @@ def test_with_process_launch_api(self):
7878
@expectedFailureNetBSD
7979
def test_with_attach_to_process_with_id_api(self):
8080
"""Create target, spawn a process, and attach to it with process id."""
81-
exe = '%s_%d'%(self.getBuildArtifact(self.testMethodName), os.getpid())
81+
exe = '%s_%d'%(self.testMethodName, os.getpid())
8282
d = {'EXE': exe}
8383
self.build(dictionary=d)
8484
self.setTearDownCleanup(dictionary=d)
85-
target = self.dbg.CreateTarget(exe)
85+
target = self.dbg.CreateTarget(self.getBuildArtifact(exe))
8686

8787
# Spawn a new process
8888
token = exe+'.token'
89-
if os.path.exists(token):
90-
os.remove(token)
91-
popen = self.spawnSubprocess(exe, [token])
89+
if not lldb.remote_platform:
90+
token = self.getBuildArtifact(token)
91+
if os.path.exists(token):
92+
os.remove(token)
93+
popen = self.spawnSubprocess(self.getBuildArtifact(exe), [token])
9294
self.addTearDownHook(self.cleanupSubprocesses)
9395
lldbutil.wait_for_file_on_target(self, token)
9496

@@ -110,17 +112,19 @@ def test_with_attach_to_process_with_id_api(self):
110112
@expectedFailureNetBSD
111113
def test_with_attach_to_process_with_name_api(self):
112114
"""Create target, spawn a process, and attach to it with process name."""
113-
exe = '%s_%d'%(self.getBuildArtifact(self.testMethodName), os.getpid())
115+
exe = '%s_%d'%(self.testMethodName, os.getpid())
114116
d = {'EXE': exe}
115117
self.build(dictionary=d)
116118
self.setTearDownCleanup(dictionary=d)
117-
target = self.dbg.CreateTarget(exe)
119+
target = self.dbg.CreateTarget(self.getBuildArtifact(exe))
118120

119121
# Spawn a new process.
120122
token = exe+'.token'
121-
if os.path.exists(token):
122-
os.remove(token)
123-
popen = self.spawnSubprocess(exe, [token])
123+
if not lldb.remote_platform:
124+
token = self.getBuildArtifact(token)
125+
if os.path.exists(token):
126+
os.remove(token)
127+
popen = self.spawnSubprocess(self.getBuildArtifact(exe), [token])
124128
self.addTearDownHook(self.cleanupSubprocesses)
125129
lldbutil.wait_for_file_on_target(self, token)
126130

0 commit comments

Comments
 (0)