[webkitpy][Win] LayoutTests: test names should be Unix style, separated by slash...
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Aug 2018 02:13:32 +0000 (02:13 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Aug 2018 02:13:32 +0000 (02:13 +0000)
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 sperated test name as well 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 a test name by using 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): Split test_name with TEST_PATH_SEPARATOR.
* Scripts/webkitpy/port/driver.py:
(Driver): Use '/' instead of os.sep.
* Scripts/webkitpy/port/win.py:
(WinCairoPort): Do not override TEST_PATH_SEPARATOR.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234749 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
Tools/Scripts/webkitpy/port/base.py
Tools/Scripts/webkitpy/port/driver.py
Tools/Scripts/webkitpy/port/win.py

index d880a00..9d53678 100644 (file)
@@ -1,3 +1,32 @@
+2018-08-09  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [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 sperated test name as well 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 a test name by using 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): Split test_name with TEST_PATH_SEPARATOR.
+        * 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-09  Thomas Denney  <tdenney@apple.com>
 
         [WHLSL] Add individual test durations to output
index aa5b511..cdcda1a 100644 (file)
@@ -31,7 +31,6 @@ for layout tests.
 """
 
 import logging
-import os.path
 import re
 
 from webkitpy.layout_tests.models.test_configuration import TestConfigurationConverter
@@ -139,12 +138,11 @@ class TestExpectationParser(object):
         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)
 
index d607cbe..8c86b6b 100644 (file)
@@ -700,10 +700,10 @@ class Port(object):
 
     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,9 @@ class Port(object):
         # 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())
+            path = self.host.filesystem.relpath(filename, self.layout_tests_dir())
+            path = path.replace(self.host.filesystem.sep, self.TEST_PATH_SEPARATOR)
+            return path
         else:
             return self.host.filesystem.abspath(filename)
 
@@ -839,7 +841,7 @@ class Port(object):
         """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.split(self.TEST_PATH_SEPARATOR))
 
     def jsc_results_directory(self):
         return self._build_path()
index 29982ad..ea287fe 100644 (file)
@@ -254,10 +254,10 @@ class Driver(object):
             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)
index 510b6e7..c86ff42 100644 (file)
@@ -475,8 +475,6 @@ class WinCairoPort(WinPort):
 
     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: