Tools/ChangeLog

 12015-02-03 Ryosuke Niwa <rniwa@webkit.org>
 2
 3 [webkitpy] Add platform specific Skipped file mechanism for performance tests
 4 https://bugs.webkit.org/show_bug.cgi?id=141152
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Support a test-expectation-like syntax in performance tests' skipped files.
 9 e.g. [Mac] Parsed/BadTest.html will skip Parsed/BadTest.html on Mac ports.
 10
 11 * Scripts/webkitpy/port/base.py:
 12 (Port.skipped_perf_tests): Implemented the syntax support by a regular expression.
 13
 14 * Scripts/webkitpy/port/base_unittest.py:
 15 (PortTest.test_skipped_perf_tests): Test the new syntax.
 16
1172015-02-03 Brent Fulgham <bfulgham@apple.com>
218
319 [Win] Unreviewed test fix.
179559

Tools/Scripts/webkitpy/port/base.py

@@class Port(object):
699699
700700 @memoized
701701 def skipped_perf_tests(self):
702  return self._expectations_from_skipped_files([self.perf_tests_dir()])
 702 filename = self._filesystem.join(self.perf_tests_dir(), "Skipped")
 703 if not self._filesystem.exists(filename):
 704 _log.debug("Skipped does not exist: %s" % filename)
 705 return []
 706
 707 skipped_file_contents = self._filesystem.read_text_file(filename)
 708 line_number = 1
 709 tests_to_skip = []
 710 for line in skipped_file_contents.split('\n'):
 711 match = re.match(r'^\s*(\[(?P<platforms>[\w ]*?)\])?\s*(?P<test>[\w\-\/\.]+?)?\s*(?P<comment>\#.*)?$', line)
 712 if not match:
 713 _log.error("Synatx error at line %d in %s: %s" % (line_number, filename, line))
 714 else:
 715 platform_names = filter(lambda token: token, match.group('platforms').lower().split(' ')) if match.group('platforms') else []
 716 test_name = match.group('test')
 717 if test_name and (not platform_names or self.port_name in platform_names or self._name in platform_names):
 718 tests_to_skip.append(test_name)
 719
 720 line_number += 1
 721
 722 return tests_to_skip
703723
704724 def skips_perf_test(self, test_name):
705725 for test_or_category in self.skipped_perf_tests():
179328

Tools/Scripts/webkitpy/port/base_unittest.py

@@class PortTest(unittest.TestCase):
147147 add_text_file('inspector', 'test2.html')
148148 add_text_file('inspector/resources', 'resource_file.html')
149149 add_text_file('unsupported', 'unsupported_test2.html')
150  add_text_file('', 'Skipped', '\n'.join(['Layout', '', 'SunSpider', 'Supported/some-test.html']))
151  self.assertEqual(port.skipped_perf_tests(), ['Layout', 'SunSpider', 'Supported/some-test.html'])
 150 add_text_file('', 'Skipped', '\n'.join(['Layout', '', 'SunSpider', 'Supported/some-test.html', '[ExoticPort] UnskippedTest.html', '[baseport] SkippedTest.html']))
 151 self.assertEqual(port.skipped_perf_tests(), ['Layout', 'SunSpider', 'Supported/some-test.html', 'SkippedTest.html'])
152152
153153 def test_get_option__set(self):
154154 options, args = optparse.OptionParser().parse_args([])
179328