Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dotest] Use subprocess.call to forward arguments in wrapper
As suggested by Pavel on lldb-commits. Originally I picked os.system because it was so much more simple than the subprocess module, but that no longer holds true after yesterday's hack in r328020. This is what it should've been in the first place. Differential revision: https://reviews.llvm.org/D44728 llvm-svn: 328089
- Loading branch information
1 parent
03a77e9
commit ecc8aee
Showing
2 changed files
with
11 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
#!/usr/bin/env python | ||
import subprocess | ||
import sys | ||
import os | ||
|
||
dotest_path = '@LLDB_SOURCE_DIR@/test/dotest.py' | ||
dotest_args = '@LLDB_DOTEST_ARGS_STR@' | ||
dotest_args_str = '@LLDB_DOTEST_ARGS@' | ||
|
||
if __name__ == '__main__': | ||
# Wrap arguments in single quotes. This is necessary because we want to | ||
# forward the arguments and otherwise we might split up arguments that were | ||
# originally wrapped in single quotes. | ||
wrapper_args = list("'" + i + "'" for i in sys.argv[1:]) | ||
# FIXME: It would be nice if we can mimic the approach taken by llvm-lit | ||
# and pass a python configuration straight to dotest, rather than going | ||
# through the operating system. | ||
command = '{} -q {} {}'.format(dotest_path, dotest_args, | ||
' '.join(wrapper_args)) | ||
os.system(command) | ||
wrapper_args = sys.argv[1:] | ||
dotest_args = dotest_args_str.split(';') | ||
# Build dotest.py command. | ||
cmd = [dotest_path, '-q'] | ||
cmd.extend(dotest_args) | ||
cmd.extend(wrapper_args) | ||
# Invoke dotest.py | ||
subprocess.call(cmd) |