Changeset 234997 in webkit
- Timestamp:
- Aug 17, 2018 2:43:31 PM (6 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r234986 r234997 1 2018-08-17 Jonathan Bedard <jbedard@apple.com> 2 3 Add back --wtf-only to run-api-tests 4 https://bugs.webkit.org/show_bug.cgi?id=187893 5 <rdar://problem/42483983> 6 7 Reviewed by Aakash Jain. 8 9 When doing WTF development, it is not necessary to build or run all of the API 10 tests. Generally, if a user has specified a specific binary (or binaries) that 11 they are interested in testing, it is not necessary to check all API test binaries. 12 13 * Scripts/webkitpy/api_tests/manager.py: 14 (Manager._collect_tests): Only use the binaries matching the program arguments 15 when collecting tests. 16 (Manager._binaries_for_arguments): Generate a list of binaries which match the 17 program arguments. 18 (Manager.run): Pass a list binaries to check. 19 * Scripts/webkitpy/api_tests/run_api_tests.py: 20 (parse_args): 21 * Scripts/webkitpy/port/base.py: 22 (Port.check_api_test_build): If the caller specifies which API test binaries it 23 requires, only check the ones specified. 24 (Port.path_to_api_test_binaries): Allow the caller to only build the WTF API tests. 25 (Port._build_api_tests): Allow the caller to only build the WTF API tests. 26 * Scripts/webkitpy/port/win.py: 27 (WinPort.path_to_api_test_binaries): 28 1 29 2018-08-17 Jer Noble <jer.noble@apple.com> 2 30 -
trunk/Tools/Scripts/webkitpy/api_tests/manager.py
r231039 r234997 88 88 def _collect_tests(self, args): 89 89 available_tests = [] 90 for binary in self._port.path_to_api_test_binaries(): 91 stripped_name = os.path.splitext(os.path.basename(binary))[0] 90 specified_binaries = self._binaries_for_arguments(args) 91 for canonicalized_binary, path in self._port.path_to_api_test_binaries().iteritems(): 92 if canonicalized_binary not in specified_binaries: 93 continue 92 94 try: 93 95 output = self.host.executive.run_command( 94 Runner.command_for_port(self._port, [ binary, '--gtest_list_tests']),96 Runner.command_for_port(self._port, [path, '--gtest_list_tests']), 95 97 env=self._port.environment_for_api_tests()) 96 available_tests += Manager._test_list_from_output(output, '{}.'.format( stripped_name))98 available_tests += Manager._test_list_from_output(output, '{}.'.format(canonicalized_binary)) 97 99 except ScriptError: 98 _log.error('Failed to list {} tests'.format( stripped_name))100 _log.error('Failed to list {} tests'.format(canonicalized_binary)) 99 101 raise 100 102 … … 131 133 raise RuntimeError('Running api tests on {} is not supported'.format(self._port.port_name)) 132 134 135 def _binaries_for_arguments(self, args): 136 if self._port.get_option('api_binary'): 137 return self._port.get_option('api_binary') 138 139 binaries = [] 140 for arg in args: 141 candidate_binary = arg.split('.')[0] 142 if candidate_binary in binaries: 143 continue 144 if candidate_binary in self._port.path_to_api_test_binaries(): 145 binaries.append(candidate_binary) 146 else: 147 # If the user specifies a test-name without a binary, we need to search both binaries 148 return self._port.path_to_api_test_binaries().keys() 149 return binaries or self._port.path_to_api_test_binaries().keys() 150 133 151 def run(self, args): 134 152 self._stream.write_update('Checking build ...') 135 if not self._port.check_api_test_build( ):153 if not self._port.check_api_test_build(self._binaries_for_arguments(args)): 136 154 _log.error('Build check failed') 137 155 return Manager.FAILED_BUILD_CHECK -
trunk/Tools/Scripts/webkitpy/api_tests/run_api_tests.py
r234962 r234997 103 103 104 104 option_group_definitions.append(('Testing Options', [ 105 optparse.make_option('--wtf-only', action='store_const', const='TestWTF', dest='api_binary', 106 help='Only build, check and run TestWTF'), 105 107 optparse.make_option('-d', '--dump', action='store_true', default=False, 106 108 help='Dump all test names without running them'), -
trunk/Tools/Scripts/webkitpy/port/base.py
r234863 r234997 241 241 return True 242 242 243 def check_api_test_build(self): 244 if not self._root_was_set and self.get_option('build') and not self._build_api_tests(): 243 def check_api_test_build(self, canonicalized_binaries=None): 244 if not canonicalized_binaries: 245 canonicalized_binaries = self.path_to_api_test_binaries().keys() 246 if not self._root_was_set and self.get_option('build') and not self._build_api_tests(wtf_only=(canonicalized_binaries == ['TestWTF'])): 245 247 return False 246 248 if self.get_option('install') and not self._check_port_build(): 247 249 return False 248 250 249 for binary in self.path_to_api_test_binaries(): 250 if not self._filesystem.exists(binary): 251 _log.error('{} was not found at {}'.format(os.path.basename(binary), binary)) 251 for binary, path in self.path_to_api_test_binaries().iteritems(): 252 if binary not in canonicalized_binaries: 253 continue 254 if not self._filesystem.exists(path): 255 _log.error('{} was not found at {}'.format(os.path.basename(path), path)) 252 256 return False 253 257 return True … … 1371 1375 1372 1376 def path_to_api_test_binaries(self): 1373 binary_names = ['TestWTF'] 1374 if self.host.platform.is_win(): 1375 binary_names += ['TestWebCore', 'TestWebKitLegacy'] 1376 else: 1377 binary_names += ['TestWebKitAPI'] 1378 binary_paths = [self._build_path(binary_name) for binary_name in binary_names] 1379 if self.host.platform.is_win(): 1380 binary_paths = [os.path.splitext(binary_path)[0] + '.exe' for binary_path in binary_paths] 1381 return binary_paths 1377 return {binary: self._build_path(binary) for binary in ['TestWTF', 'TestWebKitAPI']} 1382 1378 1383 1379 def _path_to_lighttpd(self): … … 1506 1502 return True 1507 1503 1508 def _build_api_tests(self ):1504 def _build_api_tests(self, wtf_only=False): 1509 1505 environment = self.host.copy_current_environment().to_dictionary() 1510 1506 try: 1511 self._run_script('build-api-tests', args= self._build_driver_flags(), env=environment)1507 self._run_script('build-api-tests', args=(['--wtf-only'] if wtf_only else []) + self._build_driver_flags(), env=environment) 1512 1508 except ScriptError as e: 1513 1509 _log.error(e.message_with_output(output_limit=None)) -
trunk/Tools/Scripts/webkitpy/port/win.py
r234863 r234997 213 213 return self._build_path('ImageDiff.exe') 214 214 215 def path_to_api_test_binaries(self): 216 return {binary.split('.')[0]: self._build_path(binary) for binary in ['TestWTF.exe', 'TestWebCore.exe', 'TestWebKitLegacy.exe']} 217 215 218 def test_search_path(self): 216 219 test_fallback_names = [path for path in self.baseline_search_path() if not path.startswith(self._webkit_baseline_path('mac'))]
Note: See TracChangeset
for help on using the changeset viewer.