Changeset 69638 in webkit
- Timestamp:
- Oct 12, 2010 9:39:56 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r69637 r69638 1 2010-10-12 Dirk Pranke <dpranke@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 This patch enables new-run-webkit-tests (in particular the 6 chromium-win port) to run under Cygwin as well as Win32. Mostly 7 this just required some conversions from cygwin paths to Win32 8 paths when we spawn off Win32 binaries like test_shell. 9 10 https://bugs.webkit.org/show_bug.cgi?id=47220 11 12 * Scripts/webkitpy/common/system/path.py: 13 - Expose the cygpath() function for path conversion 14 15 * Scripts/webkitpy/layout_tests/run_webkit_tests.py: 16 * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py: 17 - shift filename->uri conversion in the TestInfo objects to the 18 dump_render_tree thread 19 20 * Scripts/webkitpy/layout_tests/port/base.py: 21 * Scripts/webkitpy/layout_tests/port/chromium.py: 22 - use cygpath() 23 1 24 2010-10-12 Yuta Kitamura <yutak@chromium.org> 2 25 -
trunk/WebKitTools/Scripts/webkitpy/common/system/path.py
r69363 r69638 39 39 40 40 41 def cygpath(path, executive): 42 """Converts a cygwin path to Windows path.""" 43 # FIXME: this may not be correct in every situation, but forking 44 # cygpath is very slow. More importantly, there is a bug in Python 45 # where launching subprocesses and communicating with PIPEs (which 46 # is what run_command() does) can lead to deadlocks when running in 47 # multiple threads. 48 if path.startswith("/cygdrive"): 49 path = path[10] + ":" + path[11:] 50 path = path.replace("/", "\\") 51 return path 52 return executive.run_command(['cygpath', '-wa', path], 53 decode_output=False).rstrip() 54 55 41 56 def _escape(path): 42 57 """Handle any characters in the path that should be escaped.""" … … 53 68 return _winpath_to_uri(path) 54 69 if platform == 'cygwin': 55 return _winpath_to_uri( _cygpath(path, executive))70 return _winpath_to_uri(cygpath(path, executive)) 56 71 return _unixypath_to_uri(path) 57 72 … … 61 76 return "///" + path.replace("\\", "/") 62 77 63 64 def _cygpath(path, executive):65 """Converts a cygwin path to Windows path."""66 return executive.run_command(['cygpath', '-wa', path],67 decode_output=False).rstrip()68 69 70 78 def _unixypath_to_uri(path): 71 79 """Converts a unix-style path to a file: URL.""" -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
r69578 r69638 84 84 options: command line options argument from optparse 85 85 proc: an active DumpRenderTree process 86 test_info: Object containing the test filename , uriand timeout86 test_info: Object containing the test filename and timeout 87 87 test_types: list of test types to subject the output to 88 88 test_args: arguments to be passed to each test … … 173 173 port: object implementing port-specific hooks 174 174 options: command line argument object from optparse 175 test_info: Object containing the test filename , uriand timeout175 test_info: Object containing the test filename and timeout 176 176 test_types: A list of TestType objects to run the test output 177 177 against. … … 194 194 # in coverage: see http://bitbucket.org/ned/coveragepy/issue/85. 195 195 test_info = self._test_info 196 uri = self._port.filename_to_uri(test_info.filename) 196 197 self._driver = self._port.create_driver(self._test_args.png_path, 197 198 self._options) … … 199 200 start = time.time() 200 201 crash, timeout, actual_checksum, output, error = \ 201 self._driver.run_test( test_info.uri.strip(), test_info.timeout,202 self._driver.run_test(uri, test_info.timeout, 202 203 test_info.image_hash()) 203 204 end = time.time() … … 256 257 options: command line options argument from optparse 257 258 filename_list_queue: A thread safe Queue class that contains lists 258 of tuples of (filename, uri) pairs.259 of (filename, TestInfo) pairs. 259 260 result_queue: A thread safe Queue class that will contain tuples of 260 261 (test, failure lists) for the test results. … … 460 461 461 462 Args: 462 test_info: Object containing the test filename , uriand timeout463 test_info: Object containing the test filename and timeout 463 464 464 465 Returns: … … 508 509 509 510 Args: 510 test_info: Object containing the test filename , uriand timeout511 test_info: Object containing the test filename and timeout 511 512 512 513 Returns: … … 530 531 self._next_timeout = start + thread_timeout 531 532 533 uri = self._port.filename_to_uri(test_info.filename) 532 534 crash, timeout, actual_checksum, output, error = \ 533 self._driver.run_test( test_info.uri, test_info.timeout, image_hash)535 self._driver.run_test(uri, test_info.timeout, image_hash) 534 536 end = time.time() 535 537 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
r69578 r69638 50 50 from webkitpy.common.system import logutils 51 51 from webkitpy.common.system.executive import Executive, ScriptError 52 from webkitpy.common.system.path import abspath_to_uri 52 53 from webkitpy.common.system.user import User 53 54 … … 313 314 return "%s://127.0.0.1:%u/%s" % (protocol, port, relative_path) 314 315 315 abspath = os.path.abspath(filename) 316 317 # On Windows, absolute paths are of the form "c:\foo.txt". However, 318 # all current browsers (except for Opera) normalize file URLs by 319 # prepending an additional "/" as if the absolute path was 320 # "/c:/foo.txt". This means that all file URLs end up with "file:///" 321 # at the beginning. 322 if sys.platform == 'win32': 323 abspath = '/' + abspath.replace('\\', '/') 324 325 return "file://" + abspath 316 return abspath_to_uri(os.path.abspath(filename), self._executive) 326 317 327 318 def tests(self, paths): … … 372 363 test = uri 373 364 if uri.startswith("file:///"): 365 # FIXME: need an inverse of uri_to_abspath() 374 366 if sys.platform == 'win32': 375 367 test = test.replace('file:///', '') 376 368 test = test.replace('/', '\\') 369 elif sys.platform == 'cygwin': 370 test = '/cygdrive/' + uri[8] + '/' + uri[11:] 377 371 else: 378 372 test = test.replace('file://', '') -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py
r69065 r69638 35 35 36 36 from webkitpy.common.system.executive import Executive, ScriptError 37 from webkitpy.common.system.path import abspath_to_uri 37 38 from webkitpy.thirdparty.mock import Mock 38 39 … … 228 229 229 230 def test_filename_to_uri(self): 230 231 231 port = base.Port() 232 232 layout_test_dir = port.layout_tests_dir() 233 233 test_file = os.path.join(layout_test_dir, "foo", "bar.html") 234 235 # On Windows, absolute paths are of the form "c:\foo.txt". However,236 # all current browsers (except for Opera) normalize file URLs by237 # prepending an additional "/" as if the absolute path was238 # "/c:/foo.txt". This means that all file URLs end up with "file:///"239 # at the beginning.240 if sys.platform == 'win32':241 prefix = "file:///"242 path = test_file.replace("\\", "/")243 else:244 prefix = "file://"245 path = test_file246 247 234 self.assertEqual(port.filename_to_uri(test_file), 248 prefix + path)235 abspath_to_uri(test_file, Executive())) 249 236 250 237 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
r69160 r69638 44 44 import webbrowser 45 45 46 from webkitpy.common.system.executive import Executive 47 from webkitpy.common.system.path import abspath_to_uri, cygpath 48 from webkitpy.layout_tests.layout_package import test_expectations 49 46 50 import base 47 51 import http_server 48 49 from webkitpy.common.system.executive import Executive50 from webkitpy.layout_tests.layout_package import test_expectations51 52 52 53 # Chromium DRT on OSX uses WebKitDriver. … … 144 145 file.write(actual_contents) 145 146 147 # We use convert_path if there's a chance that the launched 148 # executable needs filename arguments in a different format than 149 # the normal format provided by the python runtime. The main 150 # example of this is running under Cygwin on Windows but 151 # launching a Win32 binary, where we need to convert the path 152 # from /cygdrive/c/foo.txt to c:\foo.txt. 146 153 if diff_filename: 147 cmd = [executable, '--diff', expected_filename, 148 actual_filename, diff_filename] 154 cmd = [executable, '--diff', 155 self._convert_path(expected_filename), 156 self._convert_path(actual_filename), 157 self._convert_path(diff_filename)] 149 158 else: 150 cmd = [executable, expected_filename, actual_filename] 159 cmd = [executable, 160 self._convert_path(expected_filename), 161 self._convert_path(actual_filename)] 151 162 152 163 result = True … … 341 352 return self.path_from_webkit_base('LayoutTests', 'platform', platform) 342 353 354 def _convert_path(self, path): 355 """Handles filename conversion for subprocess command line args.""" 356 # See note above in diff_image() for why we need this. 357 if sys.platform == 'cygwin': 358 return cygpath(path, self._executive) 359 return path 360 343 361 def _path_to_image_diff(self): 344 362 binary_name = 'image_diff' … … 360 378 driver_args = [] 361 379 if self._image_path: 362 driver_args.append("--pixel-tests=" + self._image_path) 380 # See note above in diff_image() for why we need 381 # _convert_path(). 382 driver_args.append("--pixel-tests=" + 383 self._port._convert_path(self._image_path)) 363 384 364 385 if self._options.use_drt: -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
r69578 r69638 92 92 93 93 def __init__(self, port, filename, timeout): 94 """ Generates the URI and stores the filename and timeout for this test.94 """ 95 95 Args: 96 96 filename: Full path to the test. 97 timeout: Timeout for running the test in TestShell.97 timeout: Timeout for running the test in DRT. 98 98 """ 99 99 self.filename = filename 100 100 self._port = port 101 self.uri = port.filename_to_uri(filename)102 101 self.timeout = timeout 103 102 self._image_checksum = -1
Note: See TracChangeset
for help on using the changeset viewer.