Changeset 129052 in webkit
- Timestamp:
- Sep 19, 2012 3:36:35 PM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r129051 r129052 1 2012-09-19 Dirk Pranke <dpranke@chromium.org> 2 3 Support new TestExpectations format alongside old one 4 https://bugs.webkit.org/show_bug.cgi?id=96588 5 6 Reviewed by Ojan Vafai. 7 8 This patch adds support for actually reading in lines formatted 9 in the new style, and when we re-serialize/write out the file, 10 all lines will be written in the new style. Note that reading in 11 the old style is still supported, and no updates are being made 12 to the actual TestExpectations files as part of this change. 13 14 This change updates most but not all of the unit tests to use 15 the new syntax. I will update the rest when (or before where 16 possible) I drop support for the old format. 17 18 * Scripts/webkitpy/layout_tests/models/test_expectations.py: 19 (TestExpectationParser): 20 (TestExpectationParser._tokenize_line): 21 (TestExpectationParser._tokenize_line_using_new_format): 22 (TestExpectationLine.to_string): 23 (TestExpectationLine._format_line): 24 (TestExpectations): 25 * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: 26 (test_parse_warning): 27 (SkippedTests.test_skipped_entry_dont_exist): 28 (NewExpectationSyntaxTests.test_warnings): 29 (RemoveConfigurationsTest.test_remove): 30 (test_remove_line): 31 (RebaseliningTest.test_remove): 32 (RebaseliningTest.test_no_get_rebaselining_failures): 33 (TestExpectationParserTests.test_tokenize_blank): 34 (TestExpectationParserTests.test_tokenize_extra_colon): 35 (TestExpectationParserTests.test_tokenize_missing_equal): 36 (TestExpectationParserTests.test_tokenize_extra_equal): 37 (TestExpectationSerializationTests.test_unparsed_to_string): 38 (TestExpectationSerializationTests.test_unparsed_list_to_string): 39 (TestExpectationSerializationTests.test_parsed_to_string): 40 (TestExpectationSerializationTests.test_format_line): 41 (TestExpectationSerializationTests.test_string_roundtrip): 42 (TestExpectationSerializationTests.test_list_roundtrip): 43 (TestExpectationSerializationTests.test_reconstitute_only_these): 44 (TestExpectationSerializationTests.test_string_whitespace_stripping): 45 * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: 46 (LintTest.test_lint_test_files__errors): 47 * Scripts/webkitpy/tool/commands/queries_unittest.py: 48 (PrintExpectationsTest.test_basic): 49 (PrintExpectationsTest.test_multiple): 50 (PrintExpectationsTest.test_full): 51 (PrintExpectationsTest.test_exclude): 52 * Scripts/webkitpy/tool/commands/rebaseline.py: 53 (RebaselineExpectations.execute): 54 * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: 55 (TestRebaseline.test_rebaseline_updates_expectations_file_noop): 56 (test_rebaseline_updates_expectations_file): 57 (test_rebaseline_does_not_include_overrides): 58 (test_rebaseline_expectations_noop): 59 (test_overrides_are_included_correctly): 60 1 61 2012-09-19 Dirk Pranke <dpranke@chromium.org> 2 62 -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
r129051 r129052 210 210 expectation_line.matching_tests.append(expectation_line.path) 211 211 212 # FIXME: Seems like these should be classmethods on TestExpectationLine instead of TestExpectationParser. 212 213 @classmethod 213 214 def _tokenize_line(cls, filename, expectation_string, line_number): 214 # FIXME: Add in support for the new format as well. 215 return cls._tokenize_line_using_old_format(filename, expectation_string, line_number) 215 expectation_line = cls._tokenize_line_using_new_format(filename, expectation_string, line_number) 216 if expectation_line.is_invalid(): 217 old_expectation_line = cls._tokenize_line_using_old_format(filename, expectation_string, line_number) 218 if not old_expectation_line.is_invalid(): 219 return old_expectation_line 220 return expectation_line 216 221 217 222 @classmethod … … 266 271 267 272 _configuration_tokens = dict((token, token.upper()) for token in _configuration_tokens_list) 268 269 # Note: we can't distinguish audio failures or image+text failures from text-only failures. 273 _inverted_configuration_tokens = dict((value, name) for name, value in _configuration_tokens.iteritems()) 274 270 275 # FIXME: Update the original modifiers list and remove this once the old syntax is gone. 271 276 _expectation_tokens = { 272 'WontFix': 'WONTFIX', 273 'Pass': 'PASS', 277 'Crash': 'CRASH', 274 278 'Failure': 'FAIL', 275 279 'ImageOnlyFailure': 'IMAGE', 276 'Crash': 'CRASH', 280 'Pass': 'PASS', 281 'Rebaseline': 'REBASELINE', 282 'Skip': 'SKIP', 283 'Slow': 'SLOW', 277 284 'Timeout': 'TIMEOUT', 278 ' Slow': 'SLOW',285 'WontFix': 'WONTFIX', 279 286 } 287 288 _inverted_expectation_tokens = dict((value, name) for name, value in _expectation_tokens.iteritems()) 280 289 281 290 @classmethod … … 291 300 """ 292 301 expectation_line = TestExpectationLine() 302 expectation_line.original_string = expectation_string 293 303 expectation_line.filename = filename 294 304 expectation_line.line_number = line_number … … 445 455 446 456 if self.name is None: 447 return '' if self.comment is None else " //%s" % self.comment457 return '' if self.comment is None else "#%s" % self.comment 448 458 449 459 if test_configuration_converter and self.parsed_bug_modifiers: … … 451 461 result = [] 452 462 for specifiers in specifiers_list: 453 modifiers = self._serialize_parsed_modifiers(test_configuration_converter, specifiers) 454 expectations = self._serialize_parsed_expectations(parsed_expectation_to_string) 463 # FIXME: this is silly that we join the modifiers and then immediately split them. 464 modifiers = self._serialize_parsed_modifiers(test_configuration_converter, specifiers).split() 465 expectations = self._serialize_parsed_expectations(parsed_expectation_to_string).split() 455 466 result.append(self._format_line(modifiers, self.name, expectations, self.comment)) 456 467 return "\n".join(result) if result else None 457 468 458 return self._format_line( " ".join(self.modifiers), self.name, " ".join(self.expectations), self.comment,469 return self._format_line(self.modifiers, self.name, self.expectations, self.comment, 459 470 include_modifiers, include_expectations, include_comment) 460 471 … … 480 491 @staticmethod 481 492 def _format_line(modifiers, name, expectations, comment, include_modifiers=True, include_expectations=True, include_comment=True): 493 bugs = [] 494 new_modifiers = [] 495 new_expectations = [] 496 for modifier in modifiers: 497 modifier = modifier.upper() 498 if modifier.startswith('BUGWK'): 499 bugs.append('webkit.org/b/' + modifier.replace('BUGWK', '')) 500 elif modifier.startswith('BUGCR'): 501 bugs.append('crbug.com/' + modifier.replace('BUGCR', '')) 502 elif modifier.startswith('BUG'): 503 # FIXME: we should preserve case once we can drop the old syntax. 504 bugs.append('Bug(' + modifier[3:].lower() + ')') 505 elif modifier in ('SLOW', 'SKIP', 'REBASELINE', 'WONTFIX'): 506 new_expectations.append(TestExpectationParser._inverted_expectation_tokens.get(modifier)) 507 else: 508 new_modifiers.append(TestExpectationParser._inverted_configuration_tokens.get(modifier, modifier)) 509 510 for expectation in expectations: 511 expectation = expectation.upper() 512 new_expectations.append(TestExpectationParser._inverted_expectation_tokens.get(expectation, expectation)) 513 482 514 result = '' 483 if include_modifiers: 484 result += '%s : ' % modifiers.upper() 515 if include_modifiers and (bugs or new_modifiers): 516 if bugs: 517 result += ' '.join(bugs) + ' ' 518 if new_modifiers: 519 result += '[ %s ] ' % ' '.join(new_modifiers) 485 520 result += name 486 if include_expectations :487 result += ' = %s' % expectations.upper()521 if include_expectations and new_expectations and set(new_expectations) != set(['Skip', 'Pass']): 522 result += ' [ %s ]' % ' '.join(sorted(set(new_expectations))) 488 523 if include_comment and comment is not None: 489 result += " //%s" % comment524 result += " #%s" % comment 490 525 return result 491 526 … … 731 766 directory and any subdirectory. The format is along the lines of: 732 767 733 LayoutTests/fast/js/fixme.js = FAIL734 LayoutTests/fast/js/flaky.js = FAIL PASS735 LayoutTests/fast/js/crash.js = CRASH TIMEOUT FAIL PASS768 LayoutTests/fast/js/fixme.js [ Failure ] 769 LayoutTests/fast/js/flaky.js [ Failure Pass ] 770 LayoutTests/fast/js/crash.js [ Crash Failure Pass Timeout ] 736 771 ... 737 772 738 773 To add modifiers: 739 SKIP : LayoutTests/fast/js/no-good.js = TIMEOUT PASS740 DEBUG : LayoutTests/fast/js/no-good.js = TIMEOUT PASS741 DEBUG SKIP : LayoutTests/fast/js/no-good.js = TIMEOUT PASS742 LINUX DEBUG SKIP : LayoutTests/fast/js/no-good.js = TIMEOUT PASS743 LINUX WIN : LayoutTests/fast/js/no-good.js = TIMEOUT PASS744 745 S KIP: Doesn't run the test.746 S LOW: The test takes a long time to run, but does not timeout indefinitely.747 W ONTFIX: For tests that we never intend to pass on a given platform.774 LayoutTests/fast/js/no-good.js 775 [ Debug ] LayoutTests/fast/js/no-good.js [ Pass Timeout ] 776 [ Debug ] LayoutTests/fast/js/no-good.js [ Pass Skip Timeout ] 777 [ Linux Debug ] LayoutTests/fast/js/no-good.js [ Pass Skip Timeout ] 778 [ Linux Win ] LayoutTests/fast/js/no-good.js [ Pass Skip Timeout ] 779 780 Skip: Doesn't run the test. 781 Slow: The test takes a long time to run, but does not timeout indefinitely. 782 WontFix: For tests that we never intend to pass on a given platform (treated like Skip). 748 783 749 784 Notes: … … 754 789 """ 755 790 791 # FIXME: Update to new syntax once the old format is no longer supported. 756 792 EXPECTATIONS = {'pass': PASS, 757 793 'fail': FAIL, -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
r129051 r129052 44 44 45 45 46 class MockBugManager(object):47 def close_bug(self, bug_id, reference_bug_id=None):48 pass49 50 def create_bug(self):51 return "BUG_NEWLY_CREATED"52 53 54 46 class Base(unittest.TestCase): 55 47 # Note that all of these tests are written assuming the configuration … … 190 182 filesystem.write_text_file(filesystem.join(self._port.layout_tests_dir(), 'disabled-test.html-disabled'), 'content') 191 183 self.get_test('disabled-test.html-disabled'), 192 self.parse_exp("FOO : failures/expected/text.html = FAIL\n" 193 "SKIP : failures/expected/image.html\n" 194 "BUGRNIWA : non-existent-test.html = FAIL\n" 195 "BUGRNIWA : disabled-test.html-disabled = IMAGE", is_lint_mode=True) 184 self.parse_exp("[ FOO ] failures/expected/text.html [ Failure ]\n" 185 "Bug(rniwa) non-existent-test.html [ Failure ]\n" 186 "Bug(rniwa) disabled-test.html-disabled [ ImageOnlyFailure ]", is_lint_mode=True) 196 187 self.assertFalse(True, "ParseError wasn't raised") 197 188 except ParseError, e: 198 189 warnings = ("expectations:1 Test lacks BUG modifier. failures/expected/text.html\n" 199 190 "expectations:1 Unrecognized modifier 'foo' failures/expected/text.html\n" 200 "expectations:2 Missing expectations SKIP : failures/expected/image.html\n" 201 "expectations:3 Path does not exist. non-existent-test.html") 191 "expectations:2 Path does not exist. non-existent-test.html") 202 192 self.assertEqual(str(e), warnings) 203 193 … … 314 304 self.assertEqual('The following test foo/bar/baz.html from the Skipped list doesn\'t exist\n', logs) 315 305 306 307 # FIXME: remove these tests when we stop supporting the old syntax. 316 308 317 309 class ExpectationSyntaxTests(Base): … … 403 395 404 396 397 class NewExpectationSyntaxTests(unittest.TestCase): 398 def assert_exp(self, line, bugs=None, modifiers=None, expectations=None, warnings=None, comment=None, name='foo.html'): 399 bugs = bugs or [] 400 modifiers = modifiers or [] 401 expectations = expectations or [] 402 warnings = warnings or [] 403 filename = 'TestExpectations' 404 line_number = 1 405 expectation_line = TestExpectationParser._tokenize_line_using_new_format(filename, line, line_number) 406 self.assertEquals(expectation_line.warnings, warnings) 407 self.assertEquals(expectation_line.name, name) 408 self.assertEquals(expectation_line.filename, filename) 409 self.assertEquals(expectation_line.line_number, line_number) 410 if not warnings: 411 self.assertEquals(expectation_line.modifiers, modifiers) 412 self.assertEquals(expectation_line.expectations, expectations) 413 414 def test_bare_name(self): 415 self.assert_exp('foo.html', modifiers=['SKIP'], expectations=['PASS']) 416 417 def test_bare_name_and_bugs(self): 418 self.assert_exp('webkit.org/b/12345 foo.html', modifiers=['BUGWK12345', 'SKIP'], expectations=['PASS']) 419 self.assert_exp('crbug.com/12345 foo.html', modifiers=['BUGCR12345', 'SKIP'], expectations=['PASS']) 420 self.assert_exp('Bug(dpranke) foo.html', modifiers=['BUGDPRANKE', 'SKIP'], expectations=['PASS']) 421 self.assert_exp('crbug.com/12345 crbug.com/34567 foo.html', modifiers=['BUGCR12345', 'BUGCR34567', 'SKIP'], expectations=['PASS']) 422 423 def test_comments(self): 424 self.assert_exp("# comment", name=None, comment="# comment") 425 self.assert_exp("foo.html # comment", comment="# comment", expectations=['PASS'], modifiers=['SKIP']) 426 427 def test_config_modifiers(self): 428 self.assert_exp('[ Mac ] foo.html', modifiers=['MAC', 'SKIP'], expectations=['PASS']) 429 self.assert_exp('[ Mac Vista ] foo.html', modifiers=['MAC', 'VISTA', 'SKIP'], expectations=['PASS']) 430 self.assert_exp('[ Mac ] foo.html [ Failure ] ', modifiers=['MAC'], expectations=['FAIL']) 431 432 def test_unknown_config(self): 433 self.assert_exp('[ Foo ] foo.html ', modifiers=['Foo', 'SKIP'], expectations=['PASS']) 434 435 def test_unknown_expectation(self): 436 self.assert_exp('foo.html [ Audio ]', expectations=['Audio']) 437 438 def test_skip(self): 439 self.assert_exp('foo.html [ Skip ]', modifiers=['SKIP'], expectations=['PASS']) 440 441 def test_slow(self): 442 self.assert_exp('foo.html [ Slow ]', modifiers=['SLOW'], expectations=['PASS']) 443 444 def test_wontfix(self): 445 self.assert_exp('foo.html [ WontFix ]', modifiers=['WONTFIX', 'SKIP'], expectations=['PASS']) 446 447 def test_blank_line(self): 448 self.assert_exp('', name=None) 449 450 def test_warnings(self): 451 self.assert_exp('[ Mac ]', warnings=['Did not find a test name.'], name=None) 452 self.assert_exp('[ [', warnings=['unexpected "["'], name=None) 453 self.assert_exp('crbug.com/12345 ]', warnings=['unexpected "]"'], name=None) 454 455 self.assert_exp('foo.html crbug.com/12345 ]', warnings=['"crbug.com/12345" is not at the start of the line.']) 456 457 405 458 class SemanticTests(Base): 406 459 def test_bug_format(self): … … 490 543 491 544 test_config = test_port.test_configuration() 492 test_port.expectations_dict = lambda: {"expectations": """B UGX LINUX WIN RELEASE : failures/expected/foo.html = FAIL493 B UGY WIN MAC DEBUG : failures/expected/foo.html = CRASH545 test_port.expectations_dict = lambda: {"expectations": """Bug(x) [ Linux Win Release ] failures/expected/foo.html [ Failure ] 546 Bug(y) [ Win Mac Debug ] failures/expected/foo.html [ Crash ] 494 547 """} 495 548 expectations = TestExpectations(test_port, self.get_basic_tests()) … … 497 550 actual_expectations = expectations.remove_configuration_from_test('failures/expected/foo.html', test_config) 498 551 499 self.assertEqual("""B UGX LINUX VISTA WIN7 RELEASE : failures/expected/foo.html = FAIL500 B UGY WIN MAC DEBUG : failures/expected/foo.html = CRASH552 self.assertEqual("""Bug(x) [ Linux Vista Win7 Release ] failures/expected/foo.html [ Failure ] 553 Bug(y) [ Win Mac Debug ] failures/expected/foo.html [ Crash ] 501 554 """, actual_expectations) 502 555 … … 508 561 509 562 test_config = test_port.test_configuration() 510 test_port.expectations_dict = lambda: {'expectations': """B UGX WIN RELEASE : failures/expected/foo.html = FAIL511 B UGY WIN DEBUG : failures/expected/foo.html = CRASH563 test_port.expectations_dict = lambda: {'expectations': """Bug(x) [ Win Release ] failures/expected/foo.html [ Failure ] 564 Bug(y) [ Win Debug ] failures/expected/foo.html [ Crash ] 512 565 """} 513 566 expectations = TestExpectations(test_port) … … 517 570 actual_expectations = expectations.remove_configuration_from_test('failures/expected/foo.html', host.port_factory.get('test-win-win7', None).test_configuration()) 518 571 519 self.assertEqual("""B UGY WIN DEBUG : failures/expected/foo.html = CRASH572 self.assertEqual("""Bug(y) [ Win Debug ] failures/expected/foo.html [ Crash ] 520 573 """, actual_expectations) 521 574 … … 531 584 532 585 def test_remove(self): 533 self.assertRemove('B UGX REBASELINE : failures/expected/text.html = FAIL\n'534 'B UGY : failures/expected/image.html = IMAGE\n'535 'B UGZ REBASELINE : failures/expected/crash.html = CRASH\n',536 'B UGXO : failures/expected/image.html = CRASH\n',586 self.assertRemove('Bug(x) failures/expected/text.html [ Failure Rebaseline ]\n' 587 'Bug(y) failures/expected/image.html [ ImageOnlyFailure Rebaseline ]\n' 588 'Bug(z) failures/expected/crash.html [ Crash ]\n', 589 'Bug(x0) failures/expected/image.html [ Crash ]\n', 537 590 ['failures/expected/text.html'], 538 'B UGY : failures/expected/image.html = IMAGE\n'539 'B UGZ REBASELINE : failures/expected/crash.html = CRASH\n',540 'B UGXO : failures/expected/image.html = CRASH\n')591 'Bug(y) failures/expected/image.html [ ImageOnlyFailure Rebaseline ]\n' 592 'Bug(z) failures/expected/crash.html [ Crash ]\n', 593 'Bug(x0) failures/expected/image.html [ Crash ]\n') 541 594 542 595 … … 545 598 self.assertEqual(len(self._exp.get_rebaselining_failures()), 0) 546 599 600 601 # FIXME: remove most of these tests when we no longer support the old syntax. 547 602 548 603 class TestExpectationParserTests(unittest.TestCase): … … 555 610 self.assertEqual(len(expectation.warnings), 0) 556 611 557 def test_tokenize_missing_colon(self):558 expectation = self._tokenize('Qux.')559 self.assertEqual(str(expectation.warnings), '["Missing a \':\'"]')560 561 612 def test_tokenize_extra_colon(self): 562 613 expectation = self._tokenize('FOO : : bar') 563 self.assertEqual( str(expectation.warnings), '["Extraneous \':\'"]')614 self.assertEqual(expectation.warnings, ['":" is not legal in the new TestExpectations syntax.']) 564 615 565 616 def test_tokenize_empty_comment(self): … … 575 626 def test_tokenize_missing_equal(self): 576 627 expectation = self._tokenize('FOO : bar') 577 self.assertEqual( str(expectation.warnings), "['Missing expectations\']")628 self.assertEqual(expectation.warnings, ['":" is not legal in the new TestExpectations syntax.']) 578 629 579 630 def test_tokenize_extra_equal(self): 580 631 expectation = self._tokenize('FOO : bar = BAZ = Qux.') 581 self.assertEqual( str(expectation.warnings), '["Extraneous \'=\'"]')632 self.assertEqual(expectation.warnings, ['":" is not legal in the new TestExpectations syntax.']) 582 633 583 634 def test_tokenize_valid(self): … … 639 690 640 691 self.assertEqual(expectation.to_string(self._converter), '') 641 expectation.comment = ' Qux.'642 self.assertEqual(expectation.to_string(self._converter), ' //Qux.')692 expectation.comment = ' Qux.' 693 self.assertEqual(expectation.to_string(self._converter), '# Qux.') 643 694 expectation.name = 'bar' 644 self.assertEqual(expectation.to_string(self._converter), ' : bar = //Qux.')695 self.assertEqual(expectation.to_string(self._converter), 'bar # Qux.') 645 696 expectation.modifiers = ['foo'] 646 self.assertEqual(expectation.to_string(self._converter), 'FOO : bar = //Qux.') 697 # FIXME: case should be preserved here but we can't until we drop the old syntax. 698 self.assertEqual(expectation.to_string(self._converter), '[ FOO ] bar # Qux.') 647 699 expectation.expectations = ['bAz'] 648 self.assertEqual(expectation.to_string(self._converter), ' FOO : bar = BAZ //Qux.')700 self.assertEqual(expectation.to_string(self._converter), '[ FOO ] bar [ BAZ ] # Qux.') 649 701 expectation.expectations = ['bAz1', 'baZ2'] 650 self.assertEqual(expectation.to_string(self._converter), ' FOO : bar = BAZ1 BAZ2 //Qux.')702 self.assertEqual(expectation.to_string(self._converter), '[ FOO ] bar [ BAZ1 BAZ2 ] # Qux.') 651 703 expectation.modifiers = ['foo1', 'foO2'] 652 self.assertEqual(expectation.to_string(self._converter), ' FOO1 FOO2 : bar = BAZ1 BAZ2 //Qux.')704 self.assertEqual(expectation.to_string(self._converter), '[ FOO1 FOO2 ] bar [ BAZ1 BAZ2 ] # Qux.') 653 705 expectation.warnings.append('Oh the horror.') 654 706 self.assertEqual(expectation.to_string(self._converter), '') … … 662 714 expectation.modifiers = ['foo'] 663 715 expectation.expectations = ['bAz1', 'baZ2'] 664 self.assertEqual(TestExpectations.list_to_string([expectation]), 'FOO : bar = BAZ1 BAZ2 //Qux.') 716 # FIXME: case should be preserved here but we can't until we drop the old syntax. 717 self.assertEqual(TestExpectations.list_to_string([expectation]), '[ FOO ] bar [ BAZ1 BAZ2 ] #Qux.') 665 718 666 719 def test_parsed_to_string(self): … … 671 724 self.assertEqual(expectation_line.to_string(self._converter), None) 672 725 expectation_line.matching_configurations = set([TestConfiguration('xp', 'x86', 'release')]) 673 self.assertEqual(expectation_line.to_string(self._converter), 'B UGX XP RELEASE : test/name/for/realz.html = IMAGE')726 self.assertEqual(expectation_line.to_string(self._converter), 'Bug(x) [ XP Release ] test/name/for/realz.html [ ImageOnlyFailure ]') 674 727 expectation_line.matching_configurations = set([TestConfiguration('xp', 'x86', 'release'), TestConfiguration('xp', 'x86', 'debug')]) 675 self.assertEqual(expectation_line.to_string(self._converter), 'B UGX XP : test/name/for/realz.html = IMAGE')728 self.assertEqual(expectation_line.to_string(self._converter), 'Bug(x) [ XP ] test/name/for/realz.html [ ImageOnlyFailure ]') 676 729 677 730 def test_serialize_parsed_expectations(self): … … 704 757 705 758 def test_format_line(self): 706 self.assertEqual(TestExpectationLine._format_line( 'modifiers', 'name', 'expectations', 'comment'), 'MODIFIERS : name = EXPECTATIONS //comment')707 self.assertEqual(TestExpectationLine._format_line( 'modifiers', 'name', 'expectations', None), 'MODIFIERS : name = EXPECTATIONS')759 self.assertEqual(TestExpectationLine._format_line(['MODIFIERS'], 'name', ['EXPECTATIONS'], 'comment'), '[ MODIFIERS ] name [ EXPECTATIONS ] #comment') 760 self.assertEqual(TestExpectationLine._format_line(['MODIFIERS'], 'name', ['EXPECTATIONS'], None), '[ MODIFIERS ] name [ EXPECTATIONS ]') 708 761 709 762 def test_string_roundtrip(self): 710 763 self.assert_round_trip('') 711 764 self.assert_round_trip('FOO') 712 self.assert_round_trip(' :')713 self.assert_round_trip('FOO :')714 self.assert_round_trip('FOO :bar')715 self.assert_round_trip(' FOO :')716 self.assert_round_trip(' FOO : bar')717 self.assert_round_trip(' FOO : bar = BAZ')718 self.assert_round_trip(' FOO : bar = BAZ //Qux.')719 self.assert_round_trip(' FOO : bar = BAZ //Qux.')720 self.assert_round_trip(' FOO : bar = BAZ //Qux. ')721 self.assert_round_trip(' FOO : bar = BAZ //Qux. ')722 self.assert_round_trip(' FOO : : bar =BAZ')723 self.assert_round_trip(' FOO : : bar = BAZ')724 self.assert_round_trip('FOO : :bar ==== BAZ')765 self.assert_round_trip('[') 766 self.assert_round_trip('FOO [') 767 self.assert_round_trip('FOO ] bar') 768 self.assert_round_trip(' FOO [') 769 self.assert_round_trip(' [ FOO ] ') 770 self.assert_round_trip('[ FOO ] bar [ BAZ ]') 771 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.') 772 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.') 773 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux. ') 774 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux. ') 775 self.assert_round_trip('[ FOO ] ] ] bar BAZ') 776 self.assert_round_trip('[ FOO ] ] ] bar [ BAZ ]') 777 self.assert_round_trip('FOO ] ] bar ==== BAZ') 725 778 self.assert_round_trip('=') 726 self.assert_round_trip(' //')727 self.assert_round_trip(' //')728 self.assert_round_trip(' //Foo')729 self.assert_round_trip(' //Foo')730 self.assert_round_trip(' //Foo :')731 self.assert_round_trip(' //Foo : =')779 self.assert_round_trip('#') 780 self.assert_round_trip('# ') 781 self.assert_round_trip('# Foo') 782 self.assert_round_trip('# Foo') 783 self.assert_round_trip('# Foo :') 784 self.assert_round_trip('# Foo : =') 732 785 733 786 def test_list_roundtrip(self): … … 736 789 self.assert_list_round_trip('\n\n') 737 790 self.assert_list_round_trip('bar') 738 self.assert_list_round_trip('bar\n //Qux.')739 self.assert_list_round_trip('bar\n //Qux.\n')791 self.assert_list_round_trip('bar\n# Qux.') 792 self.assert_list_round_trip('bar\n# Qux.\n') 740 793 741 794 def test_reconstitute_only_these(self): … … 757 810 add_line(set([TestConfiguration('xp', 'x86', 'release'), TestConfiguration('xp', 'x86', 'debug')]), False) 758 811 serialized = TestExpectations.list_to_string(lines, self._converter) 759 self.assertEquals(serialized, "B UGX XP RELEASE : Yay = IMAGE\nBUGX XP : Yay = IMAGE")812 self.assertEquals(serialized, "Bug(x) [ XP Release ] Yay [ ImageOnlyFailure ]\nBug(x) [ XP ] Yay [ ImageOnlyFailure ]") 760 813 serialized = TestExpectations.list_to_string(lines, self._converter, reconstitute_only_these=reconstitute_only_these) 761 self.assertEquals(serialized, "B UGX XP RELEASE : Yay = IMAGE\nNay")814 self.assertEquals(serialized, "Bug(x) [ XP Release ] Yay [ ImageOnlyFailure ]\nNay") 762 815 763 816 def test_string_whitespace_stripping(self): 764 817 self.assert_round_trip('\n', '') 765 self.assert_round_trip(' FOO : bar = BAZ', 'FOO : bar = BAZ')766 self.assert_round_trip(' FOO : bar = BAZ', 'FOO : bar = BAZ')767 self.assert_round_trip(' FOO : bar = BAZ // Qux.', 'FOO : bar = BAZ //Qux.')768 self.assert_round_trip(' FOO : bar = BAZ // Qux.', 'FOO : bar = BAZ //Qux.')769 self.assert_round_trip(' FOO : bar = BAZ // Qux.', 'FOO : bar = BAZ //Qux.')770 self.assert_round_trip(' FOO : bar = BAZ // Qux.', 'FOO : bar = BAZ //Qux.')818 self.assert_round_trip(' [ FOO ] bar [ BAZ ]', '[ FOO ] bar [ BAZ ]') 819 self.assert_round_trip('[ FOO ] bar [ BAZ ]', '[ FOO ] bar [ BAZ ]') 820 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FOO ] bar [ BAZ ] # Qux.') 821 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FOO ] bar [ BAZ ] # Qux.') 822 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FOO ] bar [ BAZ ] # Qux.') 823 self.assert_round_trip('[ FOO ] bar [ BAZ ] # Qux.', '[ FOO ] bar [ BAZ ] # Qux.') 771 824 772 825 -
trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
r129047 r129052 261 261 host = MockHost() 262 262 port_obj = host.port_factory.get(options.platform, options=options) 263 port_obj.expectations_dict = lambda: {'': ' #syntax error'}263 port_obj.expectations_dict = lambda: {'': '-- syntax error'} 264 264 res, out, err = run_and_capture(port_obj, options, parsed_args) 265 265 -
trunk/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py
r129047 r129052 179 179 self.run_test(['failures/expected/text.html', 'failures/expected/image.html'], 180 180 ('// For test-win-xp\n' 181 'failures/expected/image.html = IMAGE\n'182 'failures/expected/text.html = FAIL\n'))181 'failures/expected/image.html [ ImageOnlyFailure WontFix ]\n' 182 'failures/expected/text.html [ Failure WontFix ]\n')) 183 183 184 184 def test_multiple(self): 185 185 self.run_test(['failures/expected/text.html', 'failures/expected/image.html'], 186 186 ('// For test-win-vista\n' 187 'failures/expected/image.html = IMAGE\n'188 'failures/expected/text.html = FAIL\n'187 'failures/expected/image.html [ ImageOnlyFailure WontFix ]\n' 188 'failures/expected/text.html [ Failure WontFix ]\n' 189 189 '\n' 190 190 '// For test-win-win7\n' 191 'failures/expected/image.html = IMAGE\n'192 'failures/expected/text.html = FAIL\n'191 'failures/expected/image.html [ ImageOnlyFailure WontFix ]\n' 192 'failures/expected/text.html [ Failure WontFix ]\n' 193 193 '\n' 194 194 '// For test-win-xp\n' 195 'failures/expected/image.html = IMAGE\n'196 'failures/expected/text.html = FAIL\n'),195 'failures/expected/image.html [ ImageOnlyFailure WontFix ]\n' 196 'failures/expected/text.html [ Failure WontFix ]\n'), 197 197 platform='test-win-*') 198 198 … … 200 200 self.run_test(['failures/expected/text.html', 'failures/expected/image.html'], 201 201 ('// For test-win-xp\n' 202 ' WONTFIX : failures/expected/image.html = IMAGE\n'203 ' WONTFIX : failures/expected/text.html = FAIL\n'),202 'failures/expected/image.html [ ImageOnlyFailure WontFix ]\n' 203 'failures/expected/text.html [ Failure WontFix ]\n'), 204 204 full=True) 205 205 … … 207 207 self.run_test(['failures/expected/text.html', 'failures/expected/image.html'], 208 208 ('// For test-win-xp\n' 209 'failures/expected/text.html = FAIL\n'),209 'failures/expected/text.html [ Failure WontFix ]\n'), 210 210 exclude_keyword=['image']) 211 211 -
trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
r127058 r129052 357 357 self._add_tests_to_rebaseline_for_port(port_name) 358 358 if not self._test_list: 359 _log.warning("Did not find any tests marked R EBASELINE.")359 _log.warning("Did not find any tests marked Rebaseline.") 360 360 return 361 361 -
trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
r129047 r129052 68 68 for path in lion_port.expectations_files(): 69 69 tool.filesystem.write_text_file(path, '') 70 tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), """B UGB MAC LINUX XP DEBUG : fast/dom/Window/window-postmessage-clone-really-deep-array.html = PASS71 B UGA DEBUG : fast/css/large-list-of-rules-crash.html = FAIL70 tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), """Bug(B) [ Mac Linux XP Debug ] fast/dom/Window/window-postmessage-clone-really-deep-array.html [ Pass ] 71 Bug(A) [ Debug ] : fast/css/large-list-of-rules-crash.html [ Failure ] 72 72 """) 73 73 tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "fast/dom/Window/window-postmessage-clone-really-deep-array.html"), "Dummy test contents") … … 82 82 83 83 new_expectations = tool.filesystem.read_text_file(lion_port.path_to_test_expectations_file()) 84 self.assertEqual(new_expectations, """B UGB MAC LINUX XP DEBUG : fast/dom/Window/window-postmessage-clone-really-deep-array.html = PASS85 B UGA DEBUG : fast/css/large-list-of-rules-crash.html = FAIL84 self.assertEqual(new_expectations, """Bug(B) [ Mac Linux XP Debug ] fast/dom/Window/window-postmessage-clone-really-deep-array.html [ Pass ] 85 Bug(A) [ Debug ] : fast/css/large-list-of-rules-crash.html [ Failure ] 86 86 """) 87 87 … … 93 93 lion_port = tool.port_factory.get_from_builder_name("Webkit Mac10.7") 94 94 tool.filesystem.write_text_file(lion_port.path_from_chromium_base('skia', 'skia_test_expectations.txt'), '') 95 tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), "B UGX MAC : userscripts/another-test.html = IMAGE\nBUGZ LINUX : userscripts/another-test.html = IMAGE\n")95 tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), "Bug(x) [ Mac ] userscripts/another-test.html [ ImageOnlyFailure ]\nbug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n") 96 96 tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "userscripts/another-test.html"), "Dummy test contents") 97 97 … … 103 103 104 104 new_expectations = tool.filesystem.read_text_file(lion_port.path_to_test_expectations_file()) 105 self.assertEqual(new_expectations, "B UGX SNOWLEOPARD : userscripts/another-test.html = IMAGE\nBUGZ LINUX : userscripts/another-test.html = IMAGE\n")105 self.assertEqual(new_expectations, "Bug(x) [ SnowLeopard ] userscripts/another-test.html [ ImageOnlyFailure ]\nbug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n") 106 106 107 107 def test_rebaseline_does_not_include_overrides(self): … … 112 112 lion_port = tool.port_factory.get_from_builder_name("Webkit Mac10.7") 113 113 tool.filesystem.write_text_file(lion_port.path_from_chromium_base('skia', 'skia_test_expectations.txt'), '') 114 tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), "B UGX MAC : userscripts/another-test.html = IMAGE\nBUGZ LINUX : userscripts/another-test.html = IMAGE\n")115 tool.filesystem.write_text_file(lion_port.path_from_chromium_base('skia', 'skia_test_expectations.txt'), "B UGY MAC : other-test.html = FAIL\n")114 tool.filesystem.write_text_file(lion_port.path_to_test_expectations_file(), "Bug(x) [ Mac ] userscripts/another-test.html [ ImageOnlyFailure ]\nBug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n") 115 tool.filesystem.write_text_file(lion_port.path_from_chromium_base('skia', 'skia_test_expectations.txt'), "Bug(y) [ Mac ] other-test.html [ Failure ]\n") 116 116 tool.filesystem.write_text_file(os.path.join(lion_port.layout_tests_dir(), "userscripts/another-test.html"), "Dummy test contents") 117 117 … … 123 123 124 124 new_expectations = tool.filesystem.read_text_file(lion_port.path_to_test_expectations_file()) 125 self.assertEqual(new_expectations, "B UGX SNOWLEOPARD : userscripts/another-test.html = IMAGE\nBUGZ LINUX : userscripts/another-test.html = IMAGE\n")125 self.assertEqual(new_expectations, "Bug(x) [ SnowLeopard ] userscripts/another-test.html [ ImageOnlyFailure ]\nBug(z) [ Linux ] userscripts/another-test.html [ ImageOnlyFailure ]\n") 126 126 127 127 def test_rebaseline_test(self): … … 332 332 333 333 def test_rebaseline_expectations_noop(self): 334 self._assert_command(RebaselineExpectations(), expected_logs='Did not find any tests marked R EBASELINE.\n')334 self._assert_command(RebaselineExpectations(), expected_logs='Did not find any tests marked Rebaseline.\n') 335 335 336 336 def test_overrides_are_included_correctly(self): … … 347 347 port.expectations_dict = lambda: { 348 348 expectations_path: expectations_contents, 349 'overrides': ('B UGX REBASELINE : userscripts/another-test.html = FAIL\n'350 'B UGY : userscripts/test.html = CRASH\n')}349 'overrides': ('Bug(x) userscripts/another-test.html [ Failure Rebaseline ]\n' 350 'Bug(y) userscripts/test.html [ Crash ]\n')} 351 351 352 352 for path in port.expectations_files():
Note: See TracChangeset
for help on using the changeset viewer.