Title: [234863] trunk/Tools
- Revision
- 234863
- Author
- [email protected]
- Date
- 2018-08-14 15:43:39 -0700 (Tue, 14 Aug 2018)
Log Message
[webkitpy][Win] LayoutTests: test names should be Unix style, separated by slash not backslash
https://bugs.webkit.org/show_bug.cgi?id=187973
Patch by Fujii Hironori <[email protected]> on 2018-08-14
Reviewed by Alex Christensen.
In LayoutTests, test names have been canonicalized in Unix style
since Bug 63597, for example 'fast/css/001.html'. But Bug 179219,
Bug 179572, Bug 180660, and Bug 181814 have changed to use
os.path.seq instead of slash if Windows Python is used.
Revert parts of those changes. Change relative_test_filename to
return a slash-separated test name as chromium_win.py used to do.
This change fixes all 41 test-webkitpy failures in WinCairo port.
* Scripts/webkitpy/layout_tests/models/test_expectations.py:
(TestExpectationParser._parse_line): Do not convert test names with normpath.
* Scripts/webkitpy/port/base.py:
(Port.normalize_test_name): Use TEST_PATH_SEPARATOR instead of os.path.sep.
(Port.relative_test_filename): Replace self.host.filesystem.sep with self.TEST_PATH_SEPARATOR.
(Port.abspath_for_test): Replace self.TEST_PATH_SEPARATOR with self.host.filesystem.sep.
* Scripts/webkitpy/port/driver.py:
(Driver): Use '/' instead of os.sep.
* Scripts/webkitpy/port/win.py:
(WinCairoPort): Do not override TEST_PATH_SEPARATOR.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (234862 => 234863)
--- trunk/Tools/ChangeLog 2018-08-14 21:15:16 UTC (rev 234862)
+++ trunk/Tools/ChangeLog 2018-08-14 22:43:39 UTC (rev 234863)
@@ -1,3 +1,31 @@
+2018-08-14 Fujii Hironori <[email protected]>
+
+ [webkitpy][Win] LayoutTests: test names should be Unix style, separated by slash not backslash
+ https://bugs.webkit.org/show_bug.cgi?id=187973
+
+ Reviewed by Alex Christensen.
+
+ In LayoutTests, test names have been canonicalized in Unix style
+ since Bug 63597, for example 'fast/css/001.html'. But Bug 179219,
+ Bug 179572, Bug 180660, and Bug 181814 have changed to use
+ os.path.seq instead of slash if Windows Python is used.
+
+ Revert parts of those changes. Change relative_test_filename to
+ return a slash-separated test name as chromium_win.py used to do.
+
+ This change fixes all 41 test-webkitpy failures in WinCairo port.
+
+ * Scripts/webkitpy/layout_tests/models/test_expectations.py:
+ (TestExpectationParser._parse_line): Do not convert test names with normpath.
+ * Scripts/webkitpy/port/base.py:
+ (Port.normalize_test_name): Use TEST_PATH_SEPARATOR instead of os.path.sep.
+ (Port.relative_test_filename): Replace self.host.filesystem.sep with self.TEST_PATH_SEPARATOR.
+ (Port.abspath_for_test): Replace self.TEST_PATH_SEPARATOR with self.host.filesystem.sep.
+ * Scripts/webkitpy/port/driver.py:
+ (Driver): Use '/' instead of os.sep.
+ * Scripts/webkitpy/port/win.py:
+ (WinCairoPort): Do not override TEST_PATH_SEPARATOR.
+
2018-08-14 Aakash Jain <[email protected]>
[ews-build] Add build step to run WK1 layout-test
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py (234862 => 234863)
--- trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py 2018-08-14 21:15:16 UTC (rev 234862)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py 2018-08-14 22:43:39 UTC (rev 234863)
@@ -31,7 +31,6 @@
"""
import logging
-import os.path
import re
from webkitpy.layout_tests.models.test_configuration import TestConfigurationConverter
@@ -139,12 +138,11 @@
if not self._check_test_exists(expectation_line):
return
- path = os.path.normpath(expectation_line.name)
- expectation_line.is_file = self._port.test_isfile(path)
+ expectation_line.is_file = self._port.test_isfile(expectation_line.name)
if expectation_line.is_file:
- expectation_line.path = path
+ expectation_line.path = expectation_line.name
else:
- expectation_line.path = self._port.normalize_test_name(path)
+ expectation_line.path = self._port.normalize_test_name(expectation_line.name)
self._collect_matching_tests(expectation_line)
Modified: trunk/Tools/Scripts/webkitpy/port/base.py (234862 => 234863)
--- trunk/Tools/Scripts/webkitpy/port/base.py 2018-08-14 21:15:16 UTC (rev 234862)
+++ trunk/Tools/Scripts/webkitpy/port/base.py 2018-08-14 22:43:39 UTC (rev 234863)
@@ -700,10 +700,10 @@
def normalize_test_name(self, test_name):
"""Returns a normalized version of the test name or test directory."""
- if test_name.endswith(os.path.sep):
+ if test_name.endswith(self.TEST_PATH_SEPARATOR):
return test_name
if self.test_isdir(test_name):
- return test_name + os.path.sep
+ return test_name + self.TEST_PATH_SEPARATOR
return test_name
def driver_cmd_line_for_logging(self):
@@ -830,7 +830,7 @@
# Ports that run on windows need to override this method to deal with
# filenames with backslashes in them.
if filename.startswith(self.layout_tests_dir()):
- return self.host.filesystem.relpath(filename, self.layout_tests_dir())
+ return self.host.filesystem.relpath(filename, self.layout_tests_dir()).replace(self.host.filesystem.sep, self.TEST_PATH_SEPARATOR)
else:
return self.host.filesystem.abspath(filename)
@@ -839,7 +839,7 @@
"""Returns the full path to the file for a given test name. This is the
inverse of relative_test_filename() if no target_host is specified."""
host = target_host or self.host
- return host.filesystem.join(host.filesystem.map_base_host_path(self.layout_tests_dir()), test_name)
+ return host.filesystem.join(host.filesystem.map_base_host_path(self.layout_tests_dir()), test_name.replace(self.TEST_PATH_SEPARATOR, self.host.filesystem.sep))
def jsc_results_directory(self):
return self._build_path()
Modified: trunk/Tools/Scripts/webkitpy/port/driver.py (234862 => 234863)
--- trunk/Tools/Scripts/webkitpy/port/driver.py 2018-08-14 21:15:16 UTC (rev 234862)
+++ trunk/Tools/Scripts/webkitpy/port/driver.py 2018-08-14 22:43:39 UTC (rev 234863)
@@ -254,10 +254,10 @@
return shlex.split(self._port.get_option('wrapper')) + wrapper_arguments
return wrapper_arguments
- HTTP_DIR = normpath("http/tests") + os.sep
- HTTP_LOCAL_DIR = normpath("http/tests/local") + os.sep
- WEBKIT_SPECIFIC_WEB_PLATFORM_TEST_SUBDIR = normpath("http/wpt") + os.sep
- WEBKIT_WEB_PLATFORM_TEST_SERVER_ROUTE = normpath("WebKit") + os.sep
+ HTTP_DIR = "http/tests/"
+ HTTP_LOCAL_DIR = "http/tests/local/"
+ WEBKIT_SPECIFIC_WEB_PLATFORM_TEST_SUBDIR = "http/wpt/"
+ WEBKIT_WEB_PLATFORM_TEST_SERVER_ROUTE = "WebKit/"
def is_http_test(self, test_name):
return test_name.startswith(self.HTTP_DIR) and not test_name.startswith(self.HTTP_LOCAL_DIR)
Modified: trunk/Tools/Scripts/webkitpy/port/win.py (234862 => 234863)
--- trunk/Tools/Scripts/webkitpy/port/win.py 2018-08-14 21:15:16 UTC (rev 234862)
+++ trunk/Tools/Scripts/webkitpy/port/win.py 2018-08-14 22:43:39 UTC (rev 234863)
@@ -475,8 +475,6 @@
DEFAULT_ARCHITECTURE = 'x86_64'
- TEST_PATH_SEPARATOR = os.sep
-
def default_baseline_search_path(self):
version_name_map = VersionNameMap.map(self.host.platform)
if self._os_version < self.VERSION_MIN or self._os_version > self.VERSION_MAX:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes