Fix win32/mingw bug running commands with command-template: needed to escape backslashes before calling shlex.split().
This commit is contained in:
@@ -142,6 +142,8 @@ class regression_test_task(Task.TaskBase):
|
||||
raise
|
||||
os.makedirs(trace_output_path)
|
||||
# run it
|
||||
#print "self.run_reference_test:(%r, %r, %r, %r, %r)" \
|
||||
# % (reference_traces_path, trace_output_path, program, arguments, is_pyscript)
|
||||
result = self.run_reference_test(reference_traces_path, trace_output_path, program, arguments, is_pyscript)
|
||||
if result == 0:
|
||||
print "PASS " + self.test_name
|
||||
|
||||
@@ -159,6 +159,7 @@ def get_run_program(program_string, command_template=None):
|
||||
|
||||
if command_template in (None, '%s'):
|
||||
argv = shlex.split(program_string)
|
||||
#print "%r ==shlex.split==> %r" % (program_string, argv)
|
||||
program_name = argv[0]
|
||||
|
||||
try:
|
||||
@@ -188,7 +189,9 @@ def get_run_program(program_string, command_template=None):
|
||||
#except AttributeError:
|
||||
# raise Utils.WafError("%s does not appear to be a program" % (program_name,))
|
||||
|
||||
execvec = shlex.split(command_template % (program_node.abspath(env),))
|
||||
tmpl = command_template % (program_node.abspath(env),)
|
||||
execvec = shlex.split(tmpl.replace('\\', '\\\\'))
|
||||
#print "%r ==shlex.split==> %r" % (command_template % (program_node.abspath(env),), execvec)
|
||||
return program_name, execvec
|
||||
|
||||
def run_program(program_string, env, command_template=None, cwd=None):
|
||||
|
||||
Reference in New Issue
Block a user