|
8 | 8 | from lldbsuite.test.decorators import * |
9 | 9 | from lldbsuite.test.lldbtest import * |
10 | 10 | from lldbsuite.test import lldbutil |
11 | | -from pathlib import Path |
12 | 11 |
|
13 | 12 |
|
14 | 13 | class ProcessLaunchTestCase(TestBase): |
@@ -207,59 +206,3 @@ def test_environment_with_special_char(self): |
207 | 206 | self.assertEqual(value, evil_var) |
208 | 207 | process.Continue() |
209 | 208 | self.assertState(process.GetState(), lldb.eStateExited, PROCESS_EXITED) |
210 | | - |
211 | | - def test_target_launch_working_dir_prop(self): |
212 | | - """Test that the setting `target.launch-working-dir` is correctly used when launching a process.""" |
213 | | - d = {"CXX_SOURCES": "print_cwd.cpp"} |
214 | | - self.build(dictionary=d) |
215 | | - self.setTearDownCleanup(d) |
216 | | - exe = self.getBuildArtifact("a.out") |
217 | | - self.runCmd("file " + exe) |
218 | | - |
219 | | - mywd = "my_working_dir" |
220 | | - out_file_name = "my_working_dir_test.out" |
221 | | - |
222 | | - my_working_dir_path = self.getBuildArtifact(mywd) |
223 | | - lldbutil.mkdir_p(my_working_dir_path) |
224 | | - out_file_path = os.path.join(my_working_dir_path, out_file_name) |
225 | | - another_working_dir_path = Path( |
226 | | - os.path.join(my_working_dir_path, "..") |
227 | | - ).resolve() |
228 | | - |
229 | | - # If -w is not passed to process launch, then the setting will be used. |
230 | | - self.runCmd( |
231 | | - f"settings set target.launch-working-dir {another_working_dir_path}" |
232 | | - ) |
233 | | - launch_command = f"process launch -o {out_file_path}" |
234 | | - |
235 | | - self.expect( |
236 | | - launch_command, |
237 | | - patterns=["Process .* launched: .*a.out"], |
238 | | - ) |
239 | | - |
240 | | - out = lldbutil.read_file_on_target(self, out_file_path) |
241 | | - |
242 | | - self.assertIn(f"stdout: {another_working_dir_path}", out) |
243 | | - |
244 | | - # If -w is passed to process launch, that value will be used instead of the setting. |
245 | | - launch_command = f"process launch -w {my_working_dir_path} -o {out_file_path}" |
246 | | - |
247 | | - self.expect( |
248 | | - launch_command, |
249 | | - patterns=["Process .* launched: .*a.out"], |
250 | | - ) |
251 | | - |
252 | | - out = lldbutil.read_file_on_target(self, out_file_path) |
253 | | - self.assertIn(f"stdout: {my_working_dir_path}", out) |
254 | | - |
255 | | - # If set to empty, then LLDB's cwd will be used to launch the process. |
256 | | - self.runCmd(f"settings set target.launch-working-dir ''") |
257 | | - launch_command = f"process launch -o {out_file_path}" |
258 | | - |
259 | | - self.expect( |
260 | | - launch_command, |
261 | | - patterns=["Process .* launched: .*a.out"], |
262 | | - ) |
263 | | - |
264 | | - out = lldbutil.read_file_on_target(self, out_file_path) |
265 | | - self.assertNotIn(f"stdout: {another_working_dir_path}", out) |
0 commit comments