summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities/process_attach
diff options
context:
space:
mode:
authorEugene Zemtsov <ezemtsov@google.com>2017-09-13 02:44:24 +0000
committerEugene Zemtsov <ezemtsov@google.com>2017-09-13 02:44:24 +0000
commita2aa64760d79d32c35f60632d266f61e5a00ca7d (patch)
treef626173649ccdf8fab866c5670c03f3807848aae /lldb/packages/Python/lldbsuite/test/functionalities/process_attach
parent0a3bcebcc2bdfa5b22ffaa0358633e58a5ce893f (diff)
downloadbcm5719-llvm-a2aa64760d79d32c35f60632d266f61e5a00ca7d.tar.gz
bcm5719-llvm-a2aa64760d79d32c35f60632d266f61e5a00ca7d.zip
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
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/process_attach')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py9
1 files changed, 6 insertions, 3 deletions
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()
OpenPOWER on IntegriCloud