diff options
author | Kristian Monsen <kristianm@google.com> | 2010-07-30 10:46:49 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2010-08-04 13:01:34 +0100 |
commit | 0617145a89917ae7735fe1c9538688ab9a577df5 (patch) | |
tree | 56206078694427c37ed7bdf27eb5221398b833c0 /WebKitTools/Scripts | |
parent | ef1adcdfc805d4d13103f6f15cc5b4d96828a60f (diff) | |
download | external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.zip external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.tar.gz external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.tar.bz2 |
Merge WebKit at r64264 : Initial merge by git.
Change-Id: Ic42bef02efef8217a0f84c47176a9c617c28d1f1
Diffstat (limited to 'WebKitTools/Scripts')
-rwxr-xr-x | WebKitTools/Scripts/build-webkit | 5 | ||||
-rwxr-xr-x | WebKitTools/Scripts/check-for-inappropriate-files-in-framework | 10 | ||||
-rwxr-xr-x | WebKitTools/Scripts/check-for-webkit-framework-include-consistency | 10 | ||||
-rwxr-xr-x | WebKitTools/Scripts/old-run-webkit-tests | 16 | ||||
-rwxr-xr-x | WebKitTools/Scripts/svn-unapply | 6 | ||||
-rw-r--r-- | WebKitTools/Scripts/webkitdirs.pm | 2 | ||||
-rw-r--r-- | WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py | 22 | ||||
-rw-r--r-- | WebKitTools/Scripts/webkitpy/style/checkers/cpp.py | 14 | ||||
-rw-r--r-- | WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py | 24 | ||||
-rw-r--r-- | WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py | 7 | ||||
-rw-r--r-- | WebKitTools/Scripts/webkitpy/tool/steps/options.py | 4 |
11 files changed, 84 insertions, 36 deletions
diff --git a/WebKitTools/Scripts/build-webkit b/WebKitTools/Scripts/build-webkit index 57aab45..21214cc 100755 --- a/WebKitTools/Scripts/build-webkit +++ b/WebKitTools/Scripts/build-webkit @@ -61,7 +61,7 @@ my ($linkPrefetchSupport, $threeDCanvasSupport, $threeDRenderingSupport, $channe $svgSupport, $svgAnimationSupport, $svgAsImageSupport, $svgDOMObjCBindingsSupport, $svgFontsSupport, $svgForeignObjectSupport, $svgUseSupport, $videoSupport, $webSocketsSupport, $webTimingSupport, $wmlSupport, $wcssSupport, $xhtmlmpSupport, $workersSupport, $xpathSupport, $xsltSupport, $coverageSupport, $notificationsSupport, $blobSliceSupport, $tiledBackingStoreSupport, - $fileReaderSupport, $fileWriterSupport, $directoryUploadSupport); + $fileReaderSupport, $fileWriterSupport, $fileSystemSupport, $directoryUploadSupport); my @features = ( { option => "link-prefetch", desc => "Toggle pre fetching support", @@ -201,6 +201,9 @@ my @features = ( { option => "file-writer", desc => "Toggle FileWriter support", define => "ENABLE_FILE_WRITER", default => 0, value => \$fileWriterSupport }, + + { option => "file-system", desc => "Toggle FileSystem support", + define => "ENABLE_FILE_SYSTEM", default => 0, value => \$fileSystemSupport }, ); # Update defaults from Qt's project file diff --git a/WebKitTools/Scripts/check-for-inappropriate-files-in-framework b/WebKitTools/Scripts/check-for-inappropriate-files-in-framework index 2bc65d4..a323bc4 100755 --- a/WebKitTools/Scripts/check-for-inappropriate-files-in-framework +++ b/WebKitTools/Scripts/check-for-inappropriate-files-in-framework @@ -25,6 +25,7 @@ base_directory = ENV['TARGET_BUILD_DIR'] or throw "Unable to find TARGET_BUILD_DIR in the environment!" project_name = ENV['PROJECT_NAME'] or throw "Unable to find PROJECT_NAME in the environment!" +is_shallow_bundle = (ENV['SHALLOW_BUNDLE'] || "NO").upcase == "YES" $INAPPROPRIATE_FILES = { "WebCore" => { "Resources" => ["*.css", "*.in", "*.idl"] } } @@ -41,12 +42,13 @@ def print_inappropriate_file_error framework, relative_path print_error "#{framework}.framework/#{relative_path} should not be present in the framework." end -def check_framework framework +def check_framework framework, is_shallow_bundle $INAPPROPRIATE_FILES[framework].each do |directory, patterns| - Dir.chdir "#{framework}.framework/Versions/A/#{directory}" do + framework_bundle_path = is_shallow_bundle ? "#{framework}.framework" : "#{framework}.framework/Versions/A/#{directory}" + Dir.chdir framework_bundle_path do patterns.each do |pattern| Dir.glob(pattern).each do |inappropriate_file| - print_inappropriate_file_error framework, "Resources/#{inappropriate_file}" + print_inappropriate_file_error framework, is_shallow_bundle ? inappropriate_file : "#{directory}/#{inappropriate_file}" File.unlink inappropriate_file end end @@ -54,7 +56,7 @@ def check_framework framework end end -check_framework project_name +check_framework project_name, is_shallow_bundle if $error_printed STDERR.puts diff --git a/WebKitTools/Scripts/check-for-webkit-framework-include-consistency b/WebKitTools/Scripts/check-for-webkit-framework-include-consistency index 693dd6a..339fa7e 100755 --- a/WebKitTools/Scripts/check-for-webkit-framework-include-consistency +++ b/WebKitTools/Scripts/check-for-webkit-framework-include-consistency @@ -24,7 +24,8 @@ # THE POSSIBILITY OF SUCH DAMAGE. -base_directory = ENV['TARGET_BUILD_DIR'] +base_directory = ENV['TARGET_BUILD_DIR'] or throw "Unable to find TARGET_BUILD_DIR in the environment!" +is_shallow_bundle = (ENV['SHALLOW_BUNDLE'] || "NO").upcase == "YES" unless base_directory throw "Unable to find TARGET_BUILD_DIR in the environment!" @@ -44,8 +45,9 @@ def print_error msg STDERR.puts "ERROR: #{msg}" end -def build_header_maps - all_headers = `find WebKit.framework/Versions/A/{,Private}Headers -type f -name '*.h'`.split +def build_header_maps is_shallow_bundle + current_version_path = is_shallow_bundle ? "" : "Versions/A/" + all_headers = `find WebKit.framework/#{current_version_path}{,Private}Headers -type f -name '*.h'`.split all_headers.each do |header| if /\/Headers\/(.*)/.match(header) @@ -97,7 +99,7 @@ def verify_includes(header, permitted_types) end end -build_header_maps +build_header_maps is_shallow_bundle $HEADERS_BY_TYPE.each do |header_type, headers| permitted_types = $PERMITTED_INCLUDE_TYPES[header_type] diff --git a/WebKitTools/Scripts/old-run-webkit-tests b/WebKitTools/Scripts/old-run-webkit-tests index 88c0a05..af82545 100755 --- a/WebKitTools/Scripts/old-run-webkit-tests +++ b/WebKitTools/Scripts/old-run-webkit-tests @@ -214,12 +214,6 @@ if (isAppleMacWebKit()) { } } elsif (isGtk()) { $platform = "gtk"; - if (!$ENV{"WEBKIT_TESTFONTS"}) { - print "The WEBKIT_TESTFONTS environment variable is not defined.\n"; - print "You must set it before running the tests.\n"; - print "Use git to grab the actual fonts from http://gitorious.org/qtwebkit/testfonts\n"; - exit 1; - } } elsif (isWx()) { $platform = "wx"; } elsif (isCygwin()) { @@ -234,6 +228,16 @@ if (isAppleMacWebKit()) { } } +if (isQt() || isGtk() || isCygwin()) { + my $testfontPath = $ENV{"WEBKIT_TESTFONTS"}; + if (!$testfontPath || !-d "$testfontPath") { + print "The WEBKIT_TESTFONTS environment variable is not defined or not set properly\n"; + print "You must set it before running the tests.\n"; + print "Use git to grab the actual fonts from http://gitorious.org/qtwebkit/testfonts\n"; + exit 1; + } +} + if (!defined($platform)) { print "WARNING: Your platform is not recognized. Any platform-specific results will be generated in platform/undefined.\n"; $platform = "undefined"; diff --git a/WebKitTools/Scripts/svn-unapply b/WebKitTools/Scripts/svn-unapply index e502560..53ab1b5 100755 --- a/WebKitTools/Scripts/svn-unapply +++ b/WebKitTools/Scripts/svn-unapply @@ -139,7 +139,9 @@ sub patch($) { my ($diffHashRef) = @_; - my $patch = $diffHashRef->{svnConvertedText}; + # Make sure $patch is initialized to some value. There is no + # svnConvertedText when reversing an svn copy/move. + my $patch = $diffHashRef->{svnConvertedText} || ""; my $fullPath = $diffHashRef->{indexPath}; my $isSvnBinary = $diffHashRef->{isBinary} && $diffHashRef->{isSvn}; @@ -201,7 +203,7 @@ sub patch($) # FIXME: This should use the same logic as svn-apply's deletion # code. In particular, svn-apply's scmRemove() subroutine # should be used here. - unapplyPatch($patch, $fullPath, ["--force"]); + unapplyPatch($patch, $fullPath, ["--force"]) if $patch; unlink($fullPath) if -z $fullPath; system "svn", "revert", $fullPath; } diff --git a/WebKitTools/Scripts/webkitdirs.pm b/WebKitTools/Scripts/webkitdirs.pm index d95f2a1..745e808 100644 --- a/WebKitTools/Scripts/webkitdirs.pm +++ b/WebKitTools/Scripts/webkitdirs.pm @@ -674,7 +674,7 @@ sub determineQtFeatureDefaults() my $defaults = `qmake CONFIG+=compute_defaults 2>&1`; chdir $originalCwd; - while ($defaults =~ m/(\S*?)=(.*?)( |$)/gi) { + while ($defaults =~ m/(\S+?)=(\S+?)/gi) { $qtFeatureDefaults{$1}=$2; } } diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py index e7f9ac8..f8b181c 100644 --- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py +++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py @@ -34,6 +34,7 @@ from __future__ import with_statement import codecs import logging import os +import re import shutil import signal import subprocess @@ -212,6 +213,16 @@ class ChromiumPort(base.Port): return file.read() def test_expectations_overrides(self): + # FIXME: This drt_overrides handling should be removed when we switch + # from tes_shell to DRT. + drt_overrides = '' + if self._options.use_drt: + drt_overrides_path = self.path_from_webkit_base('LayoutTests', + 'platform', 'chromium', 'drt_expectations.txt') + if os.path.exists(drt_overrides_path): + with codecs.open(drt_overrides_path, "r", "utf-8") as file: + drt_overrides = file.read() + try: overrides_path = self.path_from_chromium_base('webkit', 'tools', 'layout_tests', 'test_expectations.txt') @@ -220,7 +231,7 @@ class ChromiumPort(base.Port): if not os.path.exists(overrides_path): return None with codecs.open(overrides_path, "r", "utf-8") as file: - return file.read() + return file.read() + drt_overrides def test_platform_names(self): return self.test_base_platform_names() + ('win-xp', @@ -382,9 +393,12 @@ class ChromiumDriver(base.Driver): if line.startswith("#URL:"): actual_uri = line.rstrip()[5:] if uri != actual_uri: - _log.fatal("Test got out of sync:\n|%s|\n|%s|" % - (uri, actual_uri)) - raise AssertionError("test out of sync") + # GURL capitalizes the drive letter of a file URL. + if (not re.search("^file:///[a-z]:", uri) or + uri.lower() != actual_uri.lower()): + _log.fatal("Test got out of sync:\n|%s|\n|%s|" % + (uri, actual_uri)) + raise AssertionError("test out of sync") elif line.startswith("#MD5:"): actual_checksum = line.rstrip()[5:] elif line.startswith("#TEST_TIMED_OUT"): diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py index 611afdc..770ab40 100644 --- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py +++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py @@ -1884,6 +1884,10 @@ def check_for_null(file_extension, clean_lines, line_number, error): if search(r'\bg_str(join|concat)\b', line): return + # Don't warn about NULL usage in gdk_pixbuf_save_to_*{join,concat}(). See Bug 43090. + if search(r'\bgdk_pixbuf_save_to\w+\b', line): + return + if search(r'\bNULL\b', line): error(line_number, 'readability/null', 5, 'Use 0 instead of NULL.') return @@ -1916,7 +1920,7 @@ def get_line_width(line): return len(line) -def check_style(clean_lines, line_number, file_extension, file_state, error): +def check_style(clean_lines, line_number, file_extension, class_state, file_state, error): """Checks rules from the 'C++ style rules' section of cppguide.html. Most of these rules are hard to test (naming, comment style), but we @@ -1927,6 +1931,8 @@ def check_style(clean_lines, line_number, file_extension, file_state, error): clean_lines: A CleansedLines instance containing the file. line_number: The number of the line to check. file_extension: The extension (without the dot) of the filename. + class_state: A _ClassState instance which maintains information about + the current stack of nested class declarations being parsed. file_state: A _FileState instance which maintains information about the state of things in the file. error: The function to call with any errors found. @@ -1987,6 +1993,10 @@ def check_style(clean_lines, line_number, file_extension, file_state, error): and not ((cleansed_line.find('case ') != -1 or cleansed_line.find('default:') != -1) and cleansed_line.find('break;') != -1) + # Also it's ok to have many commands in trivial single-line accessors in class definitions. + and not (match(r'.*\(.*\).*{.*.}', line) + and class_state.classinfo_stack + and line.count('{') == line.count('}')) and not cleansed_line.startswith('#define ')): error(line_number, 'whitespace/newline', 4, 'More than one command on the same line') @@ -2841,7 +2851,7 @@ def process_line(filename, file_extension, if search(r'\bNOLINT\b', raw_lines[line]): # ignore nolint lines return check_for_multiline_comments_and_strings(clean_lines, line, error) - check_style(clean_lines, line, file_extension, file_state, error) + check_style(clean_lines, line, file_extension, class_state, file_state, error) check_language(filename, clean_lines, line, file_extension, include_state, error) check_for_non_standard_constructs(clean_lines, line, class_state, error) diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py index 2dde549..ee829aa 100644 --- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py +++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py @@ -164,7 +164,7 @@ class CppStyleTestBase(unittest.TestCase): class_state = cpp_style._ClassState() file_state = cpp_style._FileState() for i in xrange(lines.num_lines()): - cpp_style.check_style(lines, i, file_extension, file_state, error_collector) + cpp_style.check_style(lines, i, file_extension, class_state, file_state, error_collector) cpp_style.check_for_non_standard_constructs(lines, i, class_state, error_collector) class_state.check_finished(error_collector) @@ -2594,6 +2594,19 @@ class NoNonVirtualDestructorsTest(CppStyleTestBase): self.assert_multi_line_lint( 'class Foo { void foo(); };', 'More than one command on the same line [whitespace/newline] [4]') + self.assert_multi_line_lint( + 'class MyClass {\n' + ' int getIntValue() { ASSERT(m_ptr); return *m_ptr; }\n' + '};\n', + '') + self.assert_multi_line_lint( + 'class MyClass {\n' + ' int getIntValue()\n' + ' {\n' + ' ASSERT(m_ptr); return *m_ptr;\n' + ' }\n' + '};\n', + 'More than one command on the same line [whitespace/newline] [4]') self.assert_multi_line_lint( '''class Qualified::Goo : public Foo { @@ -3472,6 +3485,15 @@ class WebKitStyleTest(CppStyleTestBase): self.assert_lint( 'gchar* result = g_strjoin(",", "part1", NULL);', '') + self.assert_lint( + 'gchar* result = gdk_pixbuf_save_to_callback(pixbuf, function, data, type, error, NULL);', + '') + self.assert_lint( + 'gchar* result = gdk_pixbuf_save_to_buffer(pixbuf, function, data, type, error, NULL);', + '') + self.assert_lint( + 'gchar* result = gdk_pixbuf_save_to_stream(pixbuf, function, data, type, error, NULL);', + '') # 2. C++ and C bool values should be written as true and # false. Objective-C BOOL values should be written as YES and NO. diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py b/WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py index 8f0d153..9ceb2cb 100644 --- a/WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py +++ b/WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py @@ -35,10 +35,6 @@ from webkitpy.tool.steps.options import Options class AbstractStep(object): def __init__(self, tool, options): self._tool = tool - if options.no_squash: - raise ScriptError('--no-squash has been removed. Use "--git-commit=HEAD.." or "-g HEAD.." to operate on the working copy.') - if options.squash: - raise ScriptError('--squash has been removed. It is now the default behavior if --git-commit is omitted.') self._options = options self._port = None @@ -76,9 +72,6 @@ class AbstractStep(object): return [ # We need this option here because cached_lookup uses it. :( Options.git_commit, - # FIXME: Get rid of these. - Options.no_squash, - Options.squash, ] def run(self, state): diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/options.py b/WebKitTools/Scripts/webkitpy/tool/steps/options.py index 9c73f5a..e7e3855 100644 --- a/WebKitTools/Scripts/webkitpy/tool/steps/options.py +++ b/WebKitTools/Scripts/webkitpy/tool/steps/options.py @@ -46,8 +46,6 @@ class Options(object): git_commit = make_option("-g", "--git-commit", action="store", dest="git_commit", help="Operate on a local commit. If a range, the commits are squashed into one. HEAD.. operates on working copy changes only.") local_commit = make_option("--local-commit", action="store_true", dest="local_commit", default=False, help="Make a local commit for each applied patch") non_interactive = make_option("--non-interactive", action="store_true", dest="non_interactive", default=False, help="Never prompt the user, fail as fast as possible.") - # FIXME: Remove --no-squash, once people have adjusted to using --git-commit. - no_squash = make_option("--no-squash", action="store_true", dest="no_squash", default=False, help="Obsolete. Use --git-commit=HEAD.. instead.") obsolete_patches = make_option("--no-obsolete", action="store_false", dest="obsolete_patches", default=True, help="Do not obsolete old patches before posting this one.") open_bug = make_option("--open-bug", action="store_true", dest="open_bug", default=False, help="Opens the associated bug in a browser.") parent_command = make_option("--parent-command", action="store", dest="parent_command", default=None, help="(Internal) The command that spawned this instance.") @@ -56,7 +54,5 @@ class Options(object): request_commit = make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review.") review = make_option("--no-review", action="store_false", dest="review", default=True, help="Do not mark the patch for review.") reviewer = make_option("-r", "--reviewer", action="store", type="string", dest="reviewer", help="Update ChangeLogs to say Reviewed by REVIEWER.") - # FIXME: Remove --squash, once people have adjusted to using --git-commit. - squash = make_option("-s", "--squash", action="store_true", dest="squash", default=False, help="Obsolete. This is now the default behavior.") test = make_option("--test", action="store_true", dest="test", default=False, help="Run run-webkit-tests before committing.") update = make_option("--no-update", action="store_false", dest="update", default=True, help="Don't update the working directory.") |