From 230bec1274b7e8e775acd46b44b572cf82112f4f Mon Sep 17 00:00:00 2001 From: "jkummerow@chromium.org" Date: Thu, 18 Oct 2012 14:21:35 +0000 Subject: [PATCH] Use tools/run-tests.py for "check" targets in the top-level Makefile. Bonus content: a few minor fixes for run-tests.py Review URL: https://codereview.chromium.org/11184039 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12758 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- Makefile | 16 ++++++++-------- tools/run-tests.py | 16 +++++++++------- tools/testrunner/local/execution.py | 5 ++++- tools/testrunner/local/progress.py | 1 + 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 99189d6..dc7490d 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ CXX ?= g++ LINK ?= g++ OUTDIR ?= out -TESTJOBS ?= -j16 +TESTJOBS ?= GYPFLAGS ?= TESTFLAGS ?= ANDROID_NDK_ROOT ?= @@ -203,20 +203,20 @@ $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \ # Test targets. check: all - @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ + @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ $(TESTFLAGS) $(addsuffix .check,$(MODES)): $$(basename $$@) - @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ + @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ --mode=$(basename $@) $(TESTFLAGS) $(addsuffix .check,$(ARCHES)): $$(basename $$@) - @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ + @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ --arch=$(basename $@) $(TESTFLAGS) $(CHECKS): $$(basename $$@) - @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ + @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ --arch-and-mode=$(basename $@) $(TESTFLAGS) $(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@) @@ -224,16 +224,16 @@ $(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@) $(shell pwd) $(ANDROID_V8) $(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync - @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \ + @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ --arch-and-mode=$(basename $@) \ --timeout=600 \ - --special-command="tools/android-run.py @" + --command-prefix="tools/android-run.py" $(addsuffix .check, $(ANDROID_ARCHES)): \ $(addprefix $$(basename $$@).,$(MODES)).check native.check: native - @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ + @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ --arch-and-mode=. $(TESTFLAGS) # Clean targets. You can clean each architecture individually, or everything. diff --git a/tools/run-tests.py b/tools/run-tests.py index cab93fb..5d90d19 100755 --- a/tools/run-tests.py +++ b/tools/run-tests.py @@ -174,12 +174,6 @@ def ProcessOptions(options): options.shell_dir = os.path.dirname(options.shell) if options.stress_only: VARIANT_FLAGS = [["--stress-opt", "--always-opt"]] - # Simulators are slow, therefore allow a longer default timeout. - if options.timeout == -1: - if options.arch == "arm" or options.arch == "mipsel": - options.timeout = 2 * TIMEOUT_DEFAULT; - else: - options.timeout = TIMEOUT_DEFAULT; if options.valgrind: run_valgrind = os.path.join("tools", "run-valgrind.py") # This is OK for distributed running, so we don't need to set no_network. @@ -264,10 +258,18 @@ def Execute(arch, mode, args, options, suites, workspace): # Populate context object. mode_flags = MODE_FLAGS[mode] + timeout = options.timeout + if timeout == -1: + # Simulators are slow, therefore allow a longer default timeout. + if arch in ["android", "arm", "mipsel"]: + timeout = 2 * TIMEOUT_DEFAULT; + else: + timeout = TIMEOUT_DEFAULT; + options.timeout *= TIMEOUT_SCALEFACTOR[mode] ctx = context.Context(arch, mode, shell_dir, mode_flags, options.verbose, - options.timeout, options.isolates, + timeout, options.isolates, options.command_prefix, options.extra_flags) diff --git a/tools/testrunner/local/execution.py b/tools/testrunner/local/execution.py index 25df043..0adf9c9 100644 --- a/tools/testrunner/local/execution.py +++ b/tools/testrunner/local/execution.py @@ -90,7 +90,9 @@ class Runner(object): self.indicator.Starting() self._RunInternal(jobs) self.indicator.Done() - return not self.failed + if self.failed: + return 1 + return 0 def _RunInternal(self, jobs): pool = multiprocessing.Pool(processes=jobs) @@ -147,6 +149,7 @@ class Runner(object): except KeyboardInterrupt: pool.terminate() pool.join() + raise except Exception, e: print("Exception: %s" % e) pool.terminate() diff --git a/tools/testrunner/local/progress.py b/tools/testrunner/local/progress.py index 6ae416a..9075a95 100644 --- a/tools/testrunner/local/progress.py +++ b/tools/testrunner/local/progress.py @@ -152,6 +152,7 @@ class CompactProgressIndicator(ProgressIndicator): def Done(self): self.PrintProgress('Done') + print "" # Line break. def AboutToRun(self, test): self.PrintProgress(test.GetLabel()) -- 2.7.4