[Lldb-commits] [lldb] r374234 - TestHelloWorld: Make compatible with remote testing

Frederic Riss via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 9 14:41:03 PDT 2019


Author: friss
Date: Wed Oct  9 14:41:02 2019
New Revision: 374234

URL: http://llvm.org/viewvc/llvm-project?rev=374234&view=rev
Log:
TestHelloWorld: Make compatible with remote testing

The synchronization token handling was not remote-friendly.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py?rev=374234&r1=374233&r2=374234&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py Wed Oct  9 14:41:02 2019
@@ -78,17 +78,19 @@ class HelloWorldTestCase(TestBase):
     @expectedFailureNetBSD
     def test_with_attach_to_process_with_id_api(self):
         """Create target, spawn a process, and attach to it with process id."""
-        exe = '%s_%d'%(self.getBuildArtifact(self.testMethodName), os.getpid())
+        exe = '%s_%d'%(self.testMethodName, os.getpid())
         d = {'EXE': exe}
         self.build(dictionary=d)
         self.setTearDownCleanup(dictionary=d)
-        target = self.dbg.CreateTarget(exe)
+        target = self.dbg.CreateTarget(self.getBuildArtifact(exe))
 
         # Spawn a new process
         token = exe+'.token'
-        if os.path.exists(token):
-            os.remove(token)
-        popen = self.spawnSubprocess(exe, [token])
+        if not lldb.remote_platform:
+            token = self.getBuildArtifact(token)
+            if os.path.exists(token):
+                os.remove(token)
+        popen = self.spawnSubprocess(self.getBuildArtifact(exe), [token])
         self.addTearDownHook(self.cleanupSubprocesses)
         lldbutil.wait_for_file_on_target(self, token)
 
@@ -110,17 +112,19 @@ class HelloWorldTestCase(TestBase):
     @expectedFailureNetBSD
     def test_with_attach_to_process_with_name_api(self):
         """Create target, spawn a process, and attach to it with process name."""
-        exe = '%s_%d'%(self.getBuildArtifact(self.testMethodName), os.getpid())
+        exe = '%s_%d'%(self.testMethodName, os.getpid())
         d = {'EXE': exe}
         self.build(dictionary=d)
         self.setTearDownCleanup(dictionary=d)
-        target = self.dbg.CreateTarget(exe)
+        target = self.dbg.CreateTarget(self.getBuildArtifact(exe))
 
         # Spawn a new process.
         token = exe+'.token'
-        if os.path.exists(token):
-            os.remove(token)
-        popen = self.spawnSubprocess(exe, [token])
+        if not lldb.remote_platform:
+            token = self.getBuildArtifact(token)
+            if os.path.exists(token):
+                os.remove(token)
+        popen = self.spawnSubprocess(self.getBuildArtifact(exe), [token])
         self.addTearDownHook(self.cleanupSubprocesses)
         lldbutil.wait_for_file_on_target(self, token)
 




More information about the lldb-commits mailing list