Skip to content
Permalink
Browse files

[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
  • Loading branch information...
mgorny committed Jul 30, 2019
1 parent 8e0cf07 commit 71e32aca46d122c801a7db58a0d84d387fa80b29
@@ -68,7 +68,7 @@ def test_cwd(self):
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 @@ def test_debuggerRoot(self):
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 @@ def test_sourcePath(self):
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 @@ def test_shellExpandArguments_enabled(self):
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 @@ def test_shellExpandArguments_disabled(self):
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],

0 comments on commit 71e32ac

Please sign in to comment.
You can’t perform that action at this time.