diff options
author | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-17 20:03:54 +0000 |
---|---|---|
committer | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-17 20:03:54 +0000 |
commit | 5224467ed943517042561e0b811fa39f27af6d63 (patch) | |
tree | e237fbfdde2adc85e67a6c490486c4b8f63816dc | |
parent | 7cef64b495701e8ff17b2fbb6e632aa34eee450f (diff) | |
download | chromium_src-5224467ed943517042561e0b811fa39f27af6d63.zip chromium_src-5224467ed943517042561e0b811fa39f27af6d63.tar.gz chromium_src-5224467ed943517042561e0b811fa39f27af6d63.tar.bz2 |
Make the linter just compare base paths instead of looking at all the files on disk. Now it takes ~3 seconds on my machine.
Also, make sure that each path in the test lists actually corresponds to a file/directory on disk. This is slightly stricter than we need to be as we could do partial paths, but I don't see the benefit in supporting that. As it is, I've found a lot of tests that are listed incorrectly in the test_lists because they point to paths that don't exist.
Review URL: http://codereview.chromium.org/14099
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7154 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 55 insertions, 59 deletions
diff --git a/webkit/tools/layout_tests/layout_package/test_expectations.py b/webkit/tools/layout_tests/layout_package/test_expectations.py index 4e13992..e24ae30 100644 --- a/webkit/tools/layout_tests/layout_package/test_expectations.py +++ b/webkit/tools/layout_tests/layout_package/test_expectations.py @@ -116,7 +116,6 @@ def StripComments(line): if line == '': return None else: return line - class TestExpectationsFile: """Test expectation files consist of lines with specifications of what to expect from layout test cases. The test cases can be directories @@ -167,6 +166,7 @@ class TestExpectationsFile: self._expectations = {} self._test_list_paths = {} self._tests = {} + self._errors = [] self._platform = platform self._is_debug_mode = is_debug_mode for expectation in self.EXPECTATIONS.itervalues(): @@ -240,20 +240,40 @@ class TestExpectationsFile: tests_and_expecation_parts = test_and_expectations.split('=') if (len(tests_and_expecation_parts) is not 2): - self._ReportSyntaxError(path, lineno, "Test is missing expectations") + self._AddError(lineno, 'Missing expectations.', test_and_expectations) + continue test_list_path = tests_and_expecation_parts[0].strip() - tests = self._ExpandTests(test_list_path) + try: + expectations = self._ParseExpectations(tests_and_expecation_parts[1]) + except SyntaxError, err: + self._AddError(lineno, err[0], test_list_path) + continue + + full_path = os.path.join(path_utils.LayoutDataDir(), test_list_path) + full_path = os.path.normpath(full_path) + # WebKit's way of skipping tests is to add a -disabled suffix. + # So we should consider the path existing if the path or the -disabled + # version exists. + if not os.path.exists(full_path) and not \ + os.path.exists(full_path + '-disabled'): + self._AddError(lineno, 'Path does not exist.', test_list_path) + continue + + if not self._full_test_list: + tests = [test_list_path] + else: + tests = self._ExpandTests(test_list_path) if is_skipped: self._AddSkippedTests(tests) else: - try: - self._AddTests(tests, - self._ParseExpectations(tests_and_expecation_parts[1]), - test_list_path) - except SyntaxError, err: - self._ReportSyntaxError(path, lineno, str(err)) + self._AddTests(tests, expectations, test_list_path, lineno) + + if len(self._errors) is not 0: + print "\nFAILURES FOR PLATFORM: %s, IS_DEBUG_MODE: %s" \ + % (self._platform.upper(), self._is_debug_mode) + raise SyntaxError('\n'.join(map(str, self._errors))) def _GetOptionsList(self, listString): return [part.strip().lower() for part in listString.strip().split(' ')] @@ -282,23 +302,13 @@ class TestExpectationsFile: if test.startswith(path): result.append(test) return result - def _AddTests(self, tests, expectations, test_list_path): - # Do not add tests that we expect only to pass to the lists. - # This makes it easier to account for tests that we expect to - # consistently pass, because they'll never be represented in - # any of the lists. - if len(expectations) == 1 and PASS in expectations: return - # Traverse all tests and add them with the given expectations. - + def _AddTests(self, tests, expectations, test_list_path, lineno): for test in tests: if test in self._test_list_paths: prev_base_path = self._test_list_paths[test] - # TODO: Save errors and raise a single error in order to catch more - # problems in a single lint run. if (prev_base_path == os.path.normpath(test_list_path)): - raise SyntaxError('Already seen expectations for path %s, in ' - 'platform %s, and is_debug_mode is %s' % - (test, self._platform, self._is_debug_mode)) + self._AddError(lineno, 'Duplicate expecations.', test) + continue if prev_base_path.startswith(test_list_path): # already seen a more precise path continue @@ -320,6 +330,5 @@ class TestExpectationsFile: for test in tests: self._skipped.add(test) - def _ReportSyntaxError(self, path, lineno, message): - raise SyntaxError(path + ':' + str(lineno) + ': ' + message) - + def _AddError(self, lineno, msg, path): + self._errors.append('\nLine:%s %s\n%s' % (lineno, msg, path))
\ No newline at end of file diff --git a/webkit/tools/layout_tests/run_webkit_tests.py b/webkit/tools/layout_tests/run_webkit_tests.py index 8c4453e..7549c97 100755 --- a/webkit/tools/layout_tests/run_webkit_tests.py +++ b/webkit/tools/layout_tests/run_webkit_tests.py @@ -81,7 +81,6 @@ class TestRunner: self._test_files = set() self._file_dir = os.path.join(os.path.dirname(sys.argv[0]), TEST_FILE_DIR) self._file_dir = path_utils.GetAbsolutePath(self._file_dir) - self._GatherTestFiles(paths) if options.lint_test_files: # Creating the expecations for each platform/target pair does all the @@ -93,6 +92,7 @@ class TestRunner: self._ParseExpectations('linux', is_debug_mode=True) self._ParseExpectations('linux', is_debug_mode=False) else: + self._GatherTestFiles(paths) self._expectations = self._ParseExpectations( platform_utils.GetTestListPlatformName().lower(), options.target == 'Debug') @@ -146,10 +146,17 @@ class TestRunner: structure holding them. Throws an error if the test_list files have invalid syntax. """ - return test_expectations.TestExpectations(self._test_files, - self._file_dir, - platform, - is_debug_mode) + test_files = self._options.lint_test_files ? None : self._test_files + try: + return test_expectations.TestExpectations(test_files, + self._file_dir, + platform, + is_debug_mode) + except SyntaxError, err: + if self._options.lint_test_files: + print str(err) + else: + raise err def _GenerateExpecationsAndPrintOutput(self): """Create appropriate subsets of self._tests_files in @@ -611,7 +618,7 @@ def main(options, args): if options.lint_test_files: # Just creating the TestRunner checks the syntax of the test lists. - logging.info("SUCCESS") + print "If there are no fail messages, the lint succeeded." return try: diff --git a/webkit/tools/layout_tests/test_lists/tests_fixable.txt b/webkit/tools/layout_tests/test_lists/tests_fixable.txt index 1362133..81e1cbb 100644 --- a/webkit/tools/layout_tests/test_lists/tests_fixable.txt +++ b/webkit/tools/layout_tests/test_lists/tests_fixable.txt @@ -100,7 +100,7 @@ RELEASE : LayoutTests/fast/events/standalone-image-drag-to-editable.html = FAIL // Bug 1187672. Two font faces should be identical but aren't. Punting SVG. LINUX WIN : LayoutTests/svg/custom/font-face-simple.svg = FAIL -LINUX WIN : LayoutTests/svg/custom/use-on-non-svg-namespaced-element = FAIL +LINUX WIN : LayoutTests/svg/custom/use-on-non-svg-namespaced-element.svg = FAIL // ----------------------------------------------------------------- // URL @@ -489,9 +489,6 @@ LayoutTests/tables/mozilla_expected_failures/bugs/bug178855.xml = FAIL PASS // Passes release. Fails debug. DEBUG : LayoutTests/fast/flexbox/flex-hang.html = FAIL PASS -// Bug: 1166260 -LayoutTests/fast/canvas/gradient-empty-path.html = FAIL - // Bug: 1166644 // Fails on webkit windows as well. WIN LINUX : LayoutTests/fast/events/attempt-scroll-with-no-scrollbars.html = FAIL @@ -733,6 +730,7 @@ LINUX WIN : LayoutTests/svg/custom/gradient-stop-corner-cases.svg = FAIL LINUX WIN : LayoutTests/svg/custom/gradient-stroke-width.svg = FAIL LINUX WIN : LayoutTests/svg/custom/group-opacity.svg = FAIL LINUX WIN : LayoutTests/svg/custom/image-small-width-height.svg = FAIL +// Linux pixeltest failure: Failing to draw gradients LayoutTests/svg/custom/inline-svg-in-xhtml.xml = FAIL // Our green is darker and we seem to be a pixel taller. WIN : LayoutTests/svg/custom/js-update-image.svg = FAIL @@ -752,13 +750,13 @@ LINUX WIN : LayoutTests/svg/custom/text-dom-01-f.svg = FAIL LINUX WIN : LayoutTests/svg/custom/text-dom-removal.svg = FAIL // Windows fails to draw anything here -LINUX WIN : LayoutTests/svg/custom/use-on-disallowed-foreign-object-1 = FAIL -LINUX WIN : LayoutTests/svg/custom/use-on-disallowed-foreign-object-2 = FAIL -LINUX WIN : LayoutTests/svg/custom/use-on-disallowed-foreign-object-3 = FAIL +LINUX WIN : LayoutTests/svg/custom/use-on-disallowed-foreign-object-1.svg = FAIL +LINUX WIN : LayoutTests/svg/custom/use-on-disallowed-foreign-object-2.svg = FAIL +LINUX WIN : LayoutTests/svg/custom/use-on-disallowed-foreign-object-3.svg = FAIL // This one passes even though nothing is drawn. -// LINUX WIN : LayoutTests/svg/custom/use-on-disallowed-foreign-object-4 = FAIL -LINUX WIN : LayoutTests/svg/custom/use-on-disallowed-foreign-object-5 = FAIL -LINUX WIN : LayoutTests/svg/custom/use-on-disallowed-foreign-object-6 = FAIL +// LINUX WIN : LayoutTests/svg/custom/use-on-disallowed-foreign-object-4.svg = FAIL +LINUX WIN : LayoutTests/svg/custom/use-on-disallowed-foreign-object-5.svg = FAIL +LINUX WIN : LayoutTests/svg/custom/use-on-disallowed-foreign-object-6.svg = FAIL LINUX WIN : LayoutTests/svg/custom/use-on-g-containing-foreignObject-and-image.svg = FAIL LINUX WIN : LayoutTests/svg/custom/width-full-percentage.svg = FAIL @@ -767,7 +765,6 @@ LINUX WIN : LayoutTests/svg/text/text-fonts-02-t.svg = FAIL LINUX WIN : LayoutTests/tables/mozilla/bugs/bug43854-1.html = FAIL // Linux pixeltest failure: Font mismatch LINUX WIN : LayoutTests/tables/mozilla_expected_failures/bugs/bug14007-2.html = FAIL -chrome/fast/dom/domListEnumeration.html = FAIL chrome/fast/forms/basic-textareas-quirks.html = FAIL // This test seems to fail on the builders but not locally. @@ -1023,12 +1020,6 @@ LINUX WIN : LayoutTests/scrollbars/overflow-scrollbar-combinations.html = FAIL LINUX WIN : LayoutTests/scrollbars/scrollbar-buttons.html = FAIL LINUX WIN : LayoutTests/scrollbars/scrollbar-orientation.html = FAIL LayoutTests/http/tests/security/MessagePort/event-listener-context.html = FAIL -// missing expected results -SKIP LayoutTests/fast/forms/search-placeholder-value-changed.html = FAIL -SKIP LayoutTests/fast/frames/frame-length-fractional.html = FAIL -SKIP LayoutTests/fast/table/floating-th.html = FAIL -SKIP LayoutTests/fast/table/table-display-types-strict.html = FAIL -SKIP LayoutTests/fast/table/table-display-types.html = FAIL // CHANGED OR REBASELINED IN WEBKIT 36102:37604 LINUX : LayoutTests/fast/forms/8250.html = FAIL @@ -1190,7 +1181,6 @@ LayoutTests/fast/profiler = FAIL TIMEOUT LINUX WIN : LayoutTests/fast/replaced/percent-height-in-anonymous-block-widget.html = FAIL LINUX WIN : LayoutTests/fast/text/bidi-embedding-pop-and-push-same.html = FAIL LayoutTests/plugins/netscape-construct.html = FAIL -LayoutTests/transforms/transform-value-types.html = FAIL // MERGE 37604:38097 REGRESSIONS LINUX WIN : LayoutTests/svg/carto.net/combobox.svg = FAIL @@ -1284,8 +1274,6 @@ LayoutTests/transitions/transition-drt-api-delay.html = TIMEOUT LayoutTests/transitions/transition-shorthand-delay.html = TIMEOUT // MERGE 38653:38729: Expectations changed upstream -LayoutTests/editing/execCommand/19653-4.html = FAIL -LayoutTests/editing/deleting/delete-link-1.html = FAIL LINUX WIN : LayoutTests/editing/inserting/insert-before-link-1.html = FAIL LINUX : LayoutTests/editing/execCommand/19089.html = FAIL LINUX : LayoutTests/fast/block/positioning/047.html = FAIL @@ -1308,7 +1296,6 @@ LINUX : LayoutTests/svg/dynamic-updates/SVGEllipseElement-svgdom-cx-prop.html = // MERGE 38760:38800: New tests LayoutTests/fast/workers/use-machine-stack.html = TIMEOUT -LayoutTests/animations/transform-animation-event-destroy-element.html = CRASH // MERGE 38760:38800: Expectations changed upstream WIN : LayoutTests/svg/hixie/data-types/001.xml = FAIL @@ -1882,8 +1869,6 @@ DEBUG : LayoutTests/svg/dynamic-updates/SVGEllipseElement-dom-ry-attr.html = CRA LINUX : LayoutTests/fast/events/5056619.html = PASS FAIL // Linux pixeltest failure: Gradient fail LINUX : LayoutTests/svg/W3C-SVG-1.1/masking-opacity-01-b.svg = FAIL -// Linux pixeltest failure: Failing to draw gradients -LINUX : LayoutTests/svg/custom/inline-svg-in-xhtml.html = FAIL // Linux pixeltest failure: windows baseline incorrect LINUX : LayoutTests/svg/custom/use-on-disallowed-foreign-object-4.svg = FAIL diff --git a/webkit/tools/layout_tests/test_lists/tests_ignored.txt b/webkit/tools/layout_tests/test_lists/tests_ignored.txt index 6ec77a59..149fe9e 100644 --- a/webkit/tools/layout_tests/test_lists/tests_ignored.txt +++ b/webkit/tools/layout_tests/test_lists/tests_ignored.txt @@ -141,11 +141,6 @@ LayoutTests/fast/js/exception-expression-offset.html = FAIL // if the tests pass or fail. LayoutTests/fast/js/function-names.html = FAIL PASS -// WebKit has moved/changed this test upstream -// https://bugs.webkit.org/show_bug.cgi?id=18681 -// We will pass the new one after we merge -LayoutTests/http/tests/incremental/slow-utf8-css.pl = FAIL - // These tests expect a tiff decoder, which we don't have. LINUX WIN : LayoutTests/fast/images/embed-image.html = FAIL LINUX WIN : LayoutTests/fast/images/object-image.html = FAIL |