Skip to content

Instantly share code, notes, and snippets.

@kkristof
Created August 8, 2012 08:01
Show Gist options
  • Save kkristof/3293304 to your computer and use it in GitHub Desktop.
Save kkristof/3293304 to your computer and use it in GitHub Desktop.
def skipped_layout_tests(self, test_list):
"""Returns the set of tests found in Skipped files. Does *not* include tests marked as SKIP in expectations files."""
tests_to_skip = set(self._expectations_from_skipped_files(self._skipped_file_search_paths()))
tests_to_skip.update(self._tests_for_other_platforms())
tests_to_skip.update(self._skipped_tests_for_unsupported_features(test_list))
return tests_to_skip
def _tests_from_skipped_file_contents(self, skipped_file_contents):
tests_to_skip = []
for line in skipped_file_contents.split('\n'):
line = line.strip()
line = line.rstrip('/') # Best to normalize directory names to not include the trailing slash.
if line.startswith('#') or not len(line):
continue
tests_to_skip.append(line)
return tests_to_skip
def _expectations_from_skipped_files(self, skipped_file_paths):
tests_to_skip = []
for search_path in skipped_file_paths:
filename = self._filesystem.join(self._webkit_baseline_path(search_path), "Skipped")
if not self._filesystem.exists(filename):
_log.debug("Skipped does not exist: %s" % filename)
continue
_log.debug("Using Skipped file: %s" % filename)
skipped_file_contents = self._filesystem.read_text_file(filename)
tests_to_skip.extend(self._tests_from_skipped_file_contents(skipped_file_contents))
return tests_to_skip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment