Skip to content

Commit

Permalink
Merged: [test] Continued test support for make targets
Browse files Browse the repository at this point in the history
Revision: 23a5751

BUG=chromium:772804
BUG=v8:7060
LOG=N
NOTRY=true
NOPRESUBMIT=true
NOTREECHECKS=true
R=hablich@chromium.org

Change-Id: Ibf85d7737a9cd25131ee8e695f184cbd565ef5bd
Reviewed-on: https://chromium-review.googlesource.com/761556
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Myles Borins <mborins@google.com>
Cr-Commit-Position: refs/branch-heads/6.2@{#86}
Cr-Branched-From: efa2ac4-refs/heads/6.2.414@{#1}
Cr-Branched-From: a861ebb-refs/heads/master@{#47693}
  • Loading branch information
MylesBorins authored and Commit Bot committed Nov 9, 2017
1 parent 058dd42 commit 00c7021
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 21 deletions.
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -338,40 +338,40 @@ $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) Makefile.android

# Test targets.
check: all
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \
$(TESTFLAGS)

$(addsuffix .check,$(MODES)): $$(basename $$@)
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--mode=$(basename $@) $(TESTFLAGS)

$(addsuffix .check,$(ARCHES)): $$(basename $$@)
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch=$(basename $@) $(TESTFLAGS)

$(CHECKS): $$(basename $$@)
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(basename $@) $(TESTFLAGS)

$(addsuffix .quickcheck,$(MODES)): $$(basename $$@)
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--mode=$(basename $@) $(TESTFLAGS) --quickcheck

$(addsuffix .quickcheck,$(ARCHES)): $$(basename $$@)
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch=$(basename $@) $(TESTFLAGS) --quickcheck

$(QUICKCHECKS): $$(basename $$@)
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(basename $@) $(TESTFLAGS) --quickcheck

$(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@)
@tools/android-sync.sh $(basename $@) $(OUTDIR) \
$(shell pwd) $(ANDROID_V8)

$(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(basename $@) \
--timeout=600 \
--command-prefix="tools/android-run.py" $(TESTFLAGS)
Expand All @@ -380,7 +380,7 @@ $(addsuffix .check, $(ANDROID_ARCHES)): \
$(addprefix $$(basename $$@).,$(MODES)).check

native.check: native
@tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \
@gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR)/native \
--arch-and-mode=. $(TESTFLAGS)

SUPERFASTTESTMODES = ia32.release
Expand All @@ -391,18 +391,18 @@ COMMA = ,
EMPTY =
SPACE = $(EMPTY) $(EMPTY)
quickcheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES))
tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) --quickcheck \
--download-data mozilla webkit
tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) --quickcheck
qc: quickcheck

turbocheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES))
tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) \
--quickcheck --variants=turbofan --download-data mozilla webkit
tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \
gypfiles/run-tests-legacy.py $(TESTJOBS) --outdir=$(OUTDIR) \
--arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) \
--quickcheck --variants=turbofan
tc: turbocheck
Expand Down
50 changes: 50 additions & 0 deletions gypfiles/run-tests-legacy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env python
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""
Legacy test-runner wrapper supporting a product of multiple architectures and
modes.
"""

import argparse
import itertools
from os.path import abspath, dirname, join
import subprocess
import sys

BASE_DIR = dirname(dirname(abspath(__file__)))
RUN_TESTS = join(BASE_DIR, 'tools', 'run-tests.py')

def main():
parser = argparse.ArgumentParser(description='Legacy test-runner wrapper')
parser.add_argument(
'--arch', help='Comma-separated architectures to run tests on')
parser.add_argument(
'--mode', help='Comma-separated modes to run tests on')
parser.add_argument(
'--arch-and-mode',
help='Architecture and mode in the format \'arch.mode\'',
)

args, remaining_args = parser.parse_known_args(sys.argv)
if (args.arch or args.mode) and args.arch_and_mode:
parser.error('The flags --arch-and-mode and --arch/--mode are exclusive.')
arch = (args.arch or 'ia32,x64,arm').split(',')
mode = (args.mode or 'release,debug').split(',')
if args.arch_and_mode:
arch_and_mode = map(
lambda am: am.split('.'),
args.arch_and_mode.split(','))
arch = map(lambda am: am[0], arch_and_mode)
mode = map(lambda am: am[1], arch_and_mode)

ret_code = 0
for a, m in itertools.product(arch, mode):
ret_code |= subprocess.check_call(
[RUN_TESTS] + remaining_args[1:] + ['--arch', a, '--mode', m])
return ret_code

if __name__ == '__main__':
sys.exit(main())
9 changes: 1 addition & 8 deletions src/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
{
'target_name': 'v8',
'dependencies_traverse': 1,
'dependencies': ['v8_maybe_snapshot', 'v8_dump_build_config'],
'dependencies': ['v8_maybe_snapshot', 'v8_dump_build_config#target'],
'conditions': [
['want_separate_host_toolset==1', {
'toolsets': ['host', 'target'],
Expand Down Expand Up @@ -2504,13 +2504,6 @@
'type': 'none',
'variables': {
},
'conditions': [
[ 'want_separate_host_toolset==1', {
'toolsets': ['host'],
}, {
'toolsets': ['target'],
}]
],
'actions': [
{
'action_name': 'v8_dump_build_config',
Expand Down

0 comments on commit 00c7021

Please sign in to comment.