gvn review --project https://v8.googlecode.com/svn christian.pl...@gmail.com/fix-arm-sim-tests@105
Alternatively, to review the latest snapshot of this change
branch, run
gvn --project https://v8.googlecode.com/svn review christian.pl...@gmail.com/fix-arm-sim-tests
to review the following change:
*christian.pl...@gmail.com/fix-arm-sim-tests@105 | christian.pl...@gmail.com | 2008-09-02 16:11:38 +-100 (Tue, 02 Sep 2008)
Description:
- 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).
Affected Paths:
M //branches/bleeding_edge/SConstruct
A //branches/bleeding_edge/test/cctest/cctest.status
M //branches/bleeding_edge/test/cctest/testcfg.py
M //branches/bleeding_edge/tools/test.py
M //branches/bleeding_edge/tools/utils.py
This is a semiautomated message from "gvn mail". See
<http://code.google.com/p/gvn/> to learn more.
Index: SConstruct
===================================================================
--- SConstruct (^/branches/bleeding_edge/SConstruct@103)
+++ SConstruct (^/changes/christian.pl...@gmail.com/fix-arm-sim-tests/bleeding_edge/SConstruct@105)
@@ -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()
Index: test/cctest/cctest.status
===================================================================
--- test/cctest/cctest.status (added)
+++ test/cctest/cctest.status (^/changes/christian.pl...@gmail.com/fix-arm-sim-tests/bleeding_edge/test/cctest/cctest.status@105)
@@ -0,0 +1,34 @@
+# 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
Index: test/cctest/testcfg.py
===================================================================
--- test/cctest/testcfg.py (^/branches/bleeding_edge/test/cctest/testcfg.py@103)
+++ test/cctest/testcfg.py (^/changes/christian.pl...@gmail.com/fix-arm-sim-tests/bleeding_edge/test/cctest/testcfg.py@105)
@@ -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):
Index: tools/test.py
===================================================================
--- tools/test.py (^/branches/bleeding_edge/tools/test.py@103)
+++ tools/test.py (^/changes/christian.pl...@gmail.com/fix-arm-sim-tests/bleeding_edge/tools/test.py@105)
@@ -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)
Index: tools/utils.py
===================================================================
--- tools/utils.py (^/branches/bleeding_edge/tools/utils.py@103)
+++ tools/utils.py (^/changes/christian.pl...@gmail.com/fix-arm-sim-tests/bleeding_edge/tools/utils.py@105)
@@ -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