Commit f5c6daf1 authored by Michal Majewski's avatar Michal Majewski Committed by Commit Bot

Deprecate multiple arch/mode options in the testrunner

Bug: v8:6917
Change-Id: I45a3a683388341d61989473ebd0b761a1ad8a9e3
Reviewed-on: https://chromium-review.googlesource.com/721659
Commit-Queue: Michał Majewski <majeski@google.com>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48676}
parent 098b5015
......@@ -3,7 +3,6 @@
# found in the LICENSE file.
import itertools
import json
import optparse
import os
......@@ -151,7 +150,6 @@ class BaseTestRunner(object):
self.outdir = None
self.arch = None
self.arch_and_mode = None
self.mode = None
self.auto_detect = None
......@@ -192,12 +190,9 @@ class BaseTestRunner(object):
help=("The architecture to run tests for, "
"'auto' or 'native' for auto-detect: %s" %
SUPPORTED_ARCHS))
parser.add_option("--arch-and-mode",
help="Architecture and mode in the format 'arch.mode'")
parser.add_option("-m", "--mode",
help="The test modes in which to run (comma-separated,"
" uppercase for ninja and buildbot builds): %s"
% MODES.keys())
help="The test mode in which to run (uppercase for ninja"
" and buildbot builds): %s" % MODES.keys())
def _add_parser_options(self, parser):
pass
......@@ -212,33 +207,28 @@ class BaseTestRunner(object):
self.auto_detect = self._read_build_config(outdir, options)
if not self.auto_detect:
self.arch = options.arch or 'ia32,x64,arm'
self.mode = options.mode or 'release,debug'
if any(map(lambda v: v and ',' in v,
[options.arch, options.mode])):
print 'Multiple arch/mode are deprecated'
raise TestRunnerError()
self.outdir = outdir
if options.arch_and_mode:
self.arch_and_mode = map(lambda am: am.split('.'),
options.arch_and_mode.split(','))
self.arch = ','.join(map(lambda am: am[0], self.arch_and_mode))
self.mode = ','.join(map(lambda am: am[1], self.arch_and_mode))
self.mode = self.mode.split(',')
for mode in self.mode:
if not self._buildbot_to_v8_mode(mode) in MODES:
print "Unknown mode %s" % mode
if not options.arch or not options.mode:
print('Autodetect mode is not available and therefore '
'--arch and --mode options are required')
raise TestRunnerError()
self.arch = options.arch
self.mode = options.mode
if not self._buildbot_to_v8_mode(self.mode) in MODES:
print "Unknown mode %s" % self.mode
raise TestRunnerError()
if self.arch in ["auto", "native"]:
self.arch = ARCH_GUESS
self.arch = self.arch.split(",")
for arch in self.arch:
if not arch in SUPPORTED_ARCHS:
print "Unknown architecture %s" % arch
raise TestRunnerError()
# Store the final configuration in arch_and_mode list. Don't overwrite
# predefined arch_and_mode since it is more expressive than arch and mode.
if not self.arch_and_mode:
self.arch_and_mode = itertools.product(self.arch, self.mode)
if not self.arch in SUPPORTED_ARCHS:
print "Unknown architecture %s" % self.arch
raise TestRunnerError()
def _get_gn_outdir(self):
gn_out_dir = os.path.join(BASE_DIR, DEFAULT_OUT_GN)
......@@ -258,7 +248,6 @@ class BaseTestRunner(object):
# Auto-detect test configurations based on the build (GN only).
# sets:
# - arch
# - arch_and_mode
# - mode
# - outdir
def _read_build_config(self, outdir, options):
......@@ -284,7 +273,6 @@ class BaseTestRunner(object):
# config.
# This ensures that we'll also take the build products from there.
self.outdir = os.path.dirname(build_config_path)
self.arch_and_mode = None
# In V8 land, GN's x86 is called ia32.
if build_config["v8_target_cpu"] == "x86":
......
......@@ -100,8 +100,6 @@ class StandardTestRunner(base_runner.BaseTestRunner):
except Exception:
pass
exit_code = 0
suite_paths = utils.GetSuitePaths(join(base_runner.BASE_DIR, "test"))
# Use default tests if no test configuration was provided at the cmd line.
......@@ -134,13 +132,10 @@ class StandardTestRunner(base_runner.BaseTestRunner):
for s in suites:
s.PrepareSources()
for (arch, mode) in self.arch_and_mode:
try:
code = self._execute(arch, mode, args, options, suites)
except KeyboardInterrupt:
return 2
exit_code = exit_code or code
return exit_code
try:
return self._execute(self.arch, self.mode, args, options, suites)
except KeyboardInterrupt:
return 2
def _add_parser_options(self, parser):
parser.add_option("--asan",
......
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