From a2aa64760d79d32c35f60632d266f61e5a00ca7d Mon Sep 17 00:00:00 2001 From: Eugene Zemtsov Date: Wed, 13 Sep 2017 02:44:24 +0000 Subject: 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. llvm-svn: 313113 --- .../test/functionalities/process_attach/TestProcessAttach.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/process_attach') diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py b/lldb/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py index db01c00bbcd..f3910f12bab 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py @@ -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() -- cgit v1.2.3