tools/run-tests.py: shlex.split() the value of --command-prefix

BUG=171553

Review URL: https://codereview.chromium.org/12049034

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13469 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c00d4671
...@@ -47,10 +47,10 @@ class CcTestSuite(testsuite.TestSuite): ...@@ -47,10 +47,10 @@ class CcTestSuite(testsuite.TestSuite):
def ListTests(self, context): def ListTests(self, context):
shell = os.path.abspath(os.path.join(context.shell_dir, self.shell())) shell = os.path.abspath(os.path.join(context.shell_dir, self.shell()))
if utils.IsWindows(): if utils.IsWindows():
shell += '.exe' shell += ".exe"
output = commands.Execute([context.command_prefix, output = commands.Execute(context.command_prefix +
shell, [shell,
'--list', "--list",
context.extra_flags]) context.extra_flags])
if output.exit_code != 0: if output.exit_code != 0:
print output.stdout print output.stdout
......
...@@ -32,6 +32,7 @@ import multiprocessing ...@@ -32,6 +32,7 @@ import multiprocessing
import optparse import optparse
import os import os
from os.path import join from os.path import join
import shlex
import subprocess import subprocess
import sys import sys
import time import time
...@@ -176,6 +177,7 @@ def ProcessOptions(options): ...@@ -176,6 +177,7 @@ def ProcessOptions(options):
print("Specifying --command-prefix disables network distribution, " print("Specifying --command-prefix disables network distribution, "
"running tests locally.") "running tests locally.")
options.no_network = True options.no_network = True
options.command_prefix = shlex.split(options.command_prefix)
if options.j == 0: if options.j == 0:
options.j = multiprocessing.cpu_count() options.j = multiprocessing.cpu_count()
if options.no_stress: if options.no_stress:
...@@ -189,7 +191,7 @@ def ProcessOptions(options): ...@@ -189,7 +191,7 @@ def ProcessOptions(options):
if options.valgrind: if options.valgrind:
run_valgrind = os.path.join("tools", "run-valgrind.py") run_valgrind = os.path.join("tools", "run-valgrind.py")
# This is OK for distributed running, so we don't need to set no_network. # This is OK for distributed running, so we don't need to set no_network.
options.command_prefix = ("python -u " + run_valgrind + options.command_prefix = (["python", "-u", run_valgrind] +
options.command_prefix) options.command_prefix)
return True return True
......
...@@ -167,7 +167,7 @@ class Runner(object): ...@@ -167,7 +167,7 @@ class Runner(object):
d8testflag = ["--test"] d8testflag = ["--test"]
if utils.IsWindows(): if utils.IsWindows():
shell += ".exe" shell += ".exe"
cmd = ([self.context.command_prefix] + cmd = (self.context.command_prefix +
[os.path.abspath(os.path.join(self.context.shell_dir, shell))] + [os.path.abspath(os.path.join(self.context.shell_dir, shell))] +
d8testflag + d8testflag +
test.suite.GetFlagsForTestCase(test, self.context) + test.suite.GetFlagsForTestCase(test, self.context) +
......
...@@ -41,10 +41,10 @@ class Context(): ...@@ -41,10 +41,10 @@ class Context():
def Pack(self): def Pack(self):
return [self.arch, self.mode, self.mode_flags, self.timeout, self.isolates, return [self.arch, self.mode, self.mode_flags, self.timeout, self.isolates,
self.extra_flags] self.command_prefix, self.extra_flags]
@staticmethod @staticmethod
def Unpack(packed): def Unpack(packed):
# For the order of the fields, refer to Pack() above. # For the order of the fields, refer to Pack() above.
return Context(packed[0], packed[1], None, packed[2], False, return Context(packed[0], packed[1], None, packed[2], False,
packed[3], packed[4], "", packed[5]) packed[3], packed[4], packed[5], packed[6])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment