WebKit Bugzilla
Attachment 346288 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-20180801122051.patch (text/plain), 6.52 KB, created by
Jonathan Bedard
on 2018-08-01 12:20:52 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jonathan Bedard
Created:
2018-08-01 12:20:52 PDT
Size:
6.52 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 234465) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,28 @@ >+2018-08-01 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, return an empty list to match all binaries. >+ (Manager.run): Pass a list binaries to check. >+ * Scripts/webkitpy/api_tests/run_api_tests.py: >+ (parse_args): Add --wtf-only flag. >+ * 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._build_api_tests): Allow the caller to only build the WTF API tests. >+ > 2018-08-01 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r234443 and r234445. >Index: Tools/Scripts/webkitpy/api_tests/manager.py >=================================================================== >--- Tools/Scripts/webkitpy/api_tests/manager.py (revision 234460) >+++ Tools/Scripts/webkitpy/api_tests/manager.py (working copy) >@@ -87,11 +87,14 @@ 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 path in self._port.path_to_api_test_binaries(): >+ if specified_binaries and not any(path.split('.')[0].endswith(binary) for binary in specified_binaries): >+ continue >+ stripped_name = os.path.splitext(os.path.basename(path))[0] > 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)) > except ScriptError: >@@ -130,9 +133,23 @@ 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('wtf_only'): >+ return ['TestWTF'] >+ >+ binaries = [] >+ for arg in args: >+ candidate_binary = arg.split('.')[0] >+ if any(path.split('.')[0].endswith(candidate_binary) for path 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 [] >+ return binaries >+ > 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 234460) >+++ 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_true', default=False, >+ 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 234460) >+++ Tools/Scripts/webkitpy/port/base.py (working copy) >@@ -240,15 +240,17 @@ 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, binaries=[]): >+ if not self._root_was_set and self.get_option('build') and not self._build_api_tests(wtf_only=(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 path in self.path_to_api_test_binaries(): >+ if binaries and not any(path.split('.')[0].endswith(binary) for binary in binaries): >+ continue >+ if not self._filesystem.exists(path): >+ _log.error('{} was not found at {}'.format(os.path.basename(path), path)) > return False > return True > >@@ -1505,10 +1507,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
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