Title: [230601] trunk/Tools
Revision
230601
Author
jbed...@apple.com
Date
2018-04-12 15:03:34 -0700 (Thu, 12 Apr 2018)

Log Message

Fix --build-directory flag for run-webkit-tests
https://bugs.webkit.org/show_bug.cgi?id=184545
<rdar://problem/39385080>

Rubber-stamped by Aakash Jain.

The --build-directory path does not work with iOS-Simulator.

* Scripts/webkitpy/port/base.py:
(Port._build_path): Use the port configuration to calculate the root directory.
* Scripts/webkitpy/port/base_unittest.py:
(PortTest.test_build_path): Test build directories for embedded configurations.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (230600 => 230601)


--- trunk/Tools/ChangeLog	2018-04-12 21:58:54 UTC (rev 230600)
+++ trunk/Tools/ChangeLog	2018-04-12 22:03:34 UTC (rev 230601)
@@ -1,3 +1,18 @@
+2018-04-12  Jonathan Bedard  <jbed...@apple.com>
+
+        Fix --build-directory flag for run-webkit-tests
+        https://bugs.webkit.org/show_bug.cgi?id=184545
+        <rdar://problem/39385080>
+
+        Rubber-stamped by Aakash Jain.
+
+        The --build-directory path does not work with iOS-Simulator.
+
+        * Scripts/webkitpy/port/base.py:
+        (Port._build_path): Use the port configuration to calculate the root directory.
+        * Scripts/webkitpy/port/base_unittest.py:
+        (PortTest.test_build_path): Test build directories for embedded configurations.
+
 2018-04-12  Ross Kirsling  <ross.kirsl...@sony.com>
 
         pemfile.py should not assume POSIX line endings

Modified: trunk/Tools/Scripts/webkitpy/port/base.py (230600 => 230601)


--- trunk/Tools/Scripts/webkitpy/port/base.py	2018-04-12 21:58:54 UTC (rev 230600)
+++ trunk/Tools/Scripts/webkitpy/port/base.py	2018-04-12 22:03:34 UTC (rev 230601)
@@ -1283,11 +1283,11 @@
     def _build_path(self, *comps):
         root_directory = self.get_option('_cached_root') or self.get_option('root')
         if not root_directory:
+            root_directory = self._config.build_directory(self.get_option('configuration'))
             build_directory = self.get_option('build_directory')
             if build_directory:
-                root_directory = self._filesystem.join(build_directory, self.get_option('configuration'))
-            else:
-                root_directory = self._config.build_directory(self.get_option('configuration'))
+                root_directory = self._filesystem.join(build_directory, root_directory.split('/')[-1])
+
             # We take advantage of the behavior that self._options is passed by reference to worker
             # subprocesses to use it as data store to cache the computed root directory path. This
             # avoids making each worker subprocess compute this path again which is slow because of

Modified: trunk/Tools/Scripts/webkitpy/port/base_unittest.py (230600 => 230601)


--- trunk/Tools/Scripts/webkitpy/port/base_unittest.py	2018-04-12 21:58:54 UTC (rev 230600)
+++ trunk/Tools/Scripts/webkitpy/port/base_unittest.py	2018-04-12 22:03:34 UTC (rev 230601)
@@ -365,12 +365,18 @@
         self.assertIn('passes/text.html', tests)
 
     def test_build_path(self):
-        port = self.make_port(options=optparse.Values({'build_directory': '/my-build-directory/'}))
-        if port.get_option('configuration') == 'Debug':
-            self.assertEqual(port._build_path(), '/my-build-directory/Debug')
-        else:
-            self.assertEqual(port._build_path(), '/my-build-directory/Release')
+        port = self.make_port(
+            executive=MockExecutive2(output='/default-build-path/Debug'),
+            options=optparse.Values({'build_directory': '/my-build-directory/'}),
+        )
+        self.assertEqual(port._build_path(), '/my-build-directory/Debug')
 
+        port = self.make_port(
+            executive=MockExecutive2(output='/default-build-path/Debug-embedded-port'),
+            options=optparse.Values({'build_directory': '/my-build-directory/'}),
+        )
+        self.assertEqual(port._build_path(), '/my-build-directory/Debug-embedded-port')
+
     def test_is_w3c_resource_file(self):
         port = self.make_port()
         port.host.filesystem.write_text_file(port.layout_tests_dir() + "/imported/w3c/resources/resource-files.json", """
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to