Add mapping of test groups to test driver.
authormachenbach@chromium.org <machenbach@chromium.org>
Mon, 1 Sep 2014 10:48:36 +0000 (10:48 +0000)
committermachenbach@chromium.org <machenbach@chromium.org>
Mon, 1 Sep 2014 10:48:36 +0000 (10:48 +0000)
BUG=
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/524373002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23552 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

tools/run-tests.py

index e1c11c3..d48b70c 100755 (executable)
@@ -28,6 +28,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
+from collections import OrderedDict
 import itertools
 import multiprocessing
 import optparse
@@ -53,6 +54,31 @@ ARCH_GUESS = utils.DefaultArch()
 DEFAULT_TESTS = ["mjsunit", "fuzz-natives", "base-unittests",
                  "cctest", "compiler-unittests", "heap-unittests",
                  "libplatform-unittests", "message", "preparser"]
+
+# Map of test name synonyms to lists of test suites. Should be ordered by
+# expected runtimes (suites with slow test cases first). These groups are
+# invoked in seperate steps on the bots.
+TEST_MAP = {
+  "default": [
+    "mjsunit",
+    "fuzz-natives",
+    "cctest",
+    "message",
+    "preparser",
+  ],
+  "optimize_for_size": [
+    "mjsunit",
+    "cctest",
+    "webkit",
+  ],
+  "unittests": [
+    "compiler-unittests",
+    "heap-unittests",
+    "base-unittests",
+    "libplatform-unittests",
+  ],
+}
+
 TIMEOUT_DEFAULT = 60
 TIMEOUT_SCALEFACTOR = {"debug"   : 4,
                        "release" : 1 }
@@ -378,14 +404,23 @@ def Main():
 
   suite_paths = utils.GetSuitePaths(join(workspace, "test"))
 
+  # Expand arguments with grouped tests. The args should reflect the list of
+  # suites as otherwise filters would break.
+  def ExpandTestGroups(name):
+    if name in TEST_MAP:
+      return [suite for suite in TEST_MAP[arg]]
+    else:
+      return [name]
+  args = reduce(lambda x, y: x + y,
+         [ExpandTestGroups(arg) for arg in args],
+         [])
+
   if len(args) == 0:
     suite_paths = [ s for s in DEFAULT_TESTS if s in suite_paths ]
   else:
-    args_suites = set()
+    args_suites = OrderedDict() # Used as set
     for arg in args:
-      suite = arg.split(os.path.sep)[0]
-      if not suite in args_suites:
-        args_suites.add(suite)
+      args_suites[arg.split(os.path.sep)[0]] = True
     suite_paths = [ s for s in args_suites if s in suite_paths ]
 
   suites = []