Bug 1544041 - Add test-also support to wpt-in-jstests; r=bbouvier
☠☠ backed out by d0ca7b557e0f ☠ ☠
authorMs2ger <Ms2ger@igalia.com>
Mon, 15 Apr 2019 13:49:54 +0000
changeset 469497 9573e2163ca4
parent 469496 b7402a73e252
child 469498 4b8c7a55d97a
push id35873
push userccoroiu@mozilla.com
push dateMon, 15 Apr 2019 21:36:26 +0000
treeherdermozilla-central@b8f49a14c458 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1544041
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1544041 - Add test-also support to wpt-in-jstests; r=bbouvier Differential Revision: https://phabricator.services.mozilla.com/D27478
js/src/tests/jstests.py
js/src/tests/lib/results.py
--- a/js/src/tests/jstests.py
+++ b/js/src/tests/jstests.py
@@ -400,27 +400,39 @@ def load_wpt_tests(xul_tester, requested
     ]
 
     def resolve(test_path, script):
         if script.startswith("/"):
             return os.path.join(wpt, script[1:])
 
         return os.path.join(wpt, os.path.dirname(test_path), script)
 
-    return [
-        RefTestCase(
-            wpt,
-            test_path,
-            extra_helper_paths=extra_helper_paths + [resolve(test_path, s) for s in test.scripts],
-            wpt=test
-        )
-        for test_path, test in (
-            (os.path.relpath(test.path, wpt), test) for test in loader.tests["testharness"]
-        )
-    ]
+    tests = []
+    for test in loader.tests["testharness"]:
+        test_path = os.path.relpath(test.path, wpt)
+        scripts = [resolve(test_path, s) for s in test.scripts]
+        extra_helper_paths_for_test = extra_helper_paths + scripts,
+
+        # We must create at least one test with the default options, along with
+        # one test for each option given in a test-also annotation.
+        options = [None]
+        for m in test.itermeta():
+            if m.has_key("test-also"):  # NOQA: W601
+                options += m.get("test-also").split()
+        for option in options:
+            test_case = RefTestCase(
+                wpt,
+                test_path,
+                extra_helper_paths=extra_helper_paths_for_test[:],
+                wpt=test
+            )
+            if option:
+                test_case.options.append(option)
+            tests.append(test_case)
+    return tests
 
 
 def load_tests(options, requested_paths, excluded_paths):
     """
     Returns a tuple: (test_count, test_gen)
         test_count: [int] Number of tests that will be in test_gen
         test_gen: [iterable<Test>] Tests found that should be run.
     """
--- a/js/src/tests/lib/results.py
+++ b/js/src/tests/lib/results.py
@@ -362,16 +362,17 @@ class ResultsSink:
     def list(self, completed):
         for label, results in sorted(self.groups.items()):
             if label == '':
                 continue
 
             print(label)
             for result in results:
                 print('    {}'.format(' '.join(result.test.jitflags +
+                                               result.test.options +
                                                [result.test.path])))
 
         if self.options.failure_file:
             failure_file = open(self.options.failure_file, 'w')
             if not self.all_passed():
                 if 'REGRESSIONS' in self.groups:
                     for result in self.groups['REGRESSIONS']:
                         print(result.test.path, file=failure_file)