diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-14 16:29:47 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-14 16:29:47 +0200 |
| commit | d0424a769059c84ae20beb3c217812792ea6726b (patch) | |
| tree | 6f94a5c3db8c52c6694ee56498542a6c35417350 /Tools/Scripts | |
| parent | 88a04ac016f57c2d78e714682445dff2e7db4ade (diff) | |
| download | qtwebkit-d0424a769059c84ae20beb3c217812792ea6726b.tar.gz | |
Imported WebKit commit 37c5e5041d39a14ea0d429a77ebd352e4bd26516 (http://svn.webkit.org/repository/webkit/trunk@128608)
New snapshot that enables WebKit2 build on Windows (still some bugs) and allows for WebKit to be built with qmake && make
Diffstat (limited to 'Tools/Scripts')
24 files changed, 120 insertions, 678 deletions
diff --git a/Tools/Scripts/build-jsc b/Tools/Scripts/build-jsc index 418f22b61..3fbf43fe1 100755 --- a/Tools/Scripts/build-jsc +++ b/Tools/Scripts/build-jsc @@ -66,7 +66,7 @@ if (isQt()) { my @projects = ("WTF", "JavaScriptCore"); # Pick up the --no-webkit2 option from BUILD_WEBKIT_ARGS if it is needed push @ARGV, split(/ /, $ENV{'BUILD_WEBKIT_ARGS'}) if ($ENV{'BUILD_WEBKIT_ARGS'}); - push @ARGV, "--qmakearg=CONFIG+=no_webkit2" if checkForArgumentAndRemoveFromARGV("--no-webkit2"); + push @ARGV, "WEBKIT_CONFIG-=build_webkit2" if checkForArgumentAndRemoveFromARGV("--no-webkit2"); my $result = buildQMakeProjects(\@projects, 0, @ARGV); exit exitStatus($result); } elsif (cmakeBasedPortName()) { diff --git a/Tools/Scripts/generate-win32-export-forwards b/Tools/Scripts/generate-win32-export-forwards index ece574387..a160abb18 100755 --- a/Tools/Scripts/generate-win32-export-forwards +++ b/Tools/Scripts/generate-win32-export-forwards @@ -45,7 +45,7 @@ for lib in libraries: if match: symbols.add(match.group("symbol")) -print "Forwarding %s symbols from %s" % (len(symbols), " ".join(libraries)) +print("Forwarding %s symbols from %s" % (len(symbols), " ".join(libraries))) exportFile = open(outputFileName, "w") for symbol in symbols: diff --git a/Tools/Scripts/run-launcher b/Tools/Scripts/run-launcher index 2ff0924b0..eca07f6f3 100755 --- a/Tools/Scripts/run-launcher +++ b/Tools/Scripts/run-launcher @@ -73,7 +73,11 @@ if (isQt()) { } if (isEfl()) { - unshift(@ARGV, catdir($launcherPath, "bin", "EWebLauncher")); + if (isWK2()) { + unshift(@ARGV, catdir($launcherPath, "bin", "MiniBrowser")); + } else { + unshift(@ARGV, catdir($launcherPath, "bin", "EWebLauncher")); + } $launcherPath = catdir(sourceDir(), "Tools", "efl", "run-with-jhbuild"); } diff --git a/Tools/Scripts/webkitdirs.pm b/Tools/Scripts/webkitdirs.pm index 5c0e8d3b8..6f3d864e9 100755 --- a/Tools/Scripts/webkitdirs.pm +++ b/Tools/Scripts/webkitdirs.pm @@ -1542,8 +1542,21 @@ sub checkRequiredSystemConfig print "*************************************************************\n"; } } elsif (isGtk() or isQt() or isWx() or isEfl()) { - my @cmds = qw(flex bison gperf); + my @cmds = qw(bison gperf); + if (isQt() and isWindows()) { + push @cmds, "win_flex"; + } else { + push @cmds, "flex"; + } my @missing = (); + my $oldPath = $ENV{PATH}; + if (isQt() and isWindows()) { + chomp(my $gnuWin32Dir = `$qmakebin -query QT_HOST_DATA`); + $gnuWin32Dir = File::Spec->catfile($gnuWin32Dir, "..", "gnuwin32", "bin"); + if (-d "$gnuWin32Dir") { + $ENV{PATH} = $gnuWin32Dir . ";" . $ENV{PATH}; + } + } foreach my $cmd (@cmds) { push @missing, $cmd if not commandExists($cmd); } @@ -1552,6 +1565,9 @@ sub checkRequiredSystemConfig my $list = join ", ", @missing; die "ERROR: $list missing but required to build WebKit.\n"; } + if (isQt() and isWindows()) { + $ENV{PATH} = $oldPath; + } } # Win32 and other platforms may want to check for minimum config } @@ -1589,9 +1605,9 @@ sub setupAppleWinEnv() # FIXME: We should remove this explicit version check for cygwin once we stop supporting Cygwin 1.7.9 or older versions. # https://bugs.webkit.org/show_bug.cgi?id=85791 - my $currentCygwinVersion = version->parse(`uname -r`); - my $firstCygwinVersionWithoutTTYSupport = version->parse("1.7.10"); - if ($currentCygwinVersion < $firstCygwinVersionWithoutTTYSupport) { + my $uname_version = (POSIX::uname())[2]; + $uname_version =~ s/\(.*\)//; # Remove the trailing cygwin version, if any. + if (version->parse($uname_version) < version->parse("1.7.10")) { # Setting the environment variable 'CYGWIN' to 'tty' makes cygwin enable extra support (i.e., termios) # for UNIX-like ttys in the Windows console $variablesToSet{CYGWIN} = "tty" unless $ENV{CYGWIN}; @@ -2251,7 +2267,6 @@ sub buildQMakeProjects } elsif ($passedConfig) { die "Build type $passedConfig is not supported with --qt.\n"; } - push @buildArgs, "CONFIG-=debug_and_release" if ($passedConfig && isDarwin()); # Using build-webkit to build assumes you want a developer-build push @buildArgs, "CONFIG-=production_build"; diff --git a/Tools/Scripts/webkitperl/FeatureList.pm b/Tools/Scripts/webkitperl/FeatureList.pm index 9e13fb6db..ad2304679 100644 --- a/Tools/Scripts/webkitperl/FeatureList.pm +++ b/Tools/Scripts/webkitperl/FeatureList.pm @@ -216,7 +216,7 @@ my @features = ( define => "ENABLE_DIRECTORY_UPLOAD", default => 0, value => \$directoryUploadSupport }, { option => "download-attribute", desc => "Toggle Download Attribute support", - define => "ENABLE_DOWNLOAD_ATTRIBUTE", default => isBlackBerry(), value => \$downloadAttributeSupport }, + define => "ENABLE_DOWNLOAD_ATTRIBUTE", default => (isBlackBerry() || isEfl()), value => \$downloadAttributeSupport }, { option => "file-system", desc => "Toggle File System support", define => "ENABLE_FILE_SYSTEM", default => isBlackBerry(), value => \$fileSystemSupport }, diff --git a/Tools/Scripts/webkitpy/common/config/committers.py b/Tools/Scripts/webkitpy/common/config/committers.py index 637476561..bda102e11 100644 --- a/Tools/Scripts/webkitpy/common/config/committers.py +++ b/Tools/Scripts/webkitpy/common/config/committers.py @@ -323,6 +323,7 @@ committers_unable_to_review = [ Committer("Mahesh Kulkarni", ["mahesh.kulkarni@nokia.com", "maheshk@webkit.org"], "maheshk"), Committer("Marcus Voltis Bulach", "bulach@chromium.org"), Committer("Mario Sanchez Prada", ["msanchez@igalia.com", "mario@webkit.org"], "msanchez"), + Committer("Mark Lam", "mark.lam@apple.com", "mlam"), Committer("Mary Wu", ["mary.wu@torchmobile.com.cn", "wwendy2007@gmail.com"], "marywu"), Committer("Matt Delaney", "mdelaney@apple.com"), Committer("Matt Lilek", ["mlilek@apple.com", "webkit@mattlilek.com", "pewtermoose@webkit.org"], "pewtermoose"), @@ -359,7 +360,7 @@ committers_unable_to_review = [ Committer("Rafael Antognolli", "antognolli@profusion.mobi", "antognolli"), Committer("Rafael Brandao", "rafael.lobo@openbossa.org", "rafaelbrandao"), Committer("Rafael Weinstein", "rafaelw@chromium.org", "rafaelw"), - Committer("Raphael Kubo da Costa", ["rakuco@webkit.org", "rakuco@FreeBSD.org"], "rakuco"), + Committer("Raphael Kubo da Costa", ["rakuco@webkit.org", "rakuco@FreeBSD.org", "raphael.kubo.da.costa@intel.com"], "rakuco"), Committer("Ravi Kasibhatla", "ravi.kasibhatla@motorola.com", "kphanee"), Committer("Renata Hodovan", "reni@webkit.org", "reni"), Committer("Robert Hogan", ["robert@webkit.org", "robert@roberthogan.net", "lists@roberthogan.net"], "mwenge"), @@ -399,7 +400,6 @@ committers_unable_to_review = [ Committer("Yongjun Zhang", ["yongjun.zhang@nokia.com", "yongjun_zhang@apple.com"]), Committer("Yoshifumi Inoue", "yosin@chromium.org", "yosin"), Committer("Yuqiang Xian", "yuqiang.xian@intel.com"), - Committer("Yuta Kitamura", "yutak@chromium.org", "yutak"), Committer("Yuzo Fujishima", "yuzo@google.com", "yuzo"), Committer("Zalan Bujtas", ["zbujtas@gmail.com", "zalan.bujtas@nokia.com"], "zalan"), Committer("Zeno Albisser", ["zeno@webkit.org", "zeno.albisser@nokia.com"], "zalbisser"), @@ -533,6 +533,7 @@ reviewers_list = [ Reviewer("Xan Lopez", ["xan.lopez@gmail.com", "xan@gnome.org", "xan@webkit.org", "xlopez@igalia.com"], "xan"), Reviewer("Yong Li", ["yoli@rim.com", "yong.li.webkit@gmail.com"], "yoli"), Reviewer("Yury Semikhatsky", "yurys@chromium.org", "yurys"), + Reviewer("Yuta Kitamura", "yutak@chromium.org", "yutak"), Reviewer("Zack Rusin", "zack@kde.org", "zackr"), Reviewer("Zoltan Herczeg", ["zherczeg@webkit.org", "zherczeg@inf.u-szeged.hu"], "zherczeg"), ] diff --git a/Tools/Scripts/webkitpy/common/config/watchlist b/Tools/Scripts/webkitpy/common/config/watchlist index 18b69ebe4..4029fe8d5 100755 --- a/Tools/Scripts/webkitpy/common/config/watchlist +++ b/Tools/Scripts/webkitpy/common/config/watchlist @@ -232,6 +232,10 @@ r"|Source/WebCore/svg/graphics/filters" r"|Source/WebCore/svg/graphics/.*Filter.*", }, + "SVG": { + "filename": r"Source/WebCore/svg" + r"|Source/WebCore/rendering/svg", + }, }, "CC_RULES": { # Note: All email addresses listed must be registered with bugzilla. @@ -239,7 +243,7 @@ # two different accounts as far as bugzilla is concerned. "AppleMacPublicApi": [ "timothy@apple.com" ], "Battery": [ "gyuyoung.kim@samsung.com" ], - "BlackBerry": [ "mifenton@rim.com" ], + "BlackBerry": [ "mifenton@rim.com", "rwlbuis@gmail.com" ], "CMake": [ "rakuco@webkit.org", "gyuyoung.kim@samsung.com" ], "CSS": [ "alexis@webkit.org", "macpherson@chromium.org", "cmarcelo@webkit.org" ], "ChromiumGraphics": [ "jamesr@chromium.org", "cc-bugs@google.com" ], @@ -269,6 +273,7 @@ "SecurityCritical": [ "abarth@webkit.org" ], "SoupNetwork": [ "rakuco@webkit.org", "gns@gnome.org", "mrobinson@webkit.org", "danw@gnome.org" ], "StyleChecker": [ "levin@chromium.org", ], + "SVG": ["schenney@chromium.org", "pdr@google.com", "fmalita@chromium.org" ], "TestFailures": [ "abarth@webkit.org", "dglazkov@chromium.org" ], "TextureMapper" : [ "noam.rosenthal@nokia.com" ], "ThreadingFiles|ThreadingUsage": [ "levin+threading@chromium.org", ], diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/test_expectations_editor.py b/Tools/Scripts/webkitpy/layout_tests/controllers/test_expectations_editor.py deleted file mode 100644 index 97a2d4ffc..000000000 --- a/Tools/Scripts/webkitpy/layout_tests/controllers/test_expectations_editor.py +++ /dev/null @@ -1,167 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2010 Google Inc. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -"""A helper class for reading in and dealing with tests expectations -for layout tests. -""" - -import itertools -import json -import logging -import re - -from webkitpy.layout_tests.models.test_configuration import TestConfiguration, TestConfigurationConverter -from webkitpy.layout_tests.models import test_expectations - -_log = logging.getLogger(__name__) - - -class BugManager(object): - """A simple interface for managing bugs from TestExpectationsEditor.""" - def close_bug(self, bug_ids, reference_bug_ids=None): - raise NotImplementedError("BugManager.close_bug") - - def create_bug(self): - """Should return a newly created bug id in the form of r"BUG[^\d].*".""" - raise NotImplementedError("BugManager.create_bug") - - -class TestExpectationsEditor(object): - """ - The editor assumes that the expectation data is error-free. - """ - - def __init__(self, expectation_lines, bug_manager): - self._bug_manager = bug_manager - self._expectation_lines = expectation_lines - self._tests_with_directory_paths = set() - # FIXME: Unify this with TestExpectationsModel. - self._test_to_expectation_lines = {} - for expectation_line in expectation_lines: - for test in expectation_line.matching_tests: - if test == expectation_line.path: - self._test_to_expectation_lines.setdefault(test, []).append(expectation_line) - else: - self._tests_with_directory_paths.add(test) - - def remove_expectation(self, test, test_config_set, remove_flakes=False): - """Removes existing expectations for {test} in the of test configurations {test_config_set}. - If the test is flaky, the expectation is not removed, unless remove_flakes is True. - - In this context, removing expectations does not imply that the test is passing -- we are merely removing - any information about this test from the expectations. - - We do not remove the actual expectation lines here. Instead, we adjust TestExpectationLine.matching_configurations. - The serializer will figure out what to do: - * An empty matching_configurations set means that the this line matches nothing and will serialize as None. - * A matching_configurations set that can't be expressed as one line will be serialized as multiple lines. - - Also, we do only adjust matching_configurations for lines that match tests exactly, because expectation lines with - better path matches are valid and always win. - - For example, the expectation with the path "fast/events/shadow/" will - be ignored when removing expectations for the test "fast/event/shadow/awesome-crash.html", since we can just - add a new expectation line for "fast/event/shadow/awesome-crash.html" to influence expected results. - """ - expectation_lines = self._test_to_expectation_lines.get(test, []) - for expectation_line in expectation_lines: - if (not expectation_line.is_flaky() or remove_flakes) and expectation_line.matching_configurations & test_config_set: - expectation_line.matching_configurations = expectation_line.matching_configurations - test_config_set - if not expectation_line.matching_configurations: - self._bug_manager.close_bug(expectation_line.parsed_bug_modifiers) - return - - def update_expectation(self, test, test_config_set, expectation_set, parsed_bug_modifiers=None): - """Updates expectations for {test} in the set of test configuration {test_config_set} to the values of {expectation_set}. - If {parsed_bug_modifiers} is supplied, it is used for updated expectations. Otherwise, a new bug is created. - - Here, we treat updating expectations to PASS as special: if possible, the corresponding lines are completely removed. - """ - # FIXME: Allow specifying modifiers (SLOW, SKIP, WONTFIX). - updated_expectations = [] - expectation_lines = self._test_to_expectation_lines.get(test, []) - remaining_configurations = test_config_set.copy() - bug_ids = self._get_valid_bug_ids(parsed_bug_modifiers) - new_expectation_line_insertion_point = len(self._expectation_lines) - remove_expectations = expectation_set == set([test_expectations.PASS]) and test not in self._tests_with_directory_paths - - for expectation_line in expectation_lines: - if expectation_line.matching_configurations == remaining_configurations: - # Tweak expectations on existing line. - if expectation_line.parsed_expectations == expectation_set: - return updated_expectations - self._bug_manager.close_bug(expectation_line.parsed_bug_modifiers, bug_ids) - updated_expectations.append(expectation_line) - if remove_expectations: - expectation_line.matching_configurations = set() - else: - expectation_line.parsed_expectations = expectation_set - expectation_line.parsed_bug_modifiers = bug_ids - return updated_expectations - elif expectation_line.matching_configurations >= remaining_configurations: - # 1) Split up into two expectation lines: - # * one with old expectations (existing expectation_line) - # * one with new expectations (new expectation_line) - # 2) Finish looking, since there will be no more remaining configs to test for. - expectation_line.matching_configurations -= remaining_configurations - updated_expectations.append(expectation_line) - new_expectation_line_insertion_point = self._expectation_lines.index(expectation_line) + 1 - break - elif expectation_line.matching_configurations <= remaining_configurations: - # Remove existing expectation line. - self._bug_manager.close_bug(expectation_line.parsed_bug_modifiers, bug_ids) - expectation_line.matching_configurations = set() - updated_expectations.append(expectation_line) - else: - intersection = expectation_line.matching_configurations & remaining_configurations - if intersection: - expectation_line.matching_configurations -= intersection - updated_expectations.append(expectation_line) - new_expectation_line_insertion_point = self._expectation_lines.index(expectation_line) + 1 - - if not remove_expectations: - new_expectation_line = self._create_new_line(test, bug_ids, remaining_configurations, expectation_set) - updated_expectations.append(new_expectation_line) - self._expectation_lines.insert(new_expectation_line_insertion_point, new_expectation_line) - - return updated_expectations - - def _get_valid_bug_ids(self, suggested_bug_ids): - # FIXME: Flesh out creating a bug properly (title, etc.) - return suggested_bug_ids or [self._bug_manager.create_bug()] - - def _create_new_line(self, name, bug_ids, config_set, expectation_set): - new_line = test_expectations.TestExpectationLine() - new_line.name = name - new_line.parsed_bug_modifiers = bug_ids - new_line.matching_configurations = config_set - new_line.parsed_expectations = expectation_set - # Ensure index integrity for multiple operations. - self._test_to_expectation_lines.setdefault(name, []).append(new_line) - return new_line diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/test_expectations_editor_unittest.py b/Tools/Scripts/webkitpy/layout_tests/controllers/test_expectations_editor_unittest.py deleted file mode 100644 index ad8aabd11..000000000 --- a/Tools/Scripts/webkitpy/layout_tests/controllers/test_expectations_editor_unittest.py +++ /dev/null @@ -1,343 +0,0 @@ -#!/usr/bin/python -# Copyright (C) 2010 Google Inc. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import unittest - -from webkitpy.common.host_mock import MockHost - -from webkitpy.layout_tests.controllers.test_expectations_editor import * -from webkitpy.layout_tests.models.test_configuration import * -from webkitpy.layout_tests.models.test_expectations import * -from webkitpy.layout_tests.models.test_configuration import * - - -class MockBugManager(object): - def close_bug(self, bug_id, reference_bug_id=None): - pass - - def create_bug(self): - return "BUG_NEWLY_CREATED" - - -class TestExpectationEditorTests(unittest.TestCase): - WIN_RELEASE_CONFIGS = set([ - TestConfiguration('vista', 'x86', 'release'), - TestConfiguration('win7', 'x86', 'release'), - TestConfiguration('xp', 'x86', 'release'), - ]) - - RELEASE_CONFIGS = set([ - TestConfiguration('vista', 'x86', 'release'), - TestConfiguration('win7', 'x86', 'release'), - TestConfiguration('xp', 'x86', 'release'), - TestConfiguration('vista', 'x86', 'release'), - TestConfiguration('win7', 'x86', 'release'), - TestConfiguration('xp', 'x86', 'release'), - TestConfiguration('snowleopard', 'x86', 'release'), - TestConfiguration('leopard', 'x86', 'release'), - TestConfiguration('snowleopard', 'x86', 'release'), - TestConfiguration('leopard', 'x86', 'release'), - TestConfiguration('lucid', 'x86', 'release'), - TestConfiguration('lucid', 'x86_64', 'release'), - TestConfiguration('lucid', 'x86', 'release'), - TestConfiguration('lucid', 'x86_64', 'release'), - ]) - - def __init__(self, testFunc): - host = MockHost() - self.test_port = host.port_factory.get('test-win-xp', None) - self.full_test_list = ['failures/expected/keyboard.html', 'failures/expected/audio.html'] - unittest.TestCase.__init__(self, testFunc) - - def make_parsed_expectation_lines(self, in_string): - parser = TestExpectationParser(self.test_port, self.full_test_list, allow_rebaseline_modifier=False) - expectation_lines = parser.parse('path', in_string) - for expectation_line in expectation_lines: - self.assertFalse(expectation_line.is_invalid()) - return expectation_lines - - def assert_remove_roundtrip(self, in_string, test, expected_string, remove_flakes=False): - test_config_set = set([self.test_port.test_configuration()]) - expectation_lines = self.make_parsed_expectation_lines(in_string) - editor = TestExpectationsEditor(expectation_lines, MockBugManager()) - editor.remove_expectation(test, test_config_set, remove_flakes) - converter = TestConfigurationConverter(self.test_port.all_test_configurations(), self.test_port.configuration_specifier_macros()) - result = TestExpectations.list_to_string(expectation_lines, converter) - self.assertEquals(result, expected_string) - - def assert_update_roundtrip(self, in_string, test, expectation_set, expected_string, expected_update_count, remove_flakes=False, parsed_bug_modifiers=None, test_configs=None): - test_config_set = test_configs or set([self.test_port.test_configuration()]) - expectation_lines = self.make_parsed_expectation_lines(in_string) - editor = TestExpectationsEditor(expectation_lines, MockBugManager()) - updated_expectation_lines = editor.update_expectation(test, test_config_set, expectation_set, parsed_bug_modifiers=parsed_bug_modifiers) - for updated_expectation_line in updated_expectation_lines: - self.assertTrue(updated_expectation_line in expectation_lines) - self.assertEquals(len(updated_expectation_lines), expected_update_count) - converter = TestConfigurationConverter(self.test_port.all_test_configurations(), self.test_port.configuration_specifier_macros()) - result = TestExpectations.list_to_string(expectation_lines, converter) - self.assertEquals(result, expected_string) - - def test_remove_expectation(self): - self.assert_remove_roundtrip(""" -BUGX1 XP DEBUG : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""", 'failures/expected/hang.html', """ -BUGX1 XP DEBUG : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - self.assert_remove_roundtrip(""" -BUGX1 XP DEBUG : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""", 'failures/expected/keyboard.html', """ -BUGX1 XP DEBUG : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - self.assert_remove_roundtrip(""" -BUGX1 XP DEBUG : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""", 'failures/expected/keyboard.html', """ -BUGX1 XP DEBUG : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - self.assert_remove_roundtrip(""" -BUGX1 MAC : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""", 'failures/expected/keyboard.html', """ -BUGX1 MAC : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - self.assert_remove_roundtrip(""" -BUGX1 XP RELEASE : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""", 'failures/expected/keyboard.html', """ -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - self.assert_remove_roundtrip(""" -BUGX1 WIN : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""", 'failures/expected/keyboard.html', """ -BUGX1 XP DEBUG : failures/expected/keyboard.html = IMAGE -BUGX1 VISTA WIN7 : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - self.assert_remove_roundtrip(""" -BUGX1 XP : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""", 'failures/expected/keyboard.html', """ -BUGX1 XP DEBUG : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - self.assert_remove_roundtrip(""" -BUGX1 : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""", 'failures/expected/keyboard.html', """ -BUGX1 XP DEBUG : failures/expected/keyboard.html = IMAGE -BUGX1 LINUX MAC VISTA WIN7 : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - self.assert_remove_roundtrip(""" -BUGX1 WIN : failures/expected = PASS -BUGX2 XP RELEASE : failures/expected/keyboard.html = IMAGE""", 'failures/expected/keyboard.html', """ -BUGX1 WIN : failures/expected = PASS""") - - self.assert_remove_roundtrip(""" -BUGX1 XP RELEASE : failures/expected/keyboard.html = IMAGE -BUGX2 XP DEBUG : failures/expected/keyboard.html = IMAGE""", 'failures/expected/keyboard.html', """ -BUGX2 XP DEBUG : failures/expected/keyboard.html = IMAGE""") - - self.assert_remove_roundtrip(""" -BUGX1 WIN : failures/expected = TEXT""", 'failures/expected/keyboard.html', """ -BUGX1 WIN : failures/expected = TEXT""") - - self.assert_remove_roundtrip(""" -BUGX1 XP RELEASE : failures/expected/keyboard.html = IMAGE PASS -BUGX2 XP DEBUG : failures/expected/keyboard.html = IMAGE""", 'failures/expected/keyboard.html', """ -BUGX1 XP RELEASE : failures/expected/keyboard.html = PASS IMAGE -BUGX2 XP DEBUG : failures/expected/keyboard.html = IMAGE""") - - self.assert_remove_roundtrip(""" -BUGX1 XP RELEASE : failures/expected/keyboard.html = IMAGE PASS -BUGX2 XP DEBUG : failures/expected/keyboard.html = IMAGE""", 'failures/expected/keyboard.html', """ -BUGX2 XP DEBUG : failures/expected/keyboard.html = IMAGE""", remove_flakes=True) - - def test_remove_expectation_multiple(self): - in_string = """ -BUGX1 WIN : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""" - expectation_lines = self.make_parsed_expectation_lines(in_string) - converter = TestConfigurationConverter(self.test_port.all_test_configurations(), self.test_port.configuration_specifier_macros()) - editor = TestExpectationsEditor(expectation_lines, MockBugManager()) - test = "failures/expected/keyboard.html" - - editor.remove_expectation(test, set([TestConfiguration('xp', 'x86', 'release')])) - self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ -BUGX1 XP DEBUG : failures/expected/keyboard.html = IMAGE -BUGX1 VISTA WIN7 : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - editor.remove_expectation(test, set([TestConfiguration('xp', 'x86', 'debug')])) - self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ -BUGX1 VISTA WIN7 : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - editor.remove_expectation(test, set([TestConfiguration('vista', 'x86', 'debug'), TestConfiguration('win7', 'x86', 'release')])) - self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ -BUGX1 VISTA RELEASE : failures/expected/keyboard.html = IMAGE -BUGX1 WIN7 DEBUG : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - editor.remove_expectation(test, set([TestConfiguration('vista', 'x86', 'debug'), TestConfiguration('vista', 'x86', 'release')])) - self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ -BUGX1 WIN7 DEBUG : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - editor.remove_expectation(test, set(self.test_port.all_test_configurations())) - self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - test = "failures/expected/audio.html" - - editor.remove_expectation(test, set(self.test_port.all_test_configurations())) - self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), "") - - def test_update_expectation(self): - self.assert_update_roundtrip(""" -BUGX1 XP RELEASE : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ -BUG_NEWLY_CREATED XP RELEASE : failures/expected/keyboard.html = IMAGE""", 1) - - self.assert_update_roundtrip(""" -BUGX1 XP RELEASE : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([PASS]), '', 1) - - self.assert_update_roundtrip(""" -BUGX1 XP RELEASE : failures/expected = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ -BUGX1 XP RELEASE : failures/expected = TEXT -BUG_NEWLY_CREATED XP RELEASE : failures/expected/keyboard.html = IMAGE""", 1) - - self.assert_update_roundtrip(""" -BUGX1 XP RELEASE : failures/expected = TEXT""", 'failures/expected/keyboard.html', set([PASS]), """ -BUGX1 XP RELEASE : failures/expected = TEXT -BUG_NEWLY_CREATED XP RELEASE : failures/expected/keyboard.html = PASS""", 1) - - self.assert_update_roundtrip(""" -BUGX1 XP RELEASE : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([TEXT]), """ -BUGX1 XP RELEASE : failures/expected/keyboard.html = TEXT""", 0) - - self.assert_update_roundtrip(""" -BUGX1 XP RELEASE : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ -BUGAWESOME XP RELEASE : failures/expected/keyboard.html = IMAGE""", 1, parsed_bug_modifiers=['BUGAWESOME']) - - self.assert_update_roundtrip(""" -BUGX1 XP RELEASE : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ -BUG_NEWLY_CREATED XP RELEASE : failures/expected/keyboard.html = IMAGE""", 1) - - self.assert_update_roundtrip(""" -BUGX1 XP RELEASE : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([PASS]), '', 1) - - self.assert_update_roundtrip(""" -BUGX1 XP RELEASE : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ -BUGAWESOME XP RELEASE : failures/expected/keyboard.html = IMAGE""", 1, parsed_bug_modifiers=['BUGAWESOME']) - - self.assert_update_roundtrip(""" -BUGX1 WIN : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ -BUGX1 XP DEBUG : failures/expected/keyboard.html = TEXT -BUGX1 VISTA WIN7 : failures/expected/keyboard.html = TEXT -BUG_NEWLY_CREATED XP RELEASE : failures/expected/keyboard.html = IMAGE""", 2) - - self.assert_update_roundtrip(""" -BUGX1 WIN : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([PASS]), """ -BUGX1 XP DEBUG : failures/expected/keyboard.html = TEXT -BUGX1 VISTA WIN7 : failures/expected/keyboard.html = TEXT""", 1) - - self.assert_update_roundtrip(""" -BUGX1 WIN : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ -BUGX1 XP DEBUG : failures/expected/keyboard.html = TEXT -BUGX1 VISTA WIN7 : failures/expected/keyboard.html = TEXT -BUG_NEWLY_CREATED XP RELEASE : failures/expected/keyboard.html = IMAGE""", 2) - - self.assert_update_roundtrip(""" -BUGX1 XP RELEASE : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ -BUG_NEWLY_CREATED WIN RELEASE : failures/expected/keyboard.html = IMAGE""", 2, test_configs=self.WIN_RELEASE_CONFIGS) - - self.assert_update_roundtrip(""" -BUGX1 XP RELEASE : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([PASS]), '', 1, test_configs=self.WIN_RELEASE_CONFIGS) - - self.assert_update_roundtrip(""" -BUGX1 RELEASE : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ -BUGX1 LINUX MAC RELEASE : failures/expected/keyboard.html = TEXT -BUG_NEWLY_CREATED WIN RELEASE : failures/expected/keyboard.html = IMAGE""", 2, test_configs=self.WIN_RELEASE_CONFIGS) - - self.assert_update_roundtrip(""" -BUGX1 MAC : failures/expected/keyboard.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ -BUGX1 MAC : failures/expected/keyboard.html = TEXT -BUG_NEWLY_CREATED WIN RELEASE : failures/expected/keyboard.html = IMAGE""", 1, test_configs=self.WIN_RELEASE_CONFIGS) - - def test_update_expectation_relative(self): - self.assert_update_roundtrip(""" -BUGX1 XP RELEASE : failures/expected/keyboard.html = TEXT -BUGX2 MAC : failures/expected/audio.html = TEXT""", 'failures/expected/keyboard.html', set([IMAGE]), """ -BUGAWESOME XP RELEASE : failures/expected/keyboard.html = IMAGE -BUGX2 MAC : failures/expected/audio.html = TEXT""", 1, parsed_bug_modifiers=['BUGAWESOME']) - - def test_update_expectation_multiple(self): - in_string = """ -BUGX1 WIN : failures/expected/keyboard.html = IMAGE -BUGX2 WIN : failures/expected/audio.html = IMAGE""" - expectation_lines = self.make_parsed_expectation_lines(in_string) - converter = TestConfigurationConverter(self.test_port.all_test_configurations(), self.test_port.configuration_specifier_macros()) - editor = TestExpectationsEditor(expectation_lines, MockBugManager()) - test = "failures/expected/keyboard.html" - - editor.update_expectation(test, set([TestConfiguration('xp', 'x86', 'release')]), set([IMAGE_PLUS_TEXT]), ['BUG_UPDATE1']) - self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ -BUGX1 XP DEBUG : failures/expected/keyboard.html = IMAGE -BUGX1 VISTA WIN7 : failures/expected/keyboard.html = IMAGE -BUG_UPDATE1 XP RELEASE : failures/expected/keyboard.html = IMAGE+TEXT -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - editor.update_expectation(test, set([TestConfiguration('xp', 'x86', 'debug')]), set([TEXT]), ['BUG_UPDATE2']) - self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ -BUGX1 VISTA WIN7 : failures/expected/keyboard.html = IMAGE -BUG_UPDATE2 XP DEBUG : failures/expected/keyboard.html = TEXT -BUG_UPDATE1 XP RELEASE : failures/expected/keyboard.html = IMAGE+TEXT -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - editor.update_expectation(test, self.WIN_RELEASE_CONFIGS, set([CRASH]), ['BUG_UPDATE3']) - self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ -BUGX1 VISTA WIN7 DEBUG : failures/expected/keyboard.html = IMAGE -BUG_UPDATE2 XP DEBUG : failures/expected/keyboard.html = TEXT -BUG_UPDATE3 WIN RELEASE : failures/expected/keyboard.html = CRASH -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - editor.update_expectation(test, self.RELEASE_CONFIGS, set([IMAGE_PLUS_TEXT]), ['BUG_UPDATE4']) - self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ -BUGX1 VISTA WIN7 DEBUG : failures/expected/keyboard.html = IMAGE -BUG_UPDATE2 XP DEBUG : failures/expected/keyboard.html = TEXT -BUG_UPDATE4 RELEASE : failures/expected/keyboard.html = IMAGE+TEXT -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - editor.update_expectation(test, set(self.test_port.all_test_configurations()), set([TIMEOUT]), ['BUG_UPDATE5']) - self.assertEquals(TestExpectations.list_to_string(expectation_lines, converter), """ -BUG_UPDATE5 : failures/expected/keyboard.html = TIMEOUT -BUGX2 WIN : failures/expected/audio.html = IMAGE""") - - -if __name__ == '__main__': - unittest.main() diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py index ad8c3c331..156c68d94 100644 --- a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py +++ b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py @@ -207,6 +207,11 @@ class TestExpectationParser(object): @classmethod def _tokenize_line(cls, filename, expectation_string, line_number): + # FIXME: Add in support for the new format as well. + return cls._tokenize_line_using_old_format(filename, expectation_string, line_number) + + @classmethod + def _tokenize_line_using_old_format(cls, filename, expectation_string, line_number): """Tokenizes a line from TestExpectations and returns an unparsed TestExpectationLine instance. The format of a test expectation line is: @@ -246,6 +251,11 @@ class TestExpectationParser(object): return expectation_line @classmethod + def _tokenize_line_using_new_format(cls, filename, expectation_string, line_number): + # FIXME: implement :). + raise NotImplementedError + + @classmethod def _split_space_separated(cls, space_separated_string): """Splits a space-separated string into an array.""" return [part.strip() for part in space_separated_string.strip().split(' ')] diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py index 206219c4c..feecfbdff 100755 --- a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py @@ -370,6 +370,9 @@ class ChromiumPort(Port): VirtualTestSuite('platform/chromium/virtual/threaded/compositing/webgl', 'compositing/webgl', ['--enable-threaded-compositing']), + VirtualTestSuite('platform/chromium/virtual/gpu/fast/hidpi', + 'fast/hidpi', + ['--force-compositing-mode']), ] # diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py index 600d9a058..4ce18efdd 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py @@ -31,7 +31,6 @@ import copy import logging import os import re -import sets import subprocess import threading import time diff --git a/Tools/Scripts/webkitpy/layout_tests/port/driver.py b/Tools/Scripts/webkitpy/layout_tests/port/driver.py index 715fe7c1a..4bf53d46a 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/driver.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/driver.py @@ -33,6 +33,7 @@ import re import shlex import sys import time +import os from webkitpy.common.system import path @@ -276,6 +277,8 @@ class Driver(object): # FIXME: We're assuming that WebKitTestRunner checks this DumpRenderTree-named environment variable. environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir) environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir() + if 'WEBKITOUTPUTDIR' in os.environ: + environment['WEBKITOUTPUTDIR'] = os.environ['WEBKITOUTPUTDIR'] self._crashed_process_name = None self._crashed_pid = None self._server_process = self._port._server_process_constructor(self._port, server_name, self.cmd_line(pixel_tests, per_test_args), environment) diff --git a/Tools/Scripts/webkitpy/layout_tests/port/gtk.py b/Tools/Scripts/webkitpy/layout_tests/port/gtk.py index efebf2db0..3cc0ea566 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/gtk.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/gtk.py @@ -44,6 +44,15 @@ class GtkPort(Port, PulseAudioSanitizer): def _driver_class(self): return XvfbDriver + def default_timeout_ms(self): + # For now, use the base Port's default timeout value in case of WebKitTestRunner. + if self.get_option('webkit_test_runner'): + return super(GtkPort, self).default_timeout_ms() + + if self.get_option('configuration') == 'Debug': + return 12 * 1000 + return 6 * 1000 + def setup_test_run(self): self._unload_pulseaudio_module() @@ -63,11 +72,6 @@ class GtkPort(Port, PulseAudioSanitizer): 'Source', 'WebCore', 'platform', 'audio', 'resources') self._copy_value_from_environ_if_set(environment, 'WEBKITOUTPUTDIR') - if self.get_option('webkit_test_runner'): - # FIXME: This is a workaround to ensure that testing with WebKitTestRunner is started with - # a non-existing cache. This should be removed when (and if) it will be possible to properly - # set the cache directory path through a WebKitWebContext. - environment['XDG_CACHE_HOME'] = self._filesystem.join(self.results_directory(), 'appcache') return environment def _generate_all_test_configurations(self): diff --git a/Tools/Scripts/webkitpy/layout_tests/port/gtk_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/gtk_unittest.py index 5140305aa..f1df6bfa1 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/gtk_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/gtk_unittest.py @@ -38,6 +38,7 @@ from webkitpy.thirdparty.mock import Mock from webkitpy.common.system.filesystem_mock import MockFileSystem from webkitpy.tool.mocktool import MockOptions + class GtkPortTest(port_testcase.PortTestCase): port_name = 'gtk' port_maker = GtkPort @@ -48,13 +49,18 @@ class GtkPortTest(port_testcase.PortTestCase): expected_stderr = "MOCK run_command: ['Tools/Scripts/run-launcher', '--release', '--gtk', 'file://test.html'], cwd=/mock-checkout\n" OutputCapture().assert_outputs(self, port.show_results_html_file, ["test.html"], expected_stderr=expected_stderr) + def test_default_timeout_ms(self): + self.assertEquals(self.make_port(options=MockOptions(configuration='Release')).default_timeout_ms(), 6000) + self.assertEquals(self.make_port(options=MockOptions(configuration='Debug')).default_timeout_ms(), 12000) + self.assertEquals(self.make_port(options=MockOptions(webkit_test_runner=True, configuration='Debug')).default_timeout_ms(), 80000) + self.assertEquals(self.make_port(options=MockOptions(webkit_test_runner=True, configuration='Release')).default_timeout_ms(), 80000) + def assertLinesEqual(self, a, b): if hasattr(self, 'assertMultiLineEqual'): self.assertMultiLineEqual(a, b) else: self.assertEqual(a.splitlines(), b.splitlines()) - def test_get_crash_log(self): core_directory = os.environ.get('WEBKIT_CORE_DUMPS_DIRECTORY', '/path/to/coredumps') core_pattern = os.path.join(core_directory, "core-pid_%p-_-process_%e") diff --git a/Tools/Scripts/webkitpy/layout_tests/port/mac.py b/Tools/Scripts/webkitpy/layout_tests/port/mac.py index 400959cfd..e6fd5bd3c 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/mac.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/mac.py @@ -115,6 +115,12 @@ class MacPort(ApplePort): default_count = super(MacPort, self).default_child_processes() + # FIXME: https://bugs.webkit.org/show_bug.cgi?id=95906 With too many WebProcess WK2 tests get stuck in resource contention. + # To alleviate the issue reduce the number of running processes + # Anecdotal evidence suggests that a 4 core/8 core logical machine may run into this, but that a 2 core/4 core logical machine does not. + if self.get_option('webkit_test_runner') and default_count > 4: + default_count = int(.75 * default_count) + # Make sure we have enough ram to support that many instances: total_memory = self.host.platform.total_bytes_memory() bytes_per_drt = 256 * 1024 * 1024 # Assume each DRT needs 256MB to run. diff --git a/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py b/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py index 281b2173b..7e386a108 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py @@ -61,6 +61,8 @@ class XvfbDriver(Driver): environment = self._port.setup_environ_for_server(server_name) # We must do this here because the DISPLAY number depends on _worker_number environment['DISPLAY'] = ":%d" % display_id + # Drivers should use separate application cache locations + environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(self._port.results_directory(), '%s-appcache-%d' % (server_name, self._worker_number)) self._crashed_process_name = None self._crashed_pid = None diff --git a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py index b8a2ee4b3..34df002f7 100755 --- a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py +++ b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py @@ -100,8 +100,8 @@ class PerfTestsRunner(object): help="Do no generate results JSON and results page."), optparse.make_option("--output-json-path", help="Path to generate a JSON file at; may contain previous results if it already exists."), - optparse.make_option("--source-json-path", - help="Only used on bots. Path to a JSON file to be merged into the JSON file when --output-json-path is present."), + optparse.make_option("--source-json-path", # FIXME: Rename it to signify the fact it's a slave configuration. + help="Only used on bots. Path to a slave configuration file."), optparse.make_option("--description", help="Add a description to the output JSON file if one is generated"), optparse.make_option("--no-show-results", action="store_false", default=True, dest="show_results", @@ -180,7 +180,7 @@ class PerfTestsRunner(object): output = self._generate_results_dict(self._timestamp, options.description, options.platform, options.builder_name, options.build_number) if options.source_json_path: - output = self._merge_source_json(options.source_json_path, output) + output = self._merge_slave_config_json(options.source_json_path, output) if not output: return self.EXIT_CODE_BAD_SOURCE_JSON @@ -215,13 +215,17 @@ class PerfTestsRunner(object): return contents - def _merge_source_json(self, source_json_path, output): + def _merge_slave_config_json(self, slave_config_json_path, output): + if not self._host.filesystem.isfile(slave_config_json_path): + _log.error("Missing slave configuration JSON file: %s" % slave_config_json_path) + return None + try: - source_json_file = self._host.filesystem.open_text_file_for_reading(source_json_path) - source_json = json.load(source_json_file) - return dict(source_json.items() + output.items()) + slave_config_json = self._host.filesystem.open_text_file_for_reading(slave_config_json_path) + slave_config = json.load(slave_config_json) + return dict(slave_config.items() + output.items()) except Exception, error: - _log.error("Failed to merge source JSON file %s: %s" % (source_json_path, error)) + _log.error("Failed to merge slave configuration JSON file %s: %s" % (slave_config_json_path, error)) return None def _merge_outputs(self, output_json_path, output): diff --git a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py index 7e2f05ecd..6653857d8 100755 --- a/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py +++ b/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py @@ -282,7 +282,7 @@ max 548000 bytes self.assertEqual(results['Parser/memory-test:JSHeap'], {'min': 811000.0, 'max': 848000.0, 'median': 829000.0, 'stdev': 15000.0, 'avg': 832000.0, 'unit': 'bytes'}) self.assertEqual(results['Parser/memory-test:Malloc'], {'min': 511000.0, 'max': 548000.0, 'median': 529000.0, 'stdev': 13000.0, 'avg': 532000.0, 'unit': 'bytes'}) - def _test_run_with_json_output(self, runner, filesystem, upload_suceeds=True, expected_exit_code=0): + def _test_run_with_json_output(self, runner, filesystem, upload_suceeds=False, expected_exit_code=0): filesystem.write_text_file(runner._base_path + '/inspector/pass.html', 'some content') filesystem.write_text_file(runner._base_path + '/Bindings/event-target-wrapper.html', 'some content') @@ -291,7 +291,7 @@ max 548000 bytes def mock_upload_json(hostname, json_path): self.assertEqual(hostname, 'some.host') self.assertEqual(json_path, '/mock-checkout/output.json') - uploaded[0] = True + uploaded[0] = upload_suceeds return upload_suceeds runner._upload_json = mock_upload_json @@ -315,7 +315,9 @@ max 548000 bytes '', ''])) - return uploaded[0] + self.assertEqual(uploaded[0], upload_suceeds) + + return logs _event_target_wrapper_and_inspector_results = { "Bindings/event-target-wrapper": {"max": 1510, "avg": 1489.05, "median": 1487, "min": 1471, "stdev": 14.46, "unit": "ms"}, @@ -324,7 +326,7 @@ max 548000 bytes def test_run_with_json_output(self): runner, port = self.create_runner(args=['--output-json-path=/mock-checkout/output.json', '--test-results-server=some.host']) - self._test_run_with_json_output(runner, port.host.filesystem) + self._test_run_with_json_output(runner, port.host.filesystem, upload_suceeds=True) self.assertEqual(runner.load_output_json(), { "timestamp": 123456789, "results": self._event_target_wrapper_and_inspector_results, "webkit-revision": "5678", "branch": "webkit-trunk"}) @@ -332,7 +334,7 @@ max 548000 bytes def test_run_with_description(self): runner, port = self.create_runner(args=['--output-json-path=/mock-checkout/output.json', '--test-results-server=some.host', '--description', 'some description']) - self._test_run_with_json_output(runner, port.host.filesystem) + self._test_run_with_json_output(runner, port.host.filesystem, upload_suceeds=True) self.assertEqual(runner.load_output_json(), { "timestamp": 123456789, "description": "some description", "results": self._event_target_wrapper_and_inspector_results, @@ -350,7 +352,7 @@ max 548000 bytes def test_run_respects_no_results(self): runner, port = self.create_runner(args=['--output-json-path=/mock-checkout/output.json', '--test-results-server=some.host', '--no-results']) - self.assertFalse(self._test_run_with_json_output(runner, port.host.filesystem)) + self._test_run_with_json_output(runner, port.host.filesystem, upload_suceeds=False) self.assertFalse(port.host.filesystem.isfile('/mock-checkout/output.json')) def test_run_generates_json_by_default(self): @@ -419,29 +421,30 @@ max 548000 bytes port.host.filesystem.write_text_file('/mock-checkout/output.json', '{"another bad json": "1"}') self._test_run_with_json_output(runner, port.host.filesystem, expected_exit_code=PerfTestsRunner.EXIT_CODE_BAD_MERGE) - def test_run_with_json_source(self): + def test_run_with_slave_config_json(self): runner, port = self.create_runner(args=['--output-json-path=/mock-checkout/output.json', - '--source-json-path=/mock-checkout/source.json', '--test-results-server=some.host']) - port.host.filesystem.write_text_file('/mock-checkout/source.json', '{"key": "value"}') - self._test_run_with_json_output(runner, port.host.filesystem) + '--source-json-path=/mock-checkout/slave-config.json', '--test-results-server=some.host']) + port.host.filesystem.write_text_file('/mock-checkout/slave-config.json', '{"key": "value"}') + self._test_run_with_json_output(runner, port.host.filesystem, upload_suceeds=True) self.assertEqual(runner.load_output_json(), { "timestamp": 123456789, "results": self._event_target_wrapper_and_inspector_results, "webkit-revision": "5678", "branch": "webkit-trunk", "key": "value"}) - def test_run_with_bad_json_source(self): + def test_run_with_bad_slave_config_json(self): runner, port = self.create_runner(args=['--output-json-path=/mock-checkout/output.json', - '--source-json-path=/mock-checkout/source.json', '--test-results-server=some.host']) - self._test_run_with_json_output(runner, port.host.filesystem, expected_exit_code=PerfTestsRunner.EXIT_CODE_BAD_SOURCE_JSON) - port.host.filesystem.write_text_file('/mock-checkout/source.json', 'bad json') + '--source-json-path=/mock-checkout/slave-config.json', '--test-results-server=some.host']) + logs = self._test_run_with_json_output(runner, port.host.filesystem, expected_exit_code=PerfTestsRunner.EXIT_CODE_BAD_SOURCE_JSON) + self.assertTrue('Missing slave configuration JSON file: /mock-checkout/slave-config.json' in logs) + port.host.filesystem.write_text_file('/mock-checkout/slave-config.json', 'bad json') self._test_run_with_json_output(runner, port.host.filesystem, expected_exit_code=PerfTestsRunner.EXIT_CODE_BAD_SOURCE_JSON) - port.host.filesystem.write_text_file('/mock-checkout/source.json', '["another bad json"]') + port.host.filesystem.write_text_file('/mock-checkout/slave-config.json', '["another bad json"]') self._test_run_with_json_output(runner, port.host.filesystem, expected_exit_code=PerfTestsRunner.EXIT_CODE_BAD_SOURCE_JSON) def test_run_with_multiple_repositories(self): runner, port = self.create_runner(args=['--output-json-path=/mock-checkout/output.json', '--test-results-server=some.host']) port.repository_paths = lambda: [('webkit', '/mock-checkout'), ('some', '/mock-checkout/some')] - self._test_run_with_json_output(runner, port.host.filesystem) + self._test_run_with_json_output(runner, port.host.filesystem, upload_suceeds=True) self.assertEqual(runner.load_output_json(), { "timestamp": 123456789, "results": self._event_target_wrapper_and_inspector_results, "webkit-revision": "5678", "some-revision": "5678", "branch": "webkit-trunk"}) diff --git a/Tools/Scripts/webkitpy/style/checkers/cpp.py b/Tools/Scripts/webkitpy/style/checkers/cpp.py index 1e3f8767f..c573482c0 100644 --- a/Tools/Scripts/webkitpy/style/checkers/cpp.py +++ b/Tools/Scripts/webkitpy/style/checkers/cpp.py @@ -3028,6 +3028,11 @@ def check_language(filename, clean_lines, line_number, file_extension, include_s check_identifier_name_in_declaration(filename, line_number, line, file_state, error) + # Check for unsigned int (should be just 'unsigned') + if search(r'\bunsigned int\b', line): + error(line_number, 'runtime/unsigned', 1, + 'Omit int when using unsigned') + # Check that we're not using static_cast<Text*>. if search(r'\bstatic_cast<Text\*>', line): error(line_number, 'readability/check', 4, @@ -3595,6 +3600,7 @@ class CppChecker(object): 'runtime/sizeof', 'runtime/string', 'runtime/threadsafe_fn', + 'runtime/unsigned', 'runtime/virtual', 'whitespace/blank_line', 'whitespace/braces', diff --git a/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py index de99f5ed1..adc5c078b 100644 --- a/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py +++ b/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py @@ -4457,7 +4457,7 @@ class WebKitStyleTest(CppStyleTestBase): 'length_' + name_underscore_error_message) self.assert_lint('unsigned _length;', '_length' + name_underscore_error_message) - self.assert_lint('unsigned int _length;', + self.assert_lint('unsigned long _length;', '_length' + name_underscore_error_message) self.assert_lint('unsigned long long _length;', '_length' + name_underscore_error_message) diff --git a/Tools/Scripts/webkitpy/tool/commands/download.py b/Tools/Scripts/webkitpy/tool/commands/download.py index 60c89208f..1f73d1884 100644 --- a/Tools/Scripts/webkitpy/tool/commands/download.py +++ b/Tools/Scripts/webkitpy/tool/commands/download.py @@ -129,6 +129,11 @@ class LandCowboy(AbstractSequencedCommand): options.check_style_filter = "-changelog" +class LandCowhand(LandCowboy): + # Gender-blind term for cowboy, see: http://en.wiktionary.org/wiki/cowhand + name = "land-cowhand" + + class CheckStyleLocal(AbstractSequencedCommand): name = "check-style-local" help_text = "Run check-webkit-style on the current working directory diff" diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py index a506cd703..817d92058 100644 --- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py +++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py @@ -29,9 +29,6 @@ import os from webkitpy.common.memoized import memoized from webkitpy.tool.servers.reflectionhandler import ReflectionHandler -from webkitpy.layout_tests.controllers.test_expectations_editor import BugManager, TestExpectationsEditor -from webkitpy.layout_tests.models.test_expectations import TestExpectationParser, TestExpectations -from webkitpy.layout_tests.models.test_configuration import TestConfigurationConverter from webkitpy.layout_tests.port import builders @@ -53,38 +50,6 @@ class BuildCoverageExtrapolator(object): return self._covered_test_configurations_for_builder_name()[builder_name] -class GardeningExpectationsUpdater(BugManager): - def __init__(self, tool, port): - self._converter = TestConfigurationConverter(port.all_test_configurations(), port.configuration_specifier_macros()) - self._extrapolator = BuildCoverageExtrapolator(self._converter) - self._parser = TestExpectationParser(port, [], allow_rebaseline_modifier=False) - self._path_to_test_expectations_file = port.path_to_test_expectations_file() - self._tool = tool - - def close_bug(self, bug_id, reference_bug_id=None): - # FIXME: Implement this properly. - pass - - def create_bug(self): - return "BUG_NEW" - - def update_expectations(self, failure_info_list): - expectation_lines = self._parser.parse(self._path_to_test_expectations_file, self._tool.filesystem.read_text_file(self._path_to_test_expectations_file)) - editor = TestExpectationsEditor(expectation_lines, self) - updated_expectation_lines = [] - # FIXME: Group failures by testName+failureTypeList. - for failure_info in failure_info_list: - expectation_set = set(filter(lambda expectation: expectation is not None, - map(TestExpectations.expectation_from_string, failure_info['failureTypeList']))) - assert(expectation_set) - test_name = failure_info['testName'] - assert(test_name) - builder_name = failure_info['builderName'] - affected_test_configuration_set = self._extrapolator.extrapolate_test_configurations(builder_name) - updated_expectation_lines.extend(editor.update_expectation(test_name, affected_test_configuration_set, expectation_set)) - self._tool.filesystem.write_text_file(self._path_to_test_expectations_file, TestExpectations.list_to_string(expectation_lines, self._converter, reconstitute_only_these=updated_expectation_lines)) - - class GardeningHTTPServer(BaseHTTPServer.HTTPServer): def __init__(self, httpd_port, config): server_name = '' @@ -114,13 +79,6 @@ class GardeningHTTPRequestHandler(ReflectionHandler): def _run_webkit_patch(self, args): return self.server.tool.executive.run_command([self.server.tool.path()] + args, cwd=self.server.tool.scm().checkout_root) - @memoized - def _expectations_updater(self): - # FIXME: Should split failure_info_list into lists per port, then edit each expectations file separately. - # For now, assume Chromium port. - port = self.server.tool.get("chromium-win-win7") - return GardeningExpectationsUpdater(self.server.tool, port) - def rollout(self): revision = self.query['revision'][0] reason = self.query['reason'][0] @@ -136,10 +94,6 @@ class GardeningHTTPRequestHandler(ReflectionHandler): def ping(self): self._serve_text('pong') - def updateexpectations(self): - self._expectations_updater().update_expectations(self._read_entity_body_as_json()) - self._serve_text('success') - def rebaselineall(self): command = ['rebaseline-json'] json_input = self.read_entity_body() diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py index 166d191ac..22e853491 100644 --- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py +++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py @@ -97,79 +97,6 @@ class BuildCoverageExtrapolatorTest(unittest.TestCase): self.assertRaises(KeyError, extrapolator.extrapolate_test_configurations, "Potato") -class GardeningExpectationsUpdaterTest(unittest.TestCase): - def __init__(self, testFunc): - self.tool = MockTool() - self.tool.executive = MockExecutive(should_log=True) - self.tool.filesystem.files[TestPortFactory.path_to_test_expectations_file()] = "" - unittest.TestCase.__init__(self, testFunc) - - def assert_update(self, failure_info_list, expectations_before=None, expectations_after=None, expected_exception=None): - updater = GardeningExpectationsUpdater(self.tool, TestPortFactory.create()) - path_to_test_expectations_file = TestPortFactory.path_to_test_expectations_file() - self.tool.filesystem.files[path_to_test_expectations_file] = expectations_before or "" - if expected_exception: - self.assertRaises(expected_exception, updater.update_expectations, (failure_info_list)) - else: - updater.update_expectations(failure_info_list) - self.assertEquals(self.tool.filesystem.files[path_to_test_expectations_file], expectations_after) - - def test_empty_expectations(self): - failure_info_list = [] - expectations_before = "" - expectations_after = "" - self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) - - def test_unknown_builder(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Bob", "failureTypeList": ["IMAGE"]}] - self.assert_update(failure_info_list, expected_exception=KeyError) - - def test_empty_failure_type_list(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": []}] - self.assert_update(failure_info_list, expected_exception=AssertionError) - - def test_empty_test_name(self): - failure_info_list = [{"testName": "", "builderName": "Webkit Win", "failureTypeList": ["TEXT"]}] - self.assert_update(failure_info_list, expected_exception=AssertionError) - - def test_unknown_failure_type(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE", "EXPLODE"]}] - expectations_before = "" - expectations_after = "\nBUG_NEW XP RELEASE : failures/expected/image.html = IMAGE" - self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) - - def test_add_new_expectation(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE"]}] - expectations_before = "" - expectations_after = "\nBUG_NEW XP RELEASE : failures/expected/image.html = IMAGE" - self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) - - def test_replace_old_expectation(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE"]}] - expectations_before = "BUG_OLD XP RELEASE : failures/expected/image.html = TEXT" - expectations_after = "BUG_NEW XP RELEASE : failures/expected/image.html = IMAGE" - self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) - - def test_pass_expectation(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["PASS"]}] - expectations_before = "BUG_OLD XP RELEASE : failures/expected/image.html = TEXT" - expectations_after = "" - self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) - - def test_supplement_old_expectation(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE"]}] - expectations_before = "BUG_OLD XP RELEASE : failures/expected/text.html = TEXT" - expectations_after = ("BUG_OLD XP RELEASE : failures/expected/text.html = TEXT\n" - "BUG_NEW XP RELEASE : failures/expected/image.html = IMAGE") - self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) - - def test_spurious_updates(self): - failure_info_list = [{"testName": "failures/expected/image.html", "builderName": "Webkit Win", "failureTypeList": ["IMAGE"]}] - expectations_before = "BUG_OLDER MAC LINUX : failures/expected/image.html = IMAGE+TEXT\nBUG_OLD XP RELEASE : failures/expected/image.html = TEXT" - expectations_after = "BUG_OLDER MAC LINUX : failures/expected/image.html = IMAGE+TEXT\nBUG_NEW XP RELEASE : failures/expected/image.html = IMAGE" - self.assert_update(failure_info_list, expectations_before=expectations_before, expectations_after=expectations_after) - - class GardeningServerTest(unittest.TestCase): def _post_to_path(self, path, body=None, expected_stderr=None, expected_stdout=None, server=None): handler = TestGardeningHTTPRequestHandler(server or MockServer()) @@ -203,8 +130,3 @@ class GardeningServerTest(unittest.TestCase): expected_stderr = 'MOCK run_command: [\'echo\', \'rebaseline-json\'], cwd=/mock-checkout, input={"user-scripts/another-test.html":{"MOCK builder": ["txt","png"]}}\n' expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n" self._post_to_path("/rebaselineall", body='{"user-scripts/another-test.html":{"MOCK builder": ["txt","png"]}}', expected_stderr=expected_stderr, expected_stdout=expected_stdout) - - def test_updateexpectations(self): - expected_stderr = "" - expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n" - self._post_to_path("/updateexpectations", body="[]", expected_stderr=expected_stderr, expected_stdout=expected_stdout) |
