[lldb] [test/lldb-vscode] Use os.path.dirname() [NFC]

Replace os.path.split()[0] with os.path.dirname().  Suggested by Pavel
Labath in D65432.

llvm-svn: 367290
This commit is contained in:
Michal Gorny 2019-07-30 07:47:16 +00:00
parent 8e0cf076ac
commit 71e32aca46
1 changed files with 5 additions and 5 deletions

View File

@ -68,7 +68,7 @@ class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase):
directory.
'''
program = self.getBuildArtifact("a.out")
program_parent_dir = os.path.split(os.path.split(program)[0])[0]
program_parent_dir = os.path.dirname(os.path.dirname(program))
self.build_and_launch(program,
cwd=program_parent_dir)
self.continue_to_exit()
@ -96,7 +96,7 @@ class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase):
the lldb-vscode debug adaptor.
'''
program = self.getBuildArtifact("a.out")
program_parent_dir = os.path.split(os.path.split(program)[0])[0]
program_parent_dir = os.path.dirname(os.path.dirname(program))
commands = ['platform shell echo cwd = $PWD']
self.build_and_launch(program,
debuggerRoot=program_parent_dir,
@ -124,7 +124,7 @@ class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase):
Tests the "sourcePath" will set the target.source-map.
'''
program = self.getBuildArtifact("a.out")
program_dir = os.path.split(program)[0]
program_dir = os.path.dirname(program)
self.build_and_launch(program,
sourcePath=program_dir)
output = self.get_console()
@ -170,7 +170,7 @@ class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase):
enabled.
'''
program = self.getBuildArtifact("a.out")
program_dir = os.path.split(program)[0]
program_dir = os.path.dirname(program)
glob = os.path.join(program_dir, '*.out')
self.build_and_launch(program, args=[glob], shellExpandArguments=True)
self.continue_to_exit()
@ -195,7 +195,7 @@ class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase):
disabled.
'''
program = self.getBuildArtifact("a.out")
program_dir = os.path.split(program)[0]
program_dir = os.path.dirname(program)
glob = os.path.join(program_dir, '*.out')
self.build_and_launch(program,
args=[glob],