WebKit Bugzilla
Attachment 371971 Details for
Bug 198682
: import-w3c-tests should respect WEBKIT_OUTPUTDIR
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198682-20190612103600.patch (text/plain), 6.11 KB, created by
youenn fablet
on 2019-06-12 10:36:00 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2019-06-12 10:36:00 PDT
Size:
6.11 KB
patch
obsolete
>Subversion Revision: 246347 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 07732108afeed8f55cfb6fe20a303efb4b95662d..787a3c87038361888e7be0c4d8b7d866af5eda41 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,25 @@ >+2019-06-12 Youenn Fablet <youenn@apple.com> >+ >+ import-w3c-tests should respect WEBKIT_OUTPUTDIR >+ https://bugs.webkit.org/show_bug.cgi?id=198682 >+ <rdar://problem/51536931> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Check for WEBKIT_OUTPUTDIR environment variable to compute the w3c-tests folder. >+ Made some refactoring to also teach WPTPaths users about WEBKIT_OUTPUTDIR. >+ >+ * Scripts/webkitpy/common/webkit_finder.py: >+ (WebKitFinder.path_from_webkit_outputdir): >+ * Scripts/webkitpy/w3c/common.py: >+ (WPTPaths): >+ (WPTPaths.checkout_directory): >+ (WPTPaths.wpt_checkout_path): >+ * Scripts/webkitpy/w3c/test_importer.py: >+ (TestImporter.__init__): >+ * Scripts/webkitpy/w3c/test_importer_unittest.py: >+ (test_checkout_directory): >+ > 2019-06-11 Keith Rollin <krollin@apple.com> > > Open up xcfilelist processing to more platforms >diff --git a/Tools/Scripts/webkitpy/common/webkit_finder.py b/Tools/Scripts/webkitpy/common/webkit_finder.py >index 7b9c0145e44d1bc342d26944b1aa49217172d66e..7d7f9e15b10a1c86e27882f57a4a725af03659ed 100644 >--- a/Tools/Scripts/webkitpy/common/webkit_finder.py >+++ b/Tools/Scripts/webkitpy/common/webkit_finder.py >@@ -26,6 +26,8 @@ > # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > >+import os >+ > > class WebKitFinder(object): > def __init__(self, filesystem): >@@ -52,6 +54,10 @@ class WebKitFinder(object): > def path_from_webkit_base(self, *comps): > return self._filesystem.join(self.webkit_base(), *comps) > >+ def path_from_webkit_outputdir(self, *comps): >+ base_path = os.environ['WEBKIT_OUTPUTDIR'] if 'WEBKIT_OUTPUTDIR' in os.environ else self.path_from_webkit_base('WebKitBuild') >+ return self._filesystem.join(base_path, *comps) >+ > def path_to_script(self, script_name): > """Returns the relative path to the script from the top of the WebKit tree.""" > # This is intentionally relative in order to force callers to consider what >diff --git a/Tools/Scripts/webkitpy/w3c/common.py b/Tools/Scripts/webkitpy/w3c/common.py >index f823cfae30d6ace4cdc764756823aa26ae1ab860..848b04f8ec7e7b37f124e2268341719a0364e846 100644 >--- a/Tools/Scripts/webkitpy/w3c/common.py >+++ b/Tools/Scripts/webkitpy/w3c/common.py >@@ -101,13 +101,13 @@ def is_file_exportable(path): > > > class WPTPaths: >- CHECKOUT_DIRECTORY = ["WebKitBuild", "w3c-tests"] >+ CHECKOUT_DIRECTORY = ["w3c-tests"] > WPT_CHECKOUT_PATH = CHECKOUT_DIRECTORY + ["web-platform-tests"] > > @staticmethod > def checkout_directory(finder): >- return finder.path_from_webkit_base(*WPTPaths.CHECKOUT_DIRECTORY) >+ return finder.path_from_webkit_outputdir(*WPTPaths.CHECKOUT_DIRECTORY) > > @staticmethod > def wpt_checkout_path(finder): >- return finder.path_from_webkit_base(*WPTPaths.WPT_CHECKOUT_PATH) >+ return finder.path_from_webkit_outputdir(*WPTPaths.WPT_CHECKOUT_PATH) >diff --git a/Tools/Scripts/webkitpy/w3c/test_importer.py b/Tools/Scripts/webkitpy/w3c/test_importer.py >index e874808acbd07f1b9fbd587e5570a94a5da4a8ba..8ee562853745948594c30bafeb818561c391b5ae 100644 >--- a/Tools/Scripts/webkitpy/w3c/test_importer.py >+++ b/Tools/Scripts/webkitpy/w3c/test_importer.py >@@ -79,7 +79,7 @@ import mimetypes > from webkitpy.common.host import Host > from webkitpy.common.system.filesystem import FileSystem > from webkitpy.common.webkit_finder import WebKitFinder >-from webkitpy.w3c.common import WPT_GH_URL >+from webkitpy.w3c.common import WPT_GH_URL, WPTPaths > from webkitpy.w3c.test_parser import TestParser > from webkitpy.w3c.test_converter import convert_for_webkit > from webkitpy.w3c.test_downloader import TestDownloader >@@ -169,7 +169,7 @@ class TestImporter(object): > self.tests_w3c_relative_path = self.filesystem.join('imported', 'w3c') > self.layout_tests_path = webkit_finder.path_from_webkit_base('LayoutTests') > self.layout_tests_w3c_path = self.filesystem.join(self.layout_tests_path, self.tests_w3c_relative_path) >- self.tests_download_path = webkit_finder.path_from_webkit_base('WebKitBuild', 'w3c-tests') >+ self.tests_download_path = WPTPaths.checkout_directory(webkit_finder) > > self._test_downloader = None > >diff --git a/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py b/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py >index 7b6429888e103eac6760e733bcb3802389aa3059..317789087b2fe68f7f246fdbf554bbdaad1ba10d 100644 >--- a/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py >+++ b/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py >@@ -25,6 +25,7 @@ > # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > # SUCH DAMAGE. > >+import os > import unittest > > from webkitpy.common.host_mock import MockHost >@@ -209,6 +210,22 @@ class TestImporterTest(unittest.TestCase): > self.assertFalse(fs.exists('/mock-checkout/LayoutTests/w3c/web-platform-tests/dir-to-skip/dir-to-not-import/test-to-not-import.html')) > self.assertFalse(fs.exists('/mock-checkout/LayoutTests/w3c/web-platform-tests/dir-to-skip/test-to-skip.html')) > >+ def test_checkout_directory(self): >+ FAKE_FILES = { >+ '/mock-checkout/WebKitBuild2/w3c-tests/web-platform-tests/existing-test.html': '', >+ '/mock-checkout/WebKitBuild2/w3c-tests/csswg-tests/test.html': '1', >+ } >+ >+ FAKE_FILES.update(FAKE_REPOSITORY) >+ >+ os.environ['WEBKIT_OUTPUTDIR'] = '/mock-checkout/WebKitBuild2' >+ try: >+ fs = self.import_downloaded_tests(['--no-fetch', '--import-all', '-d', 'w3c'], FAKE_FILES) >+ finally: >+ del os.environ['WEBKIT_OUTPUTDIR'] >+ >+ self.assertTrue(fs.exists('/mock-checkout/LayoutTests/w3c/web-platform-tests/existing-test.html')) >+ > def test_clean_directory_option(self): > FAKE_FILES = { > '/mock-checkout/LayoutTests/w3c/web-platform-tests/.gitattributes': '-1',
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198682
:
371859
|
371862
| 371971