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 @@ ...@@ -3,7 +3,6 @@
# found in the LICENSE file. # found in the LICENSE file.
import itertools
import json import json
import optparse import optparse
import os import os
...@@ -151,7 +150,6 @@ class BaseTestRunner(object): ...@@ -151,7 +150,6 @@ class BaseTestRunner(object):
self.outdir = None self.outdir = None
self.arch = None self.arch = None
self.arch_and_mode = None
self.mode = None self.mode = None
self.auto_detect = None self.auto_detect = None
...@@ -192,12 +190,9 @@ class BaseTestRunner(object): ...@@ -192,12 +190,9 @@ class BaseTestRunner(object):
help=("The architecture to run tests for, " help=("The architecture to run tests for, "
"'auto' or 'native' for auto-detect: %s" % "'auto' or 'native' for auto-detect: %s" %
SUPPORTED_ARCHS)) SUPPORTED_ARCHS))
parser.add_option("--arch-and-mode",
help="Architecture and mode in the format 'arch.mode'")
parser.add_option("-m", "--mode", parser.add_option("-m", "--mode",
help="The test modes in which to run (comma-separated," help="The test mode in which to run (uppercase for ninja"
" uppercase for ninja and buildbot builds): %s" " and buildbot builds): %s" % MODES.keys())
% MODES.keys())
def _add_parser_options(self, parser): def _add_parser_options(self, parser):
pass pass
...@@ -212,33 +207,28 @@ class BaseTestRunner(object): ...@@ -212,33 +207,28 @@ class BaseTestRunner(object):
self.auto_detect = self._read_build_config(outdir, options) self.auto_detect = self._read_build_config(outdir, options)
if not self.auto_detect: if not self.auto_detect:
self.arch = options.arch or 'ia32,x64,arm' if any(map(lambda v: v and ',' in v,
self.mode = options.mode or 'release,debug' [options.arch, options.mode])):
print 'Multiple arch/mode are deprecated'
raise TestRunnerError()
self.outdir = outdir self.outdir = outdir
if options.arch_and_mode: if not options.arch or not options.mode:
self.arch_and_mode = map(lambda am: am.split('.'), print('Autodetect mode is not available and therefore '
options.arch_and_mode.split(',')) '--arch and --mode options are required')
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
raise TestRunnerError() 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"]: if self.arch in ["auto", "native"]:
self.arch = ARCH_GUESS self.arch = ARCH_GUESS
self.arch = self.arch.split(",") if not self.arch in SUPPORTED_ARCHS:
for arch in self.arch: print "Unknown architecture %s" % self.arch
if not arch in SUPPORTED_ARCHS: raise TestRunnerError()
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)
def _get_gn_outdir(self): def _get_gn_outdir(self):
gn_out_dir = os.path.join(BASE_DIR, DEFAULT_OUT_GN) gn_out_dir = os.path.join(BASE_DIR, DEFAULT_OUT_GN)
...@@ -258,7 +248,6 @@ class BaseTestRunner(object): ...@@ -258,7 +248,6 @@ class BaseTestRunner(object):
# Auto-detect test configurations based on the build (GN only). # Auto-detect test configurations based on the build (GN only).
# sets: # sets:
# - arch # - arch
# - arch_and_mode
# - mode # - mode
# - outdir # - outdir
def _read_build_config(self, outdir, options): def _read_build_config(self, outdir, options):
...@@ -284,7 +273,6 @@ class BaseTestRunner(object): ...@@ -284,7 +273,6 @@ class BaseTestRunner(object):
# config. # config.
# This ensures that we'll also take the build products from there. # This ensures that we'll also take the build products from there.
self.outdir = os.path.dirname(build_config_path) self.outdir = os.path.dirname(build_config_path)
self.arch_and_mode = None
# In V8 land, GN's x86 is called ia32. # In V8 land, GN's x86 is called ia32.
if build_config["v8_target_cpu"] == "x86": if build_config["v8_target_cpu"] == "x86":
......
...@@ -100,8 +100,6 @@ class StandardTestRunner(base_runner.BaseTestRunner): ...@@ -100,8 +100,6 @@ class StandardTestRunner(base_runner.BaseTestRunner):
except Exception: except Exception:
pass pass
exit_code = 0
suite_paths = utils.GetSuitePaths(join(base_runner.BASE_DIR, "test")) suite_paths = utils.GetSuitePaths(join(base_runner.BASE_DIR, "test"))
# Use default tests if no test configuration was provided at the cmd line. # Use default tests if no test configuration was provided at the cmd line.
...@@ -134,13 +132,10 @@ class StandardTestRunner(base_runner.BaseTestRunner): ...@@ -134,13 +132,10 @@ class StandardTestRunner(base_runner.BaseTestRunner):
for s in suites: for s in suites:
s.PrepareSources() s.PrepareSources()
for (arch, mode) in self.arch_and_mode: try:
try: return self._execute(self.arch, self.mode, args, options, suites)
code = self._execute(arch, mode, args, options, suites) except KeyboardInterrupt:
except KeyboardInterrupt: return 2
return 2
exit_code = exit_code or code
return exit_code
def _add_parser_options(self, parser): def _add_parser_options(self, parser):
parser.add_option("--asan", 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