Changeset 126334 in webkit
- Timestamp:
- Aug 22, 2012 12:32:41 PM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r126332 r126334 1 2012-08-21 Ryosuke Niwa <rniwa@webkit.org> 2 3 Merge TestExpectationSerializer into TestExpectationLine 4 https://bugs.webkit.org/show_bug.cgi?id=94638 5 6 Reviewed by Dimitri Glazkov. 7 8 Moved all methods except, list_to_string which was moved to TestExpectations 9 from TestExpectationSerializer to TestExpectationLine and removed TestExpectationSerializer. 10 11 * Scripts/webkitpy/layout_tests/controllers/test_expectations_editor_unittest.py: 12 (TestExpectationEditorTests.assert_remove_roundtrip): 13 (TestExpectationEditorTests.assert_update_roundtrip): 14 * Scripts/webkitpy/layout_tests/models/test_expectations.py: 15 (ParseError.__repr__): 16 (TestExpectationLine): 17 (TestExpectationLine.create_passing_expectation): 18 (TestExpectationLine.to_string): Moved from TestExpectationSerializer. 19 (TestExpectationLine.to_csv): Ditto. 20 (TestExpectationLine._serialize_parsed_expectations): Ditto. 21 (TestExpectationLine._serialize_parsed_modifiers): Ditto. 22 (TestExpectationLine._format_line): 23 (TestExpectations.remove_configuration_from_test): 24 (TestExpectations.remove_rebaselined_tests): 25 (TestExpectations.add_skipped_tests): 26 (TestExpectations): 27 (TestExpectations.list_to_string): Moved from TestExpectationSerializer. 28 (TestExpectations.list_to_string.serialize): 29 (TestExpectations.list_to_string.nones_out): 30 * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: 31 (TestExpectationSerializationTests): Renamed from TestExpectationSerializerTests. 32 (TestExpectationSerializationTests.__init__): 33 (TestExpectationSerializationTests.assert_round_trip): 34 (TestExpectationSerializationTests.assert_list_round_trip): 35 (TestExpectationSerializationTests.test_unparsed_to_string): 36 (TestExpectationSerializationTests.test_unparsed_list_to_string): 37 (TestExpectationSerializationTests.test_parsed_to_string): 38 (TestExpectationSerializationTests.test_serialize_parsed_expectations): 39 (TestExpectationSerializationTests.test_serialize_parsed_modifier_string): 40 (TestExpectationSerializationTests.test_format_line): 41 (TestExpectationSerializationTests.test_reconstitute_only_these): 42 * Scripts/webkitpy/tool/commands/expectations.py: 43 (OptimizeExpectations.execute): 44 * Scripts/webkitpy/tool/commands/queries.py: 45 (PrintExpectations.execute): 46 (PrintExpectations._format_lines): 47 * Scripts/webkitpy/tool/servers/gardeningserver.py: 48 (GardeningExpectationsUpdater.update_expectations): 49 1 50 2012-08-22 Alexandre Elias <aelias@chromium.org> 2 51 -
trunk/Tools/Scripts/webkitpy/layout_tests/controllers/test_expectations_editor_unittest.py
r120371 r126334 89 89 editor.remove_expectation(test, test_config_set, remove_flakes) 90 90 converter = TestConfigurationConverter(self.test_port.all_test_configurations(), self.test_port.configuration_specifier_macros()) 91 result = TestExpectation Serializer.list_to_string(expectation_lines, converter)91 result = TestExpectations.list_to_string(expectation_lines, converter) 92 92 self.assertEquals(result, expected_string) 93 93 … … 101 101 self.assertEquals(len(updated_expectation_lines), expected_update_count) 102 102 converter = TestConfigurationConverter(self.test_port.all_test_configurations(), self.test_port.configuration_specifier_macros()) 103 result = TestExpectation Serializer.list_to_string(expectation_lines, converter)103 result = TestExpectations.list_to_string(expectation_lines, converter) 104 104 self.assertEquals(result, expected_string) 105 105 … … 189 189 190 190 editor.remove_expectation(test, set([TestConfiguration('xp', 'x86', 'release')])) 191 self.assertEquals(TestExpectation Serializer.list_to_string(expectation_lines, converter), """191 self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ 192 192 BUGX1 XP DEBUG : failures/expected/keyboard.html = IMAGE 193 193 BUGX1 VISTA WIN7 : failures/expected/keyboard.html = IMAGE … … 195 195 196 196 editor.remove_expectation(test, set([TestConfiguration('xp', 'x86', 'debug')])) 197 self.assertEquals(TestExpectation Serializer.list_to_string(expectation_lines, converter), """197 self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ 198 198 BUGX1 VISTA WIN7 : failures/expected/keyboard.html = IMAGE 199 199 BUGX2 WIN : failures/expected/audio.html = IMAGE""") 200 200 201 201 editor.remove_expectation(test, set([TestConfiguration('vista', 'x86', 'debug'), TestConfiguration('win7', 'x86', 'release')])) 202 self.assertEquals(TestExpectation Serializer.list_to_string(expectation_lines, converter), """202 self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ 203 203 BUGX1 VISTA RELEASE : failures/expected/keyboard.html = IMAGE 204 204 BUGX1 WIN7 DEBUG : failures/expected/keyboard.html = IMAGE … … 206 206 207 207 editor.remove_expectation(test, set([TestConfiguration('vista', 'x86', 'debug'), TestConfiguration('vista', 'x86', 'release')])) 208 self.assertEquals(TestExpectation Serializer.list_to_string(expectation_lines, converter), """208 self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ 209 209 BUGX1 WIN7 DEBUG : failures/expected/keyboard.html = IMAGE 210 210 BUGX2 WIN : failures/expected/audio.html = IMAGE""") 211 211 212 212 editor.remove_expectation(test, set(self.test_port.all_test_configurations())) 213 self.assertEquals(TestExpectation Serializer.list_to_string(expectation_lines, converter), """213 self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ 214 214 BUGX2 WIN : failures/expected/audio.html = IMAGE""") 215 215 … … 217 217 218 218 editor.remove_expectation(test, set(self.test_port.all_test_configurations())) 219 self.assertEquals(TestExpectation Serializer.list_to_string(expectation_lines, converter), "")219 self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), "") 220 220 221 221 def test_update_expectation(self): … … 307 307 308 308 editor.update_expectation(test, set([TestConfiguration('xp', 'x86', 'release')]), set([IMAGE_PLUS_TEXT]), ['BUG_UPDATE1']) 309 self.assertEquals(TestExpectation Serializer.list_to_string(expectation_lines, converter), """309 self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ 310 310 BUGX1 XP DEBUG : failures/expected/keyboard.html = IMAGE 311 311 BUGX1 VISTA WIN7 : failures/expected/keyboard.html = IMAGE … … 314 314 315 315 editor.update_expectation(test, set([TestConfiguration('xp', 'x86', 'debug')]), set([TEXT]), ['BUG_UPDATE2']) 316 self.assertEquals(TestExpectation Serializer.list_to_string(expectation_lines, converter), """316 self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ 317 317 BUGX1 VISTA WIN7 : failures/expected/keyboard.html = IMAGE 318 318 BUG_UPDATE2 XP DEBUG : failures/expected/keyboard.html = TEXT … … 321 321 322 322 editor.update_expectation(test, self.WIN_RELEASE_CONFIGS, set([CRASH]), ['BUG_UPDATE3']) 323 self.assertEquals(TestExpectation Serializer.list_to_string(expectation_lines, converter), """323 self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ 324 324 BUGX1 VISTA WIN7 DEBUG : failures/expected/keyboard.html = IMAGE 325 325 BUG_UPDATE2 XP DEBUG : failures/expected/keyboard.html = TEXT … … 328 328 329 329 editor.update_expectation(test, self.RELEASE_CONFIGS, set([IMAGE_PLUS_TEXT]), ['BUG_UPDATE4']) 330 self.assertEquals(TestExpectation Serializer.list_to_string(expectation_lines, converter), """330 self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ 331 331 BUGX1 VISTA WIN7 DEBUG : failures/expected/keyboard.html = IMAGE 332 332 BUG_UPDATE2 XP DEBUG : failures/expected/keyboard.html = TEXT … … 335 335 336 336 editor.update_expectation(test, set(self.test_port.all_test_configurations()), set([TIMEOUT]), ['BUG_UPDATE5']) 337 self.assertEquals(TestExpectation Serializer.list_to_string(expectation_lines, converter), """337 self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ 338 338 BUG_UPDATE5 : failures/expected/keyboard.html = TIMEOUT 339 339 BUGX2 WIN : failures/expected/audio.html = IMAGE""") -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
r126184 r126334 62 62 63 63 64 class TestExpectationSerializer(object):65 """Provides means of serializing TestExpectationLine instances."""66 def __init__(self, test_configuration_converter=None):67 self._test_configuration_converter = test_configuration_converter68 self._parsed_expectation_to_string = dict([[parsed_expectation, expectation_string] for expectation_string, parsed_expectation in TestExpectations.EXPECTATIONS.items()])69 70 def to_string(self, expectation_line, include_modifiers=True, include_expectations=True, include_comment=True):71 if expectation_line.is_invalid():72 return expectation_line.original_string or ''73 74 if expectation_line.name is None:75 return '' if expectation_line.comment is None else "//%s" % expectation_line.comment76 77 if self._test_configuration_converter and expectation_line.parsed_bug_modifiers:78 specifiers_list = self._test_configuration_converter.to_specifiers_list(expectation_line.matching_configurations)79 result = []80 for specifiers in specifiers_list:81 modifiers = self._parsed_modifier_string(expectation_line, specifiers)82 expectations = self._parsed_expectations_string(expectation_line)83 result.append(self._format_result(modifiers, expectation_line.name, expectations, expectation_line.comment))84 return "\n".join(result) if result else None85 86 return self._format_result(" ".join(expectation_line.modifiers),87 expectation_line.name,88 " ".join(expectation_line.expectations),89 expectation_line.comment,90 include_modifiers, include_expectations, include_comment)91 92 def to_csv(self, expectation_line):93 # Note that this doesn't include the comments.94 return '%s,%s,%s' % (expectation_line.name, ' '.join(expectation_line.modifiers), ' '.join(expectation_line.expectations))95 96 def _parsed_expectations_string(self, expectation_line):97 result = []98 for index in TestExpectations.EXPECTATION_ORDER:99 if index in expectation_line.parsed_expectations:100 result.append(self._parsed_expectation_to_string[index])101 return ' '.join(result)102 103 def _parsed_modifier_string(self, expectation_line, specifiers):104 assert(self._test_configuration_converter)105 result = []106 if expectation_line.parsed_bug_modifiers:107 result.extend(sorted(expectation_line.parsed_bug_modifiers))108 result.extend(sorted(expectation_line.parsed_modifiers))109 result.extend(self._test_configuration_converter.specifier_sorter().sort_specifiers(specifiers))110 return ' '.join(result)111 112 @classmethod113 def _format_result(cls, modifiers, name, expectations, comment, include_modifiers=True, include_expectations=True, include_comment=True):114 result = ''115 if include_modifiers:116 result += '%s : ' % modifiers.upper()117 result += name118 if include_expectations:119 result += ' = %s' % expectations.upper()120 if include_comment and comment is not None:121 result += " //%s" % comment122 return result123 124 @classmethod125 def list_to_string(cls, expectation_lines, test_configuration_converter=None, reconstitute_only_these=None):126 serializer = cls(test_configuration_converter)127 128 def serialize(expectation_line):129 # If reconstitute_only_these is an empty list, we want to return original_string.130 # So we need to compare reconstitute_only_these to None, not just check if it's falsey.131 if reconstitute_only_these is None or expectation_line in reconstitute_only_these:132 return serializer.to_string(expectation_line)133 return expectation_line.original_string134 135 def nones_out(expectation_line):136 return expectation_line is not None137 138 return "\n".join(filter(nones_out, map(serialize, expectation_lines)))139 140 141 64 class TestExpectationParser(object): 142 65 """Provides parsing facilities for lines in the test_expectation.txt file.""" … … 353 276 return len(self.parsed_expectations) > 1 354 277 355 @ classmethod356 def create_passing_expectation( cls,test):278 @staticmethod 279 def create_passing_expectation(test): 357 280 expectation_line = TestExpectationLine() 358 281 expectation_line.name = test … … 362 285 expectation_line.matching_tests = [test] 363 286 return expectation_line 287 288 def to_string(self, test_configuration_converter, include_modifiers=True, include_expectations=True, include_comment=True): 289 parsed_expectation_to_string = dict([[parsed_expectation, expectation_string] for expectation_string, parsed_expectation in TestExpectations.EXPECTATIONS.items()]) 290 291 if self.is_invalid(): 292 return self.original_string or '' 293 294 if self.name is None: 295 return '' if self.comment is None else "//%s" % self.comment 296 297 if test_configuration_converter and self.parsed_bug_modifiers: 298 specifiers_list = test_configuration_converter.to_specifiers_list(self.matching_configurations) 299 result = [] 300 for specifiers in specifiers_list: 301 modifiers = self._serialize_parsed_modifiers(test_configuration_converter, specifiers) 302 expectations = self._serialize_parsed_expectations(parsed_expectation_to_string) 303 result.append(self._format_line(modifiers, self.name, expectations, self.comment)) 304 return "\n".join(result) if result else None 305 306 return self._format_line(" ".join(self.modifiers), self.name, " ".join(self.expectations), self.comment, 307 include_modifiers, include_expectations, include_comment) 308 309 def to_csv(self): 310 # Note that this doesn't include the comments. 311 return '%s,%s,%s' % (self.name, ' '.join(self.modifiers), ' '.join(self.expectations)) 312 313 def _serialize_parsed_expectations(self, parsed_expectation_to_string): 314 result = [] 315 for index in TestExpectations.EXPECTATION_ORDER: 316 if index in self.parsed_expectations: 317 result.append(parsed_expectation_to_string[index]) 318 return ' '.join(result) 319 320 def _serialize_parsed_modifiers(self, test_configuration_converter, specifiers): 321 result = [] 322 if self.parsed_bug_modifiers: 323 result.extend(sorted(self.parsed_bug_modifiers)) 324 result.extend(sorted(self.parsed_modifiers)) 325 result.extend(test_configuration_converter.specifier_sorter().sort_specifiers(specifiers)) 326 return ' '.join(result) 327 328 @staticmethod 329 def _format_line(modifiers, name, expectations, comment, include_modifiers=True, include_expectations=True, include_comment=True): 330 result = '' 331 if include_modifiers: 332 result += '%s : ' % modifiers.upper() 333 result += name 334 if include_expectations: 335 result += ' = %s' % expectations.upper() 336 if include_comment and comment is not None: 337 result += " //%s" % comment 338 return result 364 339 365 340 … … 843 818 self._expectations.remove(expectation) 844 819 845 return TestExpectationSerializer.list_to_string(self._expectations, self._parser._test_configuration_converter, modified_expectations)820 return self.list_to_string(self._expectations, self._parser._test_configuration_converter, modified_expectations) 846 821 847 822 def remove_rebaselined_tests(self, except_these_tests, filename): … … 853 828 filename == expectation.filename) 854 829 855 return TestExpectationSerializer.list_to_string(filter(without_rebaseline_modifier, self._expectations))830 return self.list_to_string(filter(without_rebaseline_modifier, self._expectations)) 856 831 857 832 def _add_expectations(self, expectation_list): … … 873 848 expectation_line = self._parser.expectation_for_skipped_test(test_name) 874 849 self._model.add_expectation_line(expectation_line, in_skipped=True) 850 851 @staticmethod 852 def list_to_string(expectation_lines, test_configuration_converter=None, reconstitute_only_these=None): 853 def serialize(expectation_line): 854 # If reconstitute_only_these is an empty list, we want to return original_string. 855 # So we need to compare reconstitute_only_these to None, not just check if it's falsey. 856 if reconstitute_only_these is None or expectation_line in reconstitute_only_these: 857 return expectation_line.to_string(test_configuration_converter) 858 return expectation_line.original_string 859 860 def nones_out(expectation_line): 861 return expectation_line is not None 862 863 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
r126184 r126334 545 545 546 546 547 class TestExpectationSerializ erTests(unittest.TestCase):547 class TestExpectationSerializationTests(unittest.TestCase): 548 548 def __init__(self, testFunc): 549 549 host = MockHost() 550 550 test_port = host.port_factory.get('test-win-xp', None) 551 551 self._converter = TestConfigurationConverter(test_port.all_test_configurations(), test_port.configuration_specifier_macros()) 552 self._serializer = TestExpectationSerializer(self._converter)553 552 unittest.TestCase.__init__(self, testFunc) 554 553 … … 560 559 if expected_string is None: 561 560 expected_string = in_string 562 self.assertEqual(expected_string, self._serializer.to_string(expectation))561 self.assertEqual(expected_string, expectation.to_string(self._converter)) 563 562 564 563 def assert_list_round_trip(self, in_string, expected_string=None): … … 568 567 if expected_string is None: 569 568 expected_string = in_string 570 self.assertEqual(expected_string, TestExpectation Serializer.list_to_string(expectations, self._converter))569 self.assertEqual(expected_string, TestExpectations.list_to_string(expectations, self._converter)) 571 570 572 571 def test_unparsed_to_string(self): 573 572 expectation = TestExpectationLine() 574 serializer = TestExpectationSerializer() 575 576 self.assertEqual(serializer.to_string(expectation), '') 573 574 self.assertEqual(expectation.to_string(self._converter), '') 577 575 expectation.comment = 'Qux.' 578 self.assertEqual( serializer.to_string(expectation), '//Qux.')576 self.assertEqual(expectation.to_string(self._converter), '//Qux.') 579 577 expectation.name = 'bar' 580 self.assertEqual( serializer.to_string(expectation), ' : bar = //Qux.')578 self.assertEqual(expectation.to_string(self._converter), ' : bar = //Qux.') 581 579 expectation.modifiers = ['foo'] 582 self.assertEqual( serializer.to_string(expectation), 'FOO : bar = //Qux.')580 self.assertEqual(expectation.to_string(self._converter), 'FOO : bar = //Qux.') 583 581 expectation.expectations = ['bAz'] 584 self.assertEqual( serializer.to_string(expectation), 'FOO : bar = BAZ //Qux.')582 self.assertEqual(expectation.to_string(self._converter), 'FOO : bar = BAZ //Qux.') 585 583 expectation.expectations = ['bAz1', 'baZ2'] 586 self.assertEqual( serializer.to_string(expectation), 'FOO : bar = BAZ1 BAZ2 //Qux.')584 self.assertEqual(expectation.to_string(self._converter), 'FOO : bar = BAZ1 BAZ2 //Qux.') 587 585 expectation.modifiers = ['foo1', 'foO2'] 588 self.assertEqual( serializer.to_string(expectation), 'FOO1 FOO2 : bar = BAZ1 BAZ2 //Qux.')586 self.assertEqual(expectation.to_string(self._converter), 'FOO1 FOO2 : bar = BAZ1 BAZ2 //Qux.') 589 587 expectation.warnings.append('Oh the horror.') 590 self.assertEqual( serializer.to_string(expectation), '')588 self.assertEqual(expectation.to_string(self._converter), '') 591 589 expectation.original_string = 'Yes it is!' 592 self.assertEqual( serializer.to_string(expectation), 'Yes it is!')590 self.assertEqual(expectation.to_string(self._converter), 'Yes it is!') 593 591 594 592 def test_unparsed_list_to_string(self): … … 598 596 expectation.modifiers = ['foo'] 599 597 expectation.expectations = ['bAz1', 'baZ2'] 600 self.assertEqual(TestExpectation Serializer.list_to_string([expectation]), 'FOO : bar = BAZ1 BAZ2 //Qux.')598 self.assertEqual(TestExpectations.list_to_string([expectation]), 'FOO : bar = BAZ1 BAZ2 //Qux.') 601 599 602 600 def test_parsed_to_string(self): … … 605 603 expectation_line.name = 'test/name/for/realz.html' 606 604 expectation_line.parsed_expectations = set([IMAGE]) 607 self.assertEqual( self._serializer.to_string(expectation_line), None)605 self.assertEqual(expectation_line.to_string(self._converter), None) 608 606 expectation_line.matching_configurations = set([TestConfiguration('xp', 'x86', 'release')]) 609 self.assertEqual( self._serializer.to_string(expectation_line), 'BUGX XP RELEASE : test/name/for/realz.html = IMAGE')607 self.assertEqual(expectation_line.to_string(self._converter), 'BUGX XP RELEASE : test/name/for/realz.html = IMAGE') 610 608 expectation_line.matching_configurations = set([TestConfiguration('xp', 'x86', 'release'), TestConfiguration('xp', 'x86', 'debug')]) 611 self.assertEqual( self._serializer.to_string(expectation_line), 'BUGX XP : test/name/for/realz.html = IMAGE')612 613 def test_ parsed_expectations_string(self):609 self.assertEqual(expectation_line.to_string(self._converter), 'BUGX XP : test/name/for/realz.html = IMAGE') 610 611 def test_serialize_parsed_expectations(self): 614 612 expectation_line = TestExpectationLine() 615 613 expectation_line.parsed_expectations = set([]) 616 self.assertEqual(self._serializer._parsed_expectations_string(expectation_line), '') 614 parsed_expectation_to_string = dict([[parsed_expectation, expectation_string] for expectation_string, parsed_expectation in TestExpectations.EXPECTATIONS.items()]) 615 self.assertEqual(expectation_line._serialize_parsed_expectations(parsed_expectation_to_string), '') 617 616 expectation_line.parsed_expectations = set([IMAGE_PLUS_TEXT]) 618 self.assertEqual( self._serializer._parsed_expectations_string(expectation_line), 'image+text')617 self.assertEqual(expectation_line._serialize_parsed_expectations(parsed_expectation_to_string), 'image+text') 619 618 expectation_line.parsed_expectations = set([PASS, IMAGE]) 620 self.assertEqual( self._serializer._parsed_expectations_string(expectation_line), 'pass image')619 self.assertEqual(expectation_line._serialize_parsed_expectations(parsed_expectation_to_string), 'pass image') 621 620 expectation_line.parsed_expectations = set([TEXT, PASS]) 622 self.assertEqual( self._serializer._parsed_expectations_string(expectation_line), 'pass text')623 624 def test_ parsed_modifier_string(self):621 self.assertEqual(expectation_line._serialize_parsed_expectations(parsed_expectation_to_string), 'pass text') 622 623 def test_serialize_parsed_modifier_string(self): 625 624 expectation_line = TestExpectationLine() 626 625 expectation_line.parsed_bug_modifiers = ['garden-o-matic'] 627 626 expectation_line.parsed_modifiers = ['for', 'the'] 628 self.assertEqual( self._serializer._parsed_modifier_string(expectation_line, []), 'garden-o-matic for the')629 self.assertEqual( self._serializer._parsed_modifier_string(expectation_line, ['win']), 'garden-o-matic for the win')627 self.assertEqual(expectation_line._serialize_parsed_modifiers(self._converter, []), 'garden-o-matic for the') 628 self.assertEqual(expectation_line._serialize_parsed_modifiers(self._converter, ['win']), 'garden-o-matic for the win') 630 629 expectation_line.parsed_bug_modifiers = [] 631 630 expectation_line.parsed_modifiers = [] 632 self.assertEqual( self._serializer._parsed_modifier_string(expectation_line, []), '')633 self.assertEqual( self._serializer._parsed_modifier_string(expectation_line, ['win']), 'win')631 self.assertEqual(expectation_line._serialize_parsed_modifiers(self._converter, []), '') 632 self.assertEqual(expectation_line._serialize_parsed_modifiers(self._converter, ['win']), 'win') 634 633 expectation_line.parsed_bug_modifiers = ['garden-o-matic', 'total', 'is'] 635 self.assertEqual( self._serializer._parsed_modifier_string(expectation_line, ['win']), 'garden-o-matic is total win')634 self.assertEqual(expectation_line._serialize_parsed_modifiers(self._converter, ['win']), 'garden-o-matic is total win') 636 635 expectation_line.parsed_bug_modifiers = [] 637 636 expectation_line.parsed_modifiers = ['garden-o-matic', 'total', 'is'] 638 self.assertEqual( self._serializer._parsed_modifier_string(expectation_line, ['win']), 'garden-o-matic is total win')639 640 def test_format_ result(self):641 self.assertEqual(TestExpectation Serializer._format_result('modifiers', 'name', 'expectations', 'comment'), 'MODIFIERS : name = EXPECTATIONS //comment')642 self.assertEqual(TestExpectation Serializer._format_result('modifiers', 'name', 'expectations', None), 'MODIFIERS : name = EXPECTATIONS')637 self.assertEqual(expectation_line._serialize_parsed_modifiers(self._converter, ['win']), 'garden-o-matic is total win') 638 639 def test_format_line(self): 640 self.assertEqual(TestExpectationLine._format_line('modifiers', 'name', 'expectations', 'comment'), 'MODIFIERS : name = EXPECTATIONS //comment') 641 self.assertEqual(TestExpectationLine._format_line('modifiers', 'name', 'expectations', None), 'MODIFIERS : name = EXPECTATIONS') 643 642 644 643 def test_string_roundtrip(self): … … 691 690 add_line(set([TestConfiguration('xp', 'x86', 'release')]), True) 692 691 add_line(set([TestConfiguration('xp', 'x86', 'release'), TestConfiguration('xp', 'x86', 'debug')]), False) 693 serialized = TestExpectation Serializer.list_to_string(lines, self._converter)692 serialized = TestExpectations.list_to_string(lines, self._converter) 694 693 self.assertEquals(serialized, "BUGX XP RELEASE : Yay = IMAGE\nBUGX XP : Yay = IMAGE") 695 serialized = TestExpectation Serializer.list_to_string(lines, self._converter, reconstitute_only_these=reconstitute_only_these)694 serialized = TestExpectations.list_to_string(lines, self._converter, reconstitute_only_these=reconstitute_only_these) 696 695 self.assertEquals(serialized, "BUGX XP RELEASE : Yay = IMAGE\nNay") 697 696 -
trunk/Tools/Scripts/webkitpy/tool/commands/expectations.py
r105535 r126334 28 28 29 29 from webkitpy.layout_tests.models.test_configuration import TestConfigurationConverter 30 from webkitpy.layout_tests.models.test_expectations import TestExpectationParser, TestExpectationSerializer 30 from webkitpy.layout_tests.models.test_expectations import TestExpectationParser 31 from webkitpy.layout_tests.models.test_expectations import TestExpectations 31 32 from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand 32 33 … … 41 42 expectation_lines = parser.parse(port.test_expectations()) 42 43 converter = TestConfigurationConverter(port.all_test_configurations(), port.configuration_specifier_macros()) 43 tool.filesystem.write_text_file(port.path_to_test_expectations_file(), TestExpectation Serializer.list_to_string(expectation_lines, converter))44 tool.filesystem.write_text_file(port.path_to_test_expectations_file(), TestExpectations.list_to_string(expectation_lines, converter)) -
trunk/Tools/Scripts/webkitpy/tool/commands/queries.py
r121269 r126334 47 47 from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand 48 48 from webkitpy.common.system.deprecated_logging import log 49 from webkitpy.layout_tests.models.test_expectations import TestExpectations , TestExpectationSerializer49 from webkitpy.layout_tests.models.test_expectations import TestExpectations 50 50 from webkitpy.layout_tests.port import port_options 51 51 … … 466 466 port_names = [default_port.name()] 467 467 468 serializer = TestExpectationSerializer()469 468 tests = default_port.tests(args) 470 469 for port_name in port_names: … … 474 473 if port_name != port_names[0]: 475 474 print 476 print '\n'.join(self._format_lines(options, port_name, serializer,lines))475 print '\n'.join(self._format_lines(options, port_name, lines)) 477 476 478 477 def _filter_tests(self, options, model, tests): … … 488 487 return filtered_tests 489 488 490 def _format_lines(self, options, port_name, serializer,lines):489 def _format_lines(self, options, port_name, lines): 491 490 output = [] 492 491 if options.csv: 493 492 for line in lines: 494 output.append("%s,%s" % (port_name, serializer.to_csv(line)))493 output.append("%s,%s" % (port_name, line.to_csv())) 495 494 elif lines: 496 495 include_modifiers = options.full … … 498 497 output.append("// For %s" % port_name) 499 498 for line in lines: 500 output.append("%s" % serializer.to_string(line, include_modifiers, include_expectations, include_comment=False))499 output.append("%s" % line.to_string(None, include_modifiers, include_expectations, include_comment=False)) 501 500 return output 502 501 -
trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py
r123941 r126334 31 31 from webkitpy.tool.servers.reflectionhandler import ReflectionHandler 32 32 from webkitpy.layout_tests.controllers.test_expectations_editor import BugManager, TestExpectationsEditor 33 from webkitpy.layout_tests.models.test_expectations import TestExpectationParser, TestExpectations , TestExpectationSerializer33 from webkitpy.layout_tests.models.test_expectations import TestExpectationParser, TestExpectations 34 34 from webkitpy.layout_tests.models.test_configuration import TestConfigurationConverter 35 35 from webkitpy.layout_tests.port import builders … … 83 83 affected_test_configuration_set = self._extrapolator.extrapolate_test_configurations(builder_name) 84 84 updated_expectation_lines.extend(editor.update_expectation(test_name, affected_test_configuration_set, expectation_set)) 85 self._tool.filesystem.write_text_file(self._path_to_test_expectations_file, TestExpectation Serializer.list_to_string(expectation_lines, self._converter, reconstitute_only_these=updated_expectation_lines))85 self._tool.filesystem.write_text_file(self._path_to_test_expectations_file, TestExpectations.list_to_string(expectation_lines, self._converter, reconstitute_only_these=updated_expectation_lines)) 86 86 87 87
Note: See TracChangeset
for help on using the changeset viewer.