[Lldb-commits] [lldb] r313113 - Fix test_attach_to_process_from_different_dir_by_id test on Windows
Eugene Zemtsov via lldb-commits
lldb-commits at lists.llvm.org
Tue Sep 12 19:44:25 PDT 2017
Author: eugene
Date: Tue Sep 12 19:44:24 2017
New Revision: 313113
URL: http://llvm.org/viewvc/llvm-project?rev=313113&view=rev
Log:
Fix test_attach_to_process_from_different_dir_by_id test on Windows
On Windows a process can't delete its own current direcotry, that's why the test
needs to return to the original direcotry before removing newdir.
Modified:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py?rev=313113&r1=313112&r2=313113&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py Tue Sep 12 19:44:24 2017
@@ -46,15 +46,18 @@ class ProcessAttachTestCase(TestBase):
except OSError, e:
if e.errno != os.errno.EEXIST:
raise
- self.buildProgram('main.cpp',os.path.join(os.getcwd(),'newdir','proc_attach'))
- exe = os.path.join('.','newdir','proc_attach')
- self.addTearDownHook(lambda: shutil.rmtree(os.path.join(os.getcwd())))
+ testdir = os.getcwd()
+ newdir = os.path.join(testdir,'newdir')
+ exe = os.path.join(newdir, 'proc_attach')
+ self.buildProgram('main.cpp', exe)
+ self.addTearDownHook(lambda: shutil.rmtree(newdir))
# Spawn a new process
popen = self.spawnSubprocess(exe)
self.addTearDownHook(self.cleanupSubprocesses)
os.chdir('newdir')
+ self.addTearDownHook(lambda: os.chdir(testdir))
self.runCmd("process attach -p " + str(popen.pid))
target = self.dbg.GetSelectedTarget()
More information about the lldb-commits
mailing list