Run tests as if they are expected to pass when --force is given.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Oct 2013 18:13:10 +0000 (18:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Oct 2013 18:13:10 +0000 (18:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112890

Patch by Tamas Gergely <gertom@inf.u-szeged.hu> on 2013-10-31
Reviewed by Ryosuke Niwa.

The --force switch of new-run-webkit-tests is now forces all tests to
be run with 'PASS' as expected result.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager.run):
* Scripts/webkitpy/layout_tests/models/test_expectations.py:
(TestExpectations.__init__):
(TestExpectations._add_expectations):
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
(_set_up_derived_options):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158373 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

index 51a9d3e..8a808f9 100644 (file)
@@ -1,3 +1,22 @@
+2013-10-31  Tamas Gergely  <gertom@inf.u-szeged.hu>
+
+        Run tests as if they are expected to pass when --force is given.
+        https://bugs.webkit.org/show_bug.cgi?id=112890
+
+        Reviewed by Ryosuke Niwa.
+
+        The --force switch of new-run-webkit-tests is now forces all tests to
+        be run with 'PASS' as expected result.
+
+        * Scripts/webkitpy/layout_tests/controllers/manager.py:
+        (Manager.run):
+        * Scripts/webkitpy/layout_tests/models/test_expectations.py:
+        (TestExpectations.__init__):
+        (TestExpectations._add_expectations):
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        (parse_args):
+        (_set_up_derived_options):
+
 2013-10-31  Geoffrey Garen  <ggaren@apple.com>
 
         Added Mark Lam as a reviewer.
index 4c39a34..1612e84 100644 (file)
@@ -179,7 +179,7 @@ class Manager(object):
             return test_run_results.RunDetails(exit_code=-1)
 
         self._printer.write_update("Parsing expectations ...")
-        self._expectations = test_expectations.TestExpectations(self._port, test_names)
+        self._expectations = test_expectations.TestExpectations(self._port, test_names, force_expectations_pass=self._options.force)
 
         tests_to_run, tests_to_skip = self._prepare_lists(paths, test_names)
         self._printer.print_found(len(test_names), len(tests_to_run), self._options.repeat_each, self._options.iterations)
index c8ea322..483d720 100644 (file)
@@ -833,7 +833,7 @@ class TestExpectations(object):
     # FIXME: This constructor does too much work. We should move the actual parsing of
     # the expectations into separate routines so that linting and handling overrides
     # can be controlled separately, and the constructor can be more of a no-op.
-    def __init__(self, port, tests=None, include_generic=True, include_overrides=True, expectations_to_lint=None):
+    def __init__(self, port, tests=None, include_generic=True, include_overrides=True, expectations_to_lint=None, force_expectations_pass=False):
         self._full_test_list = tests
         self._test_config = port.test_configuration()
         self._is_lint_mode = expectations_to_lint is not None
@@ -842,6 +842,7 @@ class TestExpectations(object):
         self._port = port
         self._skipped_tests_warnings = []
         self._expectations = []
+        self._force_expectations_pass = force_expectations_pass
 
         expectations_dict = expectations_to_lint or port.expectations_dict()
 
@@ -990,7 +991,11 @@ class TestExpectations(object):
 
     def _add_expectations(self, expectation_list):
         for expectation_line in expectation_list:
-            if not expectation_line.expectations:
+            if self._force_expectations_pass:
+                expectation_line.expectations = ['PASS']
+                expectation_line.parsed_expectations = set([PASS])
+
+            elif not expectation_line.expectations:
                 continue
 
             if self._is_lint_mode or self._test_config in expectation_line.matching_configurations:
index fdc20cb..96038ff 100644 (file)
@@ -226,8 +226,8 @@ def parse_args(args):
                  "'ignore' == Run them anyway, "
                  "'only' == only run the SKIP tests, "
                  "'always' == always skip, even if listed on the command line.")),
-        optparse.make_option("--force", dest="skipped", action="store_const", const='ignore',
-            help="Run all tests, even those marked SKIP in the test list (same as --skipped=ignore)"),
+        optparse.make_option("--force", action="store_true", default=False,
+            help="Run all tests with PASS as expected result, even those marked SKIP in the test list (implies --skipped=ignore)"),
         optparse.make_option("--time-out-ms",
             help="Set the timeout for each test"),
         optparse.make_option("--order", action="store", default="natural",
@@ -337,6 +337,11 @@ def _set_up_derived_options(port, options):
             additional_platform_directories.append(port.host.filesystem.abspath(path))
         options.additional_platform_directory = additional_platform_directories
 
+    if options.force:
+        if options.skipped not in ('ignore', 'default'):
+            _log.warning("--force overrides --skipped=%s" % (options.skipped))
+        options.skipped = 'ignore'
+
     if not options.http and options.skipped in ('ignore', 'only'):
         _log.warning("--force/--skipped=%s overrides --no-http." % (options.skipped))
         options.http = True