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 = {
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'
OS_GUESS = GuessOS()
TOOLCHAIN_GUESS = GuessToolchain(OS_GUESS)
-ARCH_GUESS = GuessArchitecture()
+ARCH_GUESS = utils.GuessArchitecture()
WORDSIZE_GUESS = GuessWordsize()
--- /dev/null
+# 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
import test
import os
-from os.path import join, dirname
+from os.path import join, dirname, exists
import platform
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):
# ---------------
+ARCH_GUESS = utils.GuessArchitecture()
+
+
def BuildOptions():
result = optparse.OptionParser()
result.add_option("-m", "--mode", help="The test modes in which to run (comma-separated)",
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
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)
# (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 = []
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