- Added test status spec to cctests to make arm simulator tests run.

- Added test script option to override platform guess (again, to be
  able to run arm sim tests on intel).



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@107 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 08bfd16e
......@@ -32,7 +32,7 @@ import os
from os.path import join, dirname, abspath
root_dir = dirname(File('SConstruct').rfile().abspath)
sys.path.append(join(root_dir, 'tools'))
import js2c
import js2c, utils
LIBRARY_FLAGS = {
......@@ -223,16 +223,6 @@ def GuessOS():
return None
def GuessArchitecture():
id = platform.machine()
if id.startswith('arm'):
return 'arm'
elif (not id) or (not re.match('(x|i[3-6])86', id) is None):
return 'ia32'
else:
return None
def GuessWordsize():
if '64' in platform.machine():
return '64'
......@@ -252,7 +242,7 @@ def GuessToolchain(os):
OS_GUESS = GuessOS()
TOOLCHAIN_GUESS = GuessToolchain(OS_GUESS)
ARCH_GUESS = GuessArchitecture()
ARCH_GUESS = utils.GuessArchitecture()
WORDSIZE_GUESS = GuessWordsize()
......
# Copyright 2008 Google Inc. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
prefix cctest
[ $arch == arm ]
test-debug: SKIP
test-serialize: SKIP
test-api: SKIP
......@@ -27,7 +27,7 @@
import test
import os
from os.path import join, dirname
from os.path import join, dirname, exists
import platform
......@@ -78,6 +78,11 @@ class CcTestConfiguration(test.TestConfiguration):
if self.Contains(path, full_path):
result.append(CcTestCase(full_path, executable, mode, raw_test, self.context))
return result
def GetTestStatus(self, sections, defs):
status_file = join(self.root, 'cctest.status')
if exists(status_file):
test.ReadConfigurationInto(status_file, sections, defs)
def GetConfiguration(context, root):
......
......@@ -921,6 +921,9 @@ def ReadConfigurationInto(path, sections, defs):
# ---------------
ARCH_GUESS = utils.GuessArchitecture()
def BuildOptions():
result = optparse.OptionParser()
result.add_option("-m", "--mode", help="The test modes in which to run (comma-separated)",
......@@ -940,6 +943,8 @@ def BuildOptions():
default=[], action="append")
result.add_option("-t", "--timeout", help="Timeout in seconds",
default=60, type="int")
result.add_option("--arch", help='The architecture to run tests for',
default=ARCH_GUESS)
return result
......@@ -1050,7 +1055,8 @@ def Main():
for mode in options.mode:
env = {
'mode': mode,
'system': platform.system().lower()
'system': platform.system().lower(),
'arch': options.arch
}
test_list = root.ListTests([], path, context, mode)
(cases, unused_rules) = config.ClassifyTests(test_list, env)
......
......@@ -25,6 +25,11 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import platform
import re
# Reads a .list file into an array of strings
def ReadLinesFrom(name):
list = []
......@@ -36,3 +41,13 @@ def ReadLinesFrom(name):
continue
list.append(line)
return list
def GuessArchitecture():
id = platform.machine()
if id.startswith('arm'):
return 'arm'
elif (not id) or (not re.match('(x|i[3-6])86', id) is None):
return 'ia32'
else:
return None
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