- Revision
- 234997
- Author
- [email protected]
- Date
- 2018-08-17 14:43:31 -0700 (Fri, 17 Aug 2018)
Log Message
Add back --wtf-only to run-api-tests
https://bugs.webkit.org/show_bug.cgi?id=187893
<rdar://problem/42483983>
Reviewed by Aakash Jain.
When doing WTF development, it is not necessary to build or run all of the API
tests. Generally, if a user has specified a specific binary (or binaries) that
they are interested in testing, it is not necessary to check all API test binaries.
* Scripts/webkitpy/api_tests/manager.py:
(Manager._collect_tests): Only use the binaries matching the program arguments
when collecting tests.
(Manager._binaries_for_arguments): Generate a list of binaries which match the
program arguments.
(Manager.run): Pass a list binaries to check.
* Scripts/webkitpy/api_tests/run_api_tests.py:
(parse_args):
* Scripts/webkitpy/port/base.py:
(Port.check_api_test_build): If the caller specifies which API test binaries it
requires, only check the ones specified.
(Port.path_to_api_test_binaries): Allow the caller to only build the WTF API tests.
(Port._build_api_tests): Allow the caller to only build the WTF API tests.
* Scripts/webkitpy/port/win.py:
(WinPort.path_to_api_test_binaries):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (234996 => 234997)
--- trunk/Tools/ChangeLog 2018-08-17 21:28:31 UTC (rev 234996)
+++ trunk/Tools/ChangeLog 2018-08-17 21:43:31 UTC (rev 234997)
@@ -1,3 +1,31 @@
+2018-08-17 Jonathan Bedard <[email protected]>
+
+ Add back --wtf-only to run-api-tests
+ https://bugs.webkit.org/show_bug.cgi?id=187893
+ <rdar://problem/42483983>
+
+ Reviewed by Aakash Jain.
+
+ When doing WTF development, it is not necessary to build or run all of the API
+ tests. Generally, if a user has specified a specific binary (or binaries) that
+ they are interested in testing, it is not necessary to check all API test binaries.
+
+ * Scripts/webkitpy/api_tests/manager.py:
+ (Manager._collect_tests): Only use the binaries matching the program arguments
+ when collecting tests.
+ (Manager._binaries_for_arguments): Generate a list of binaries which match the
+ program arguments.
+ (Manager.run): Pass a list binaries to check.
+ * Scripts/webkitpy/api_tests/run_api_tests.py:
+ (parse_args):
+ * Scripts/webkitpy/port/base.py:
+ (Port.check_api_test_build): If the caller specifies which API test binaries it
+ requires, only check the ones specified.
+ (Port.path_to_api_test_binaries): Allow the caller to only build the WTF API tests.
+ (Port._build_api_tests): Allow the caller to only build the WTF API tests.
+ * Scripts/webkitpy/port/win.py:
+ (WinPort.path_to_api_test_binaries):
+
2018-08-17 Jer Noble <[email protected]>
REGRESSION (234743) Timeouts in TestWebKitAPI.PreferredAudioBufferSize.AudioWithWebAudio and TestWebKitAPI.PreferredAudioBufferSize.WebAudio
Modified: trunk/Tools/Scripts/webkitpy/api_tests/manager.py (234996 => 234997)
--- trunk/Tools/Scripts/webkitpy/api_tests/manager.py 2018-08-17 21:28:31 UTC (rev 234996)
+++ trunk/Tools/Scripts/webkitpy/api_tests/manager.py 2018-08-17 21:43:31 UTC (rev 234997)
@@ -87,15 +87,17 @@
def _collect_tests(self, args):
available_tests = []
- for binary in self._port.path_to_api_test_binaries():
- stripped_name = os.path.splitext(os.path.basename(binary))[0]
+ specified_binaries = self._binaries_for_arguments(args)
+ for canonicalized_binary, path in self._port.path_to_api_test_binaries().iteritems():
+ if canonicalized_binary not in specified_binaries:
+ continue
try:
output = self.host.executive.run_command(
- Runner.command_for_port(self._port, [binary, '--gtest_list_tests']),
+ Runner.command_for_port(self._port, [path, '--gtest_list_tests']),
env=self._port.environment_for_api_tests())
- available_tests += Manager._test_list_from_output(output, '{}.'.format(stripped_name))
+ available_tests += Manager._test_list_from_output(output, '{}.'.format(canonicalized_binary))
except ScriptError:
- _log.error('Failed to list {} tests'.format(stripped_name))
+ _log.error('Failed to list {} tests'.format(canonicalized_binary))
raise
if len(args) == 0:
@@ -130,9 +132,25 @@
elif 'device' in self._port.port_name:
raise RuntimeError('Running api tests on {} is not supported'.format(self._port.port_name))
+ def _binaries_for_arguments(self, args):
+ if self._port.get_option('api_binary'):
+ return self._port.get_option('api_binary')
+
+ binaries = []
+ for arg in args:
+ candidate_binary = arg.split('.')[0]
+ if candidate_binary in binaries:
+ continue
+ if candidate_binary in self._port.path_to_api_test_binaries():
+ binaries.append(candidate_binary)
+ else:
+ # If the user specifies a test-name without a binary, we need to search both binaries
+ return self._port.path_to_api_test_binaries().keys()
+ return binaries or self._port.path_to_api_test_binaries().keys()
+
def run(self, args):
self._stream.write_update('Checking build ...')
- if not self._port.check_api_test_build():
+ if not self._port.check_api_test_build(self._binaries_for_arguments(args)):
_log.error('Build check failed')
return Manager.FAILED_BUILD_CHECK
Modified: trunk/Tools/Scripts/webkitpy/api_tests/run_api_tests.py (234996 => 234997)
--- trunk/Tools/Scripts/webkitpy/api_tests/run_api_tests.py 2018-08-17 21:28:31 UTC (rev 234996)
+++ trunk/Tools/Scripts/webkitpy/api_tests/run_api_tests.py 2018-08-17 21:43:31 UTC (rev 234997)
@@ -102,6 +102,8 @@
]))
option_group_definitions.append(('Testing Options', [
+ optparse.make_option('--wtf-only', action='', const='TestWTF', dest='api_binary',
+ help='Only build, check and run TestWTF'),
optparse.make_option('-d', '--dump', action='', default=False,
help='Dump all test names without running them'),
optparse.make_option('--build', dest='build', action='', default=True,
Modified: trunk/Tools/Scripts/webkitpy/port/base.py (234996 => 234997)
--- trunk/Tools/Scripts/webkitpy/port/base.py 2018-08-17 21:28:31 UTC (rev 234996)
+++ trunk/Tools/Scripts/webkitpy/port/base.py 2018-08-17 21:43:31 UTC (rev 234997)
@@ -240,15 +240,19 @@
return False
return True
- def check_api_test_build(self):
- if not self._root_was_set and self.get_option('build') and not self._build_api_tests():
+ def check_api_test_build(self, canonicalized_binaries=None):
+ if not canonicalized_binaries:
+ canonicalized_binaries = self.path_to_api_test_binaries().keys()
+ if not self._root_was_set and self.get_option('build') and not self._build_api_tests(wtf_only=(canonicalized_binaries == ['TestWTF'])):
return False
if self.get_option('install') and not self._check_port_build():
return False
- for binary in self.path_to_api_test_binaries():
- if not self._filesystem.exists(binary):
- _log.error('{} was not found at {}'.format(os.path.basename(binary), binary))
+ for binary, path in self.path_to_api_test_binaries().iteritems():
+ if binary not in canonicalized_binaries:
+ continue
+ if not self._filesystem.exists(path):
+ _log.error('{} was not found at {}'.format(os.path.basename(path), path))
return False
return True
@@ -1370,15 +1374,7 @@
return self._build_path('ImageDiff')
def path_to_api_test_binaries(self):
- binary_names = ['TestWTF']
- if self.host.platform.is_win():
- binary_names += ['TestWebCore', 'TestWebKitLegacy']
- else:
- binary_names += ['TestWebKitAPI']
- binary_paths = [self._build_path(binary_name) for binary_name in binary_names]
- if self.host.platform.is_win():
- binary_paths = [os.path.splitext(binary_path)[0] + '.exe' for binary_path in binary_paths]
- return binary_paths
+ return {binary: self._build_path(binary) for binary in ['TestWTF', 'TestWebKitAPI']}
def _path_to_lighttpd(self):
"""Returns the path to the LigHTTPd binary.
@@ -1505,10 +1501,10 @@
return False
return True
- def _build_api_tests(self):
+ def _build_api_tests(self, wtf_only=False):
environment = self.host.copy_current_environment().to_dictionary()
try:
- self._run_script('build-api-tests', args=self._build_driver_flags(), env=environment)
+ self._run_script('build-api-tests', args=(['--wtf-only'] if wtf_only else []) + self._build_driver_flags(), env=environment)
except ScriptError as e:
_log.error(e.message_with_output(output_limit=None))
return False
Modified: trunk/Tools/Scripts/webkitpy/port/win.py (234996 => 234997)
--- trunk/Tools/Scripts/webkitpy/port/win.py 2018-08-17 21:28:31 UTC (rev 234996)
+++ trunk/Tools/Scripts/webkitpy/port/win.py 2018-08-17 21:43:31 UTC (rev 234997)
@@ -212,6 +212,9 @@
return self._build_path('ImageDiff.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']}
+
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'))]
return map(self._webkit_baseline_path, test_fallback_names)