Commit c6feb506 authored by ulan@chromium.org's avatar ulan@chromium.org

Fix test runner for Android.

R=jkummerow@chromium.org

Review URL: https://chromiumcodereview.appspot.com/11193055

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12770 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 06a9f51c
......@@ -38,16 +38,20 @@ class CcTestSuite(testsuite.TestSuite):
def __init__(self, name, root):
super(CcTestSuite, self).__init__(name, root)
self.serdes_dir = normpath(join(root, "..", "..", "out", ".serdes"))
if exists(self.serdes_dir):
self.serdes_dir = os.path.normpath(
os.path.join(root, "..", "..", "out", ".serdes"))
if os.path.exists(self.serdes_dir):
shutil.rmtree(self.serdes_dir, True)
os.makedirs(self.serdes_dir)
def ListTests(self, context):
shell = join(context.shell_dir, self.shell())
if utils.IsWindows():
shell += '.exe'
output = commands.Execute([shell, '--list'])
shell = os.path.abspath(os.path.join(context.shell_dir, self.shell()))
output = commands.Execute([context.command_prefix,
shell,
'--list',
context.extra_flags])
if output.exit_code != 0:
print output.stdout
print output.stderr
......@@ -66,7 +70,7 @@ class CcTestSuite(testsuite.TestSuite):
def GetFlagsForTestCase(self, testcase, context):
testname = testcase.path.split(os.path.sep)[-1]
serialization_file = join(self.serdes_dir, "serdes_" + testname)
serialization_file = os.path.join(self.serdes_dir, "serdes_" + testname)
serialization_file += ''.join(testcase.flags).replace('-', '_')
return (testcase.flags + [testcase.path] + context.mode_flags +
["--testing_serialization_file=" + serialization_file])
......
......@@ -60,6 +60,13 @@ MODE_FLAGS = {
"--enable-slow-asserts", "--debug-code", "--verify-heap"],
"release" : ["--nobreak-on-abort", "--nodead-code-elimination"]}
SUPPORTED_ARCHS = ["android_arm",
"android_ia32",
"arm",
"ia32",
"mipsel",
"x64"]
def BuildOptions():
result = optparse.OptionParser()
......@@ -150,7 +157,7 @@ def ProcessOptions(options):
options.arch = ARCH_GUESS
options.arch = options.arch.split(",")
for arch in options.arch:
if not arch in ['ia32', 'x64', 'arm', 'mipsel']:
if not arch in SUPPORTED_ARCHS:
print "Unknown architecture %s" % arch
return False
......
......@@ -131,6 +131,7 @@ def CheckedUnlink(name):
def Execute(args, verbose=False, timeout=None):
args = [ c for c in args if c != "" ]
(fd_out, outname) = tempfile.mkstemp()
(fd_err, errname) = tempfile.mkstemp()
try:
......
......@@ -168,11 +168,10 @@ class Runner(object):
if utils.IsWindows():
shell += ".exe"
cmd = ([self.context.command_prefix] +
[os.path.join(self.context.shell_dir, shell)] +
[os.path.abspath(os.path.join(self.context.shell_dir, shell))] +
d8testflag +
test.suite.GetFlagsForTestCase(test, self.context) +
[self.context.extra_flags])
cmd = [ c for c in cmd if c != "" ]
return cmd
......
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