Title: [139786] trunk/Tools
Revision
139786
Author
[email protected]
Date
2013-01-15 14:03:13 -0800 (Tue, 15 Jan 2013)

Log Message

Tests with WontFix expectation are (indirectly) skipped
https://bugs.webkit.org/show_bug.cgi?id=105860

Reviewed by Dirk Pranke.

Only skip the WontFix expectation if there are no other layout test
expectations (like Failure, ImageOnlyFailure) listed for the test.
This makes it possible to run an expected failure for which there
is no reason or interest to fix. There are some ports that would like
to exercise this behavior as well as specific test cases that should use
such expectations.

* Scripts/webkitpy/layout_tests/models/test_expectations.py:
(TestExpectationParser._tokenize_line): Only add the SKIP modifier for a
WONTFIX test if there are no expectations listed. The warning is adjusted
to reflect the new behavior.
* Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: Add
and adjust test cases for these changes.
(ExpectationSyntaxTests.test_wontfix):
(SemanticTests.test_skip_and_wontfix):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (139785 => 139786)


--- trunk/Tools/ChangeLog	2013-01-15 22:01:52 UTC (rev 139785)
+++ trunk/Tools/ChangeLog	2013-01-15 22:03:13 UTC (rev 139786)
@@ -1,3 +1,26 @@
+2013-01-15  Zan Dobersek  <[email protected]>
+
+        Tests with WontFix expectation are (indirectly) skipped
+        https://bugs.webkit.org/show_bug.cgi?id=105860
+
+        Reviewed by Dirk Pranke.
+
+        Only skip the WontFix expectation if there are no other layout test
+        expectations (like Failure, ImageOnlyFailure) listed for the test.
+        This makes it possible to run an expected failure for which there
+        is no reason or interest to fix. There are some ports that would like
+        to exercise this behavior as well as specific test cases that should use
+        such expectations.
+
+        * Scripts/webkitpy/layout_tests/models/test_expectations.py:
+        (TestExpectationParser._tokenize_line): Only add the SKIP modifier for a
+        WONTFIX test if there are no expectations listed. The warning is adjusted
+        to reflect the new behavior.
+        * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: Add
+        and adjust test cases for these changes.
+        (ExpectationSyntaxTests.test_wontfix):
+        (SemanticTests.test_skip_and_wontfix):
+
 2013-01-15  Jochen Eisinger  <[email protected]>
 
         [chromium] add title text direction attribute to TestRunner

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py (139785 => 139786)


--- trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py	2013-01-15 22:01:52 UTC (rev 139785)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py	2013-01-15 22:03:13 UTC (rev 139786)
@@ -346,12 +346,12 @@
             elif state not in ('name_found', 'done'):
                 warnings.append('Missing a "]"')
 
-        if 'WONTFIX' in modifiers and 'SKIP' not in modifiers:
+        if 'WONTFIX' in modifiers and 'SKIP' not in modifiers and not expectations:
             modifiers.append('SKIP')
 
         if 'SKIP' in modifiers and expectations:
             # FIXME: This is really a semantic warning and shouldn't be here. Remove when we drop the old syntax.
-            warnings.append('A test marked Skip or WontFix must not have other expectations.')
+            warnings.append('A test marked Skip must not have other expectations.')
         elif not expectations:
             if 'SKIP' not in modifiers and 'REBASELINE' not in modifiers and 'SLOW' not in modifiers:
                 modifiers.append('SKIP')

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py (139785 => 139786)


--- trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py	2013-01-15 22:01:52 UTC (rev 139785)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py	2013-01-15 22:03:13 UTC (rev 139786)
@@ -356,6 +356,8 @@
 
     def test_wontfix(self):
         self.assert_tokenize_exp('foo.html [ WontFix ]', modifiers=['WONTFIX', 'SKIP'], expectations=['PASS'])
+        self.assert_tokenize_exp('foo.html [ WontFix ImageOnlyFailure ]', modifiers=['WONTFIX'], expectations=['IMAGE'])
+        self.assert_tokenize_exp('foo.html [ WontFix Pass Failure ]', modifiers=['WONTFIX'], expectations=['PASS', 'FAIL'])
 
     def test_blank_line(self):
         self.assert_tokenize_exp('', name=None)
@@ -391,16 +393,16 @@
         self.assertEqual(line.warnings, ['Test lacks BUG modifier.'])
 
     def test_skip_and_wontfix(self):
-        # Skip and WontFix are not allowed to have other expectations as well, because those
+        # Skip is not allowed to have other expectations as well, because those
         # expectations won't be exercised and may become stale .
         self.parse_exp('failures/expected/text.html [ Failure Skip ]')
         self.assertTrue(self._exp.has_warnings())
 
         self.parse_exp('failures/expected/text.html [ Crash WontFix ]')
-        self.assertTrue(self._exp.has_warnings())
+        self.assertFalse(self._exp.has_warnings())
 
         self.parse_exp('failures/expected/text.html [ Pass WontFix ]')
-        self.assertTrue(self._exp.has_warnings())
+        self.assertFalse(self._exp.has_warnings())
 
     def test_slow_and_timeout(self):
         # A test cannot be SLOW and expected to TIMEOUT.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to