Title: [235227] trunk/Tools
Revision
235227
Author
[email protected]
Date
2018-08-23 09:39:53 -0700 (Thu, 23 Aug 2018)

Log Message

Explain test name matching in run-api-tests help
https://bugs.webkit.org/show_bug.cgi?id=188280

Reviewed by Ryosuke Niwa.

Improve the run-api-tests help message to explain how test
name matching works.

* Scripts/webkitpy/api_tests/run_api_tests.py:
(parse_args):
* Scripts/webkitpy/port/base.py:
(Port):
(Port.path_to_api_test_binaries): Make binary names a globally accessible array.
* Scripts/webkitpy/port/win.py:
(WinPort):
(WinPort.path_to_api_test_binaries): Ditto.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (235226 => 235227)


--- trunk/Tools/ChangeLog	2018-08-23 16:37:02 UTC (rev 235226)
+++ trunk/Tools/ChangeLog	2018-08-23 16:39:53 UTC (rev 235227)
@@ -1,3 +1,22 @@
+2018-08-23  Jonathan Bedard  <[email protected]>
+
+        Explain test name matching in run-api-tests help
+        https://bugs.webkit.org/show_bug.cgi?id=188280
+
+        Reviewed by Ryosuke Niwa.
+
+        Improve the run-api-tests help message to explain how test
+        name matching works.
+
+        * Scripts/webkitpy/api_tests/run_api_tests.py:
+        (parse_args):
+        * Scripts/webkitpy/port/base.py:
+        (Port):
+        (Port.path_to_api_test_binaries): Make binary names a globally accessible array.
+        * Scripts/webkitpy/port/win.py:
+        (WinPort):
+        (WinPort.path_to_api_test_binaries): Ditto.
+
 2018-08-23  Youenn Fablet  <[email protected]>
 
         Use "wpt serve" to launch WPT server

Modified: trunk/Tools/Scripts/webkitpy/api_tests/run_api_tests.py (235226 => 235227)


--- trunk/Tools/Scripts/webkitpy/api_tests/run_api_tests.py	2018-08-23 16:37:02 UTC (rev 235226)
+++ trunk/Tools/Scripts/webkitpy/api_tests/run_api_tests.py	2018-08-23 16:39:53 UTC (rev 235227)
@@ -29,7 +29,7 @@
 from webkitpy.api_tests.manager import Manager
 from webkitpy.common.host import Host
 from webkitpy.layout_tests.views.metered_stream import MeteredStream
-from webkitpy.port import configuration_options, platform_options
+from webkitpy.port import configuration_options, platform_options, base, win
 
 EXCEPTIONAL_EXIT_STATUS = -1
 INTERRUPT_EXIT_STATUS = -2
@@ -133,7 +133,16 @@
                              help='Run all tests, even DISABLED tests'),
     ]))
 
-    option_parser = optparse.OptionParser(usage='%prog [options] [<path>...]')
+    option_parser = optparse.OptionParser(
+        usage='run-api-tests [options] [<test names>...]',
+        description="""By default, run-api-tests will run all API tests. It also allows the user to specify tests of the \
+format <suite>.<test> or <canonicalized binary name>.<suite>.<test>. Note that in the case where a binary is not \
+specified, one will be inferred by listing all available tests. Specifying just a binary or just a suite will cause every \
+test contained within to be run. The canonicalized binary name is the binary name with any filename extension \
+stripped. For Unix ports, these binaries are {} and {}. For Windows ports, they are {} and {}.""".format(
+            ', '.join(base.Port.API_TEST_BINARY_NAMES[:-1]), base.Port.API_TEST_BINARY_NAMES[-1],
+            ', '.join(win.WinPort.API_TEST_BINARY_NAMES[:-1]), win.WinPort.API_TEST_BINARY_NAMES[-1],
+    ))
 
     for group_name, group_options in option_group_definitions:
         option_group = optparse.OptionGroup(option_parser, group_name)

Modified: trunk/Tools/Scripts/webkitpy/port/base.py (235226 => 235227)


--- trunk/Tools/Scripts/webkitpy/port/base.py	2018-08-23 16:37:02 UTC (rev 235226)
+++ trunk/Tools/Scripts/webkitpy/port/base.py	2018-08-23 16:39:53 UTC (rev 235227)
@@ -1373,8 +1373,10 @@
         This is likely used only by diff_image()"""
         return self._build_path('ImageDiff')
 
+    API_TEST_BINARY_NAMES = ['TestWTF', 'TestWebKitAPI']
+
     def path_to_api_test_binaries(self):
-        return {binary: self._build_path(binary) for binary in ['TestWTF', 'TestWebKitAPI']}
+        return {binary: self._build_path(binary) for binary in self.API_TEST_BINARY_NAMES}
 
     def _path_to_lighttpd(self):
         """Returns the path to the LigHTTPd binary.

Modified: trunk/Tools/Scripts/webkitpy/port/win.py (235226 => 235227)


--- trunk/Tools/Scripts/webkitpy/port/win.py	2018-08-23 16:37:02 UTC (rev 235226)
+++ trunk/Tools/Scripts/webkitpy/port/win.py	2018-08-23 16:39:53 UTC (rev 235227)
@@ -212,8 +212,10 @@
 
         return self._build_path('ImageDiff.exe')
 
+    API_TEST_BINARY_NAMES = ['TestWTF.exe', 'TestWebCore.exe', 'TestWebKitLegacy.exe']
+
     def path_to_api_test_binaries(self):
-        return {binary.split('.')[0]: self._build_path(binary) for binary in ['TestWTF.exe', 'TestWebCore.exe', 'TestWebKitLegacy.exe']}
+        return {binary.split('.')[0]: self._build_path(binary) for binary in self.API_TEST_BINARY_NAMES}
 
     def test_search_path(self):
         test_fallback_names = [path for path in self.baseline_search_path() if not path.startswith(self._webkit_baseline_path('mac'))]
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to