diff options
author | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-06 20:15:58 +0000 |
---|---|---|
committer | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-06 20:15:58 +0000 |
commit | f6ea4733ac52a29238825efcfe07d9b7a33a63d0 (patch) | |
tree | 1c2ea7581cb589a1e3d35353573e0dcf870a9346 /webkit | |
parent | 0cd957bf0e56ca2b3520485caf204a289bf82f78 (diff) | |
download | chromium_src-f6ea4733ac52a29238825efcfe07d9b7a33a63d0.zip chromium_src-f6ea4733ac52a29238825efcfe07d9b7a33a63d0.tar.gz chromium_src-f6ea4733ac52a29238825efcfe07d9b7a33a63d0.tar.bz2 |
Fix _ValidateLists to work when running in linting mode.
In linting mode we don't walk the tree to find the list of
actual test files, so we don't know the full paths to files.
We just use prefix matching to look for
duplicate files. So when validating the two test lists
in linting mode, we should also use prefix matching.
Review URL: http://codereview.chromium.org/40151
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11147 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
3 files changed, 27 insertions, 8 deletions
diff --git a/webkit/tools/layout_tests/layout_package/compare_failures.py b/webkit/tools/layout_tests/layout_package/compare_failures.py index 70745d7..a88abfa 100644 --- a/webkit/tools/layout_tests/layout_package/compare_failures.py +++ b/webkit/tools/layout_tests/layout_package/compare_failures.py @@ -14,7 +14,8 @@ import test_failures import test_expectations -def PrintFilesFromSet(filenames, header_text, output, opt_expectations=None): +def PrintFilesFromSet(filenames, header_text, output, opt_expectations=None, + opt_relativizeFilenames=True): """A helper method to print a list of files to output. Args: @@ -35,9 +36,9 @@ def PrintFilesFromSet(filenames, header_text, output, opt_expectations=None): output_string += " = %s" % opt_expectations output_string += "\n" for filename in filenames: - output.write(output_string % path_utils.RelativeTestFilename(filename)) - - + if opt_relativizeFilenames: + filename = path_utils.RelativeTestFilename(filename) + output.write(output_string % filename) class CompareFailures: # A list of which TestFailure classes count as a failure vs a crash. diff --git a/webkit/tools/layout_tests/layout_package/test_expectations.py b/webkit/tools/layout_tests/layout_package/test_expectations.py index 0d343ca..a96aded 100644 --- a/webkit/tools/layout_tests/layout_package/test_expectations.py +++ b/webkit/tools/layout_tests/layout_package/test_expectations.py @@ -119,9 +119,27 @@ class TestExpectations: def _ValidateLists(self): # Make sure there's no overlap between the tests in the two files. - overlap = self._fixable.GetTests() & self._ignored.GetTests() + if self._tests: + relativizeFilenames = True + overlap = self._fixable.GetTests() & self._ignored.GetTests() + else: + relativizeFilenames = False + # If self._tests is None, then we have no way of expanding test paths + # So they remain shortened (e.g. LayoutTests/mac doesn't get expanded to + # include LayoutTests/mac/foo.html). So find duplicate prefixes + # instead of exact matches. + overlap = []; + for fixableTest in self._fixable.GetTests(): + for ignoredTest in self._ignored.GetTests(): + # Add both tests so they both get printed + if (fixableTest.startswith(ignoredTest) or + ignoredTest.startswith(fixableTest)): + overlap.append(fixableTest) + overlap.append(ignoredTest) + message = "Files contained in both " + self.FIXABLE + " and " + self.IGNORED - compare_failures.PrintFilesFromSet(overlap, message, sys.stdout) + compare_failures.PrintFilesFromSet(overlap, message, sys.stdout, + opt_relativizeFilenames=relativizeFilenames) assert(len(overlap) == 0) # Make sure there are no ignored tests expected to crash. assert(len(self._ignored.GetTestsExpectedTo(CRASH)) == 0) diff --git a/webkit/tools/layout_tests/run_webkit_tests.py b/webkit/tools/layout_tests/run_webkit_tests.py index a11f1c2..4d982da 100755 --- a/webkit/tools/layout_tests/run_webkit_tests.py +++ b/webkit/tools/layout_tests/run_webkit_tests.py @@ -161,7 +161,7 @@ class TestRunner: self._file_dir, platform, is_debug_mode) - except SyntaxError, err: + except Exception, err: if self._options.lint_test_files: print str(err) else: @@ -675,7 +675,7 @@ def main(options, args): if options.lint_test_files: # Just creating the TestRunner checks the syntax of the test lists. - print "If there are no fail messages, the lint succeeded." + print "If there are no fail messages or exceptions, the lint succeeded." return try: |