Use tools/run-tests.py for "check" targets in the top-level Makefile.
authorjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 18 Oct 2012 14:21:35 +0000 (14:21 +0000)
committerjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 18 Oct 2012 14:21:35 +0000 (14:21 +0000)
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
tools/run-tests.py
tools/testrunner/local/execution.py
tools/testrunner/local/progress.py

index 99189d6..dc7490d 100644 (file)
--- 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.
index cab93fb..5d90d19 100755 (executable)
@@ -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)
 
index 25df043..0adf9c9 100644 (file)
@@ -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()
index 6ae416a..9075a95 100644 (file)
@@ -152,6 +152,7 @@ class CompactProgressIndicator(ProgressIndicator):
 
   def Done(self):
     self.PrintProgress('Done')
+    print ""  # Line break.
 
   def AboutToRun(self, test):
     self.PrintProgress(test.GetLabel())