summaryrefslogtreecommitdiff
path: root/Tools/Scripts/webkitpy
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-27 21:51:42 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-27 21:51:42 +0200
commitbe01689f43cf6882cf670d33df49ead1f570c53a (patch)
tree4bb2161d8983b38e3e7ed37b4a50303bfd5e2e85 /Tools/Scripts/webkitpy
parenta89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (diff)
downloadqtwebkit-be01689f43cf6882cf670d33df49ead1f570c53a.tar.gz
Imported WebKit commit 8d6c5efc74f0222dfc7bcce8d845d4a2707ed9e6 (http://svn.webkit.org/repository/webkit/trunk@118629)
Diffstat (limited to 'Tools/Scripts/webkitpy')
-rw-r--r--Tools/Scripts/webkitpy/common/checkout/scm/git.py8
-rw-r--r--Tools/Scripts/webkitpy/common/checkout/scm/scm.py6
-rw-r--r--Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py13
-rw-r--r--Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py22
-rw-r--r--Tools/Scripts/webkitpy/common/checkout/scm/svn.py18
-rw-r--r--Tools/Scripts/webkitpy/common/config/committers.py3
-rwxr-xr-xTools/Scripts/webkitpy/common/config/watchlist4
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py70
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/mac.py8
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/test.py4
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/webkit.py7
11 files changed, 119 insertions, 44 deletions
diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/git.py b/Tools/Scripts/webkitpy/common/checkout/scm/git.py
index c7dbd7ca1..43fdb9c00 100644
--- a/Tools/Scripts/webkitpy/common/checkout/scm/git.py
+++ b/Tools/Scripts/webkitpy/common/checkout/scm/git.py
@@ -160,11 +160,11 @@ class Git(SCM, SVNRepository):
def _status_regexp(self, expected_types):
return '^(?P<status>[%s])\t(?P<filename>.+)$' % expected_types
- def add(self, path, return_exit_code=False):
- return self.run(["git", "add", path], return_exit_code=return_exit_code)
+ def add_list(self, paths, return_exit_code=False):
+ return self.run(["git", "add"] + paths, return_exit_code=return_exit_code)
- def delete(self, path):
- return self.run(["git", "rm", "-f", path])
+ def delete_list(self, paths):
+ return self.run(["git", "rm", "-f"] + paths)
def exists(self, path):
return_code = self.run(["git", "show", "HEAD:%s" % path], return_exit_code=True, decode_output=False)
diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/scm.py b/Tools/Scripts/webkitpy/common/checkout/scm/scm.py
index 9ff9e5f77..6b6e6fcf0 100644
--- a/Tools/Scripts/webkitpy/common/checkout/scm/scm.py
+++ b/Tools/Scripts/webkitpy/common/checkout/scm/scm.py
@@ -154,9 +154,15 @@ class SCM:
self._subclass_must_implement()
def add(self, path, return_exit_code=False):
+ self.add_list([path], return_exit_code)
+
+ def add_list(self, paths, return_exit_code=False):
self._subclass_must_implement()
def delete(self, path):
+ self.delete_list([path])
+
+ def delete_list(self, paths):
self._subclass_must_implement()
def exists(self, path):
diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py b/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py
index f203cfa1a..8b6c76499 100644
--- a/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py
+++ b/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py
@@ -38,7 +38,10 @@ class MockSCM(object):
self._executive = executive or MockExecutive()
def add(self, destination_path, return_exit_code=False):
- self.added_paths.add(destination_path)
+ self.add_list([destination_path], return_exit_code)
+
+ def add_list(self, destination_paths, return_exit_code=False):
+ self.added_paths.update(set(destination_paths))
if return_exit_code:
return 0
@@ -111,7 +114,11 @@ class MockSCM(object):
return "49824"
def delete(self, path):
+ return self.delete_list([path])
+
+ def delete_list(self, paths):
if not self._filesystem:
return
- if self._filesystem.exists(path):
- self._filesystem.remove(path)
+ for path in paths:
+ if self._filesystem.exists(path):
+ self._filesystem.remove(path)
diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py b/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
index 7ce714a19..802fe2cee 100644
--- a/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
+++ b/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
@@ -315,6 +315,10 @@ class SCMTest(unittest.TestCase):
write_into_file_at_path("added_file", "new stuff")
self.scm.add("added_file")
+ write_into_file_at_path("added_file3", "more new stuff")
+ write_into_file_at_path("added_file4", "more new stuff")
+ self.scm.add_list(["added_file3", "added_file4"])
+
os.mkdir("added_dir")
write_into_file_at_path("added_dir/added_file2", "new stuff")
self.scm.add("added_dir")
@@ -323,12 +327,14 @@ class SCMTest(unittest.TestCase):
added_files = self.scm.added_files()
if "added_dir" in added_files:
added_files.remove("added_dir")
- self.assertEqual(added_files, ["added_dir/added_file2", "added_file"])
+ self.assertEqual(added_files, ["added_dir/added_file2", "added_file", "added_file3", "added_file4"])
# Test also to make sure clean_working_directory removes added files
self.scm.clean_working_directory()
self.assertEqual(self.scm.added_files(), [])
self.assertFalse(os.path.exists("added_file"))
+ self.assertFalse(os.path.exists("added_file3"))
+ self.assertFalse(os.path.exists("added_file4"))
self.assertFalse(os.path.exists("added_dir"))
def _shared_test_changed_files_for_revision(self):
@@ -820,6 +826,12 @@ END
self.scm.delete("test_file")
self.assertTrue("test_file" in self.scm.deleted_files())
+ def test_delete_list(self):
+ os.chdir(self.svn_checkout_path)
+ self.scm.delete_list(["test_file", "test_file2"])
+ self.assertTrue("test_file" in self.scm.deleted_files())
+ self.assertTrue("test_file2" in self.scm.deleted_files())
+
def test_delete_recursively(self):
self._shared_test_delete_recursively()
@@ -1172,7 +1184,7 @@ class GitSVNTest(SCMTest):
def _two_local_commits(self):
self._one_local_commit()
- self._second_local_commt()
+ self._second_local_commit()
def _three_local_commits(self):
self._local_commit('test_file_commit0', 'more test content', 'another test commit')
@@ -1517,6 +1529,12 @@ class GitSVNTest(SCMTest):
self.scm.delete('test_file_commit1')
self.assertTrue("test_file_commit1" in self.scm.deleted_files())
+ def test_delete_list(self):
+ self._two_local_commits()
+ self.scm.delete_list(["test_file_commit1", "test_file_commit2"])
+ self.assertTrue("test_file_commit1" in self.scm.deleted_files())
+ self.assertTrue("test_file_commit2" in self.scm.deleted_files())
+
def test_delete_recursively(self):
self._shared_test_delete_recursively()
diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/svn.py b/Tools/Scripts/webkitpy/common/checkout/scm/svn.py
index 6a2e1319b..3c269175c 100644
--- a/Tools/Scripts/webkitpy/common/checkout/scm/svn.py
+++ b/Tools/Scripts/webkitpy/common/checkout/scm/svn.py
@@ -178,9 +178,10 @@ class SVN(SCM, SVNRepository):
self._add_parent_directories(dirname)
self.add(path)
- def add(self, path, return_exit_code=False):
- self._add_parent_directories(os.path.dirname(os.path.abspath(path)))
- return self._run_svn(["add", path], return_exit_code=return_exit_code)
+ def add_list(self, paths, return_exit_code=False):
+ for path in paths:
+ self._add_parent_directories(os.path.dirname(os.path.abspath(path)))
+ return self._run_svn(["add"] + paths, return_exit_code=return_exit_code)
def _delete_parent_directories(self, path):
if not self.in_working_directory(path):
@@ -192,11 +193,12 @@ class SVN(SCM, SVNRepository):
if dirname != path:
self._delete_parent_directories(dirname)
- def delete(self, path):
- abs_path = os.path.abspath(path)
- parent, base = os.path.split(abs_path)
- result = self._run_svn(["delete", "--force", base], cwd=parent)
- self._delete_parent_directories(os.path.dirname(abs_path))
+ def delete_list(self, paths):
+ for path in paths:
+ abs_path = os.path.abspath(path)
+ parent, base = os.path.split(abs_path)
+ result = self._run_svn(["delete", "--force", base], cwd=parent)
+ self._delete_parent_directories(os.path.dirname(abs_path))
return result
def exists(self, path):
diff --git a/Tools/Scripts/webkitpy/common/config/committers.py b/Tools/Scripts/webkitpy/common/config/committers.py
index 5a3656482..3f99eaddc 100644
--- a/Tools/Scripts/webkitpy/common/config/committers.py
+++ b/Tools/Scripts/webkitpy/common/config/committers.py
@@ -122,7 +122,6 @@ contributors_who_are_not_committers = [
Contributor("Brian Salomon", "bsalomon@google.com"),
Contributor("Commit Queue", "commit-queue@webkit.org"),
Contributor("Daniel Sievers", "sievers@chromium.org"),
- Contributor("Dave Barton", "dbarton@mathscribe.com"),
Contributor("Dave Tharp", "dtharp@codeaurora.org", "dtharp"),
Contributor("David Barr", "davidbarr@chromium.org", "barrbrain"),
Contributor("David Dorwin", "ddorwin@chromium.org", "ddorwin"),
@@ -222,6 +221,7 @@ committers_unable_to_review = [
Committer("Dan Winship", "danw@gnome.org", "danw"),
Committer("Dana Jansens", "danakj@chromium.org", "danakj"),
Committer("Daniel Cheng", "dcheng@chromium.org", "dcheng"),
+ Committer("Dave Barton", "dbarton@mathscribe.com", "dbarton"),
Committer("David Grogan", ["dgrogan@chromium.org", "dgrogan@google.com"], "dgrogan"),
Committer("David Smith", ["catfish.man@gmail.com", "dsmith@webkit.org"], "catfishman"),
Committer("Diego Gonzalez", ["diegohcg@webkit.org", "diego.gonzalez@openbossa.org"], "diegohcg"),
@@ -287,6 +287,7 @@ committers_unable_to_review = [
Committer("Kaustubh Atrawalkar", ["kaustubh@motorola.com"], "silverroots"),
Committer("Keishi Hattori", "keishi@webkit.org", "keishi"),
Committer("Kelly Norton", "knorton@google.com"),
+ Committer("Ken Buchanan", "kenrb@chromium.org", "kenrb"),
Committer("Kenichi Ishibashi", "bashi@chromium.org", "bashi"),
Committer("Kenji Imasaki", "imasaki@chromium.org", "imasaki"),
Committer("Kent Hansen", "kent.hansen@nokia.com", "khansen"),
diff --git a/Tools/Scripts/webkitpy/common/config/watchlist b/Tools/Scripts/webkitpy/common/config/watchlist
index bd26b2787..ca7b72578 100755
--- a/Tools/Scripts/webkitpy/common/config/watchlist
+++ b/Tools/Scripts/webkitpy/common/config/watchlist
@@ -154,6 +154,9 @@
},
"Media": {
"filename": r"(Source|LayoutTests)/.*([Mm]edia|[Aa]udio|[Vv]ideo)",
+ },
+ "MathML": {
+ "filename": r"(Source|LayoutTests|Websites)/.*mathml",
}
},
"CC_RULES": {
@@ -173,6 +176,7 @@
"GStreamerGraphics": [ "alexis.menard@openbossa.org", "pnormand@igalia.com", "gns@gnome.org", "mrobinson@webkit.org" ],
"GtkWebKit2PublicAPI": [ "cgarcia@igalia.com", "gns@gnome.org", "mrobinson@webkit.org" ],
"Loader": [ "japhet@chromium.org" ],
+ "MathML": [ "dbarton@mathscribe.com" ],
"Media": [ "feature-media-reviews@chromium.org", "eric.carlson@apple.com" ],
"QtBuildSystem" : [ "vestbo@webkit.org", ],
"QtWebKit2PlatformSpecific": [ "alexis.menard@openbossa.org", "zoltan@webkit.org", "cmarcelo@webkit.org" ],
diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py b/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py
index a58aac940..63e18ac8a 100644
--- a/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py
@@ -73,6 +73,7 @@ class ShardingTests(unittest.TestCase):
"dom/html/level2/html/HTMLAnchorElement03.html",
"ietestcenter/Javascript/11.1.5_4-4-c-1.html",
"dom/html/level2/html/HTMLAnchorElement06.html",
+ "perf/object-keys.html",
]
def get_shards(self, num_workers, fully_parallel, test_list=None, max_locked_shards=None):
@@ -95,7 +96,8 @@ class ShardingTests(unittest.TestCase):
['http/tests/security/view-source-no-refresh.html',
'http/tests/websocket/tests/unicode.htm',
'http/tests/websocket/tests/websocket-protocol-ignored.html',
- 'http/tests/xmlhttprequest/supported-xml-content-types.html'])])
+ 'http/tests/xmlhttprequest/supported-xml-content-types.html',
+ 'perf/object-keys.html'])])
self.assertEquals(unlocked,
[TestShard('animations',
['animations/keyframes.html']),
@@ -113,7 +115,8 @@ class ShardingTests(unittest.TestCase):
[TestShard('.', ['http/tests/websocket/tests/unicode.htm']),
TestShard('.', ['http/tests/security/view-source-no-refresh.html']),
TestShard('.', ['http/tests/websocket/tests/websocket-protocol-ignored.html']),
- TestShard('.', ['http/tests/xmlhttprequest/supported-xml-content-types.html'])])
+ TestShard('.', ['http/tests/xmlhttprequest/supported-xml-content-types.html']),
+ TestShard('.', ['perf/object-keys.html'])]),
self.assertEquals(unlocked,
[TestShard('.', ['animations/keyframes.html']),
TestShard('.', ['fast/css/display-none-inline-style-change-crash.html']),
@@ -128,7 +131,8 @@ class ShardingTests(unittest.TestCase):
['http/tests/websocket/tests/unicode.htm',
'http/tests/security/view-source-no-refresh.html',
'http/tests/websocket/tests/websocket-protocol-ignored.html',
- 'http/tests/xmlhttprequest/supported-xml-content-types.html'])])
+ 'http/tests/xmlhttprequest/supported-xml-content-types.html',
+ 'perf/object-keys.html'])])
self.assertEquals(unlocked,
[TestShard('unlocked_tests',
['animations/keyframes.html',
@@ -157,7 +161,8 @@ class ShardingTests(unittest.TestCase):
'http/tests/websocket/tests/unicode.htm',
'http/tests/websocket/tests/websocket-protocol-ignored.html']),
TestShard('locked_shard_2',
- ['http/tests/xmlhttprequest/supported-xml-content-types.html'])])
+ ['http/tests/xmlhttprequest/supported-xml-content-types.html',
+ 'perf/object-keys.html'])])
locked, unlocked = self.get_shards(num_workers=4, fully_parallel=False)
self.assertEquals(locked,
@@ -165,7 +170,29 @@ class ShardingTests(unittest.TestCase):
['http/tests/security/view-source-no-refresh.html',
'http/tests/websocket/tests/unicode.htm',
'http/tests/websocket/tests/websocket-protocol-ignored.html',
- 'http/tests/xmlhttprequest/supported-xml-content-types.html'])])
+ 'http/tests/xmlhttprequest/supported-xml-content-types.html',
+ 'perf/object-keys.html'])])
+
+
+class LockCheckingManager(Manager):
+ def __init__(self, port, options, printer, tester, http_lock):
+ super(LockCheckingManager, self).__init__(port, options, printer)
+ self._finished_list_called = False
+ self._tester = tester
+ self._should_have_http_lock = http_lock
+
+ def handle_finished_list(self, source, list_name, num_tests, elapsed_time):
+ if not self._finished_list_called:
+ self._tester.assertEquals(list_name, 'locked_tests')
+ self._tester.assertTrue(self._remaining_locked_shards)
+ self._tester.assertTrue(self._has_http_lock is self._should_have_http_lock)
+
+ super(LockCheckingManager, self).handle_finished_list(source, list_name, num_tests, elapsed_time)
+
+ if not self._finished_list_called:
+ self._tester.assertEquals(self._remaining_locked_shards, [])
+ self._tester.assertFalse(self._has_http_lock)
+ self._finished_list_called = True
class ManagerTest(unittest.TestCase):
@@ -192,30 +219,25 @@ class ManagerTest(unittest.TestCase):
self.assertTrue('Baseline search path: test-mac-leopard -> test-mac-snowleopard -> generic' in printer.output)
def test_http_locking(tester):
- class LockCheckingManager(Manager):
- def __init__(self, port, options, printer):
- super(LockCheckingManager, self).__init__(port, options, printer)
- self._finished_list_called = False
-
- def handle_finished_list(self, source, list_name, num_tests, elapsed_time):
- if not self._finished_list_called:
- tester.assertEquals(list_name, 'locked_tests')
- tester.assertTrue(self._remaining_locked_shards)
- tester.assertTrue(self._has_http_lock)
-
- super(LockCheckingManager, self).handle_finished_list(source, list_name, num_tests, elapsed_time)
-
- if not self._finished_list_called:
- tester.assertEquals(self._remaining_locked_shards, [])
- tester.assertFalse(self._has_http_lock)
- self._finished_list_called = True
-
options, args = run_webkit_tests.parse_args(['--platform=test', '--print=nothing', 'http/tests/passes', 'passes'])
host = MockHost()
port = host.port_factory.get(port_name=options.platform, options=options)
run_webkit_tests._set_up_derived_options(port, options)
printer = printing.Printer(port, options, StringIO.StringIO(), StringIO.StringIO())
- manager = LockCheckingManager(port, options, printer)
+ manager = LockCheckingManager(port, options, printer, tester, True)
+ manager.collect_tests(args)
+ manager.parse_expectations()
+ num_unexpected_results = manager.run()
+ printer.cleanup()
+ tester.assertEquals(num_unexpected_results, 0)
+
+ def test_perf_locking(tester):
+ options, args = run_webkit_tests.parse_args(['--platform=test', '--print=nothing', '--no-http', 'passes', 'perf/'])
+ host = MockHost()
+ port = host.port_factory.get(port_name=options.platform, options=options)
+ run_webkit_tests._set_up_derived_options(port, options)
+ printer = printing.Printer(port, options, StringIO.StringIO(), StringIO.StringIO())
+ manager = LockCheckingManager(port, options, printer, tester, False)
manager.collect_tests(args)
manager.parse_expectations()
num_unexpected_results = manager.run()
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/mac.py b/Tools/Scripts/webkitpy/layout_tests/port/mac.py
index 9513ae5bd..855217682 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/mac.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/mac.py
@@ -1,4 +1,5 @@
# Copyright (C) 2011 Google Inc. All rights reserved.
+# Copyright (C) 2012 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -239,3 +240,10 @@ class MacPort(ApplePort):
_log.debug("IOError raised while stopping helper: %s" % str(e))
pass
self._helper = None
+
+ def nm_command(self):
+ try:
+ return self._executive.run_command(['xcrun', '-find', 'nm']).rstrip()
+ except ScriptError, e:
+ _log.warn("xcrun failed; falling back to 'nm'.")
+ return 'nm'
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/test.py b/Tools/Scripts/webkitpy/layout_tests/port/test.py
index d2e64b6db..8abd81235 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/test.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/test.py
@@ -222,6 +222,10 @@ layer at (0,0) size 800x34
tests.add('platform/test-snow-leopard/http/test.html')
tests.add('platform/test-snow-leopard/websocket/test.html')
+ # For testing if perf tests are running in a locked shard.
+ tests.add('perf/foo/test.html')
+ tests.add('perf/foo/test-ref.html')
+
return tests
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/webkit.py b/Tools/Scripts/webkitpy/layout_tests/port/webkit.py
index 0965b44a4..d798039ac 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/webkit.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/webkit.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>, University of Szeged
-# Copyright (C) 2011 Apple Inc. All rights reserved.
+# Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -262,12 +262,15 @@ class WebKitPort(Port):
"""If a port makes certain features available only through runtime flags, it can override this routine to indicate which ones are available."""
return None
+ def nm_command(self):
+ return 'nm'
+
def _webcore_symbols_string(self):
webcore_library_path = self._path_to_webcore_library()
if not webcore_library_path:
return None
try:
- return self._executive.run_command(['nm', webcore_library_path], error_handler=Executive.ignore_error)
+ return self._executive.run_command([self.nm_command(), webcore_library_path], error_handler=Executive.ignore_error)
except OSError, e:
_log.warn("Failed to run nm: %s. Can't determine WebCore supported features." % e)
return None