WebKit Bugzilla
Attachment 346668 Details for
Bug 187893
: Add back --wtf-only to run-api-tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-187893-20180806172646.patch (text/plain), 8.65 KB, created by
Jonathan Bedard
on 2018-08-06 17:26:46 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jonathan Bedard
Created:
2018-08-06 17:26:46 PDT
Size:
8.65 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 234636) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,31 @@ >+2018-08-06 Jonathan Bedard <jbedard@apple.com> >+ >+ Add back --wtf-only to run-api-tests >+ https://bugs.webkit.org/show_bug.cgi?id=187893 >+ <rdar://problem/42483983> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-06 David Quesada <david_quesada@apple.com> > > webkitdirs.pm should default to iPhone SE for 64-bit testing >Index: Tools/Scripts/webkitpy/api_tests/manager.py >=================================================================== >--- Tools/Scripts/webkitpy/api_tests/manager.py (revision 234633) >+++ Tools/Scripts/webkitpy/api_tests/manager.py (working copy) >@@ -87,15 +87,17 @@ class Manager(object): > > 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 @@ class Manager(object): > 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 > >Index: Tools/Scripts/webkitpy/api_tests/run_api_tests.py >=================================================================== >--- Tools/Scripts/webkitpy/api_tests/run_api_tests.py (revision 234633) >+++ Tools/Scripts/webkitpy/api_tests/run_api_tests.py (working copy) >@@ -102,6 +102,8 @@ def parse_args(args): > ])) > > option_group_definitions.append(('Testing Options', [ >+ optparse.make_option('--wtf-only', action='store_const', const='TestWTF', dest='api_binary', >+ help='Only build, check and run TestWTF'), > optparse.make_option('-d', '--dump', action='store_true', default=False, > help='Dump all test names without running them'), > optparse.make_option('--build', dest='build', action='store_true', default=True, >Index: Tools/Scripts/webkitpy/port/base.py >=================================================================== >--- Tools/Scripts/webkitpy/port/base.py (revision 234633) >+++ Tools/Scripts/webkitpy/port/base.py (working copy) >@@ -240,15 +240,19 @@ class Port(object): > 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 @@ class Port(object): > 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 @@ class Port(object): > 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 >Index: Tools/Scripts/webkitpy/port/win.py >=================================================================== >--- Tools/Scripts/webkitpy/port/win.py (revision 234633) >+++ Tools/Scripts/webkitpy/port/win.py (working copy) >@@ -212,6 +212,9 @@ class WinPort(ApplePort): > > 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)
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 187893
:
346287
|
346288
|
346351
|
346423
|
346668
|
347381