WebKit Bugzilla
Attachment 346423 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-20180802152258.patch (text/plain), 9.17 KB, created by
Jonathan Bedard
on 2018-08-02 15:22:58 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jonathan Bedard
Created:
2018-08-02 15:22:58 PDT
Size:
9.17 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 234516) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,34 @@ >+2018-08-02 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): Add --wtf-only flag. >+ * Scripts/webkitpy/port/base.py: >+ (Port): Add API_TEST_BINARIES to the Port object. >+ (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): Return a map of binary names to the path of >+ those binaries for the specified port. >+ (Port._build_api_tests): Allow the caller to only build the WTF API tests. >+ * Scripts/webkitpy/port/win.py: >+ (WinPort): >+ (WinPort.path_to_api_test_binaries): >+ > 2018-08-02 Dan Bernstein <mitz@apple.com> > > Fixed WebKit.AttrStyle timing out on build.webkit.org. >Index: Tools/Scripts/webkitpy/api_tests/manager.py >=================================================================== >--- Tools/Scripts/webkitpy/api_tests/manager.py (revision 234514) >+++ 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 binary, path in self._port.path_to_api_test_binaries().iteritems(): >+ if 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(binary)) > except ScriptError: >- _log.error('Failed to list {} tests'.format(stripped_name)) >+ _log.error('Failed to list {} tests'.format(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.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.API_TEST_BINARIES >+ return binaries or self._port.API_TEST_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 234514) >+++ 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 234514) >+++ Tools/Scripts/webkitpy/port/base.py (working copy) >@@ -83,6 +83,8 @@ class Port(object): > > CUSTOM_DEVICE_CLASSES = [] > >+ API_TEST_BINARIES = ['TestWTF', 'TestWebKitAPI'] >+ > @classmethod > def determine_full_port_name(cls, host, options, port_name): > """Return a fully-specified port name that can be used to construct objects.""" >@@ -240,15 +242,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, binaries=None): >+ if not binaries: >+ binaries = self.API_TEST_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 binary, path in self.path_to_api_test_binaries().iteritems(): >+ if binary not 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 > >@@ -1370,15 +1376,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 self.API_TEST_BINARIES} > > def _path_to_lighttpd(self): > """Returns the path to the LigHTTPd binary. >@@ -1505,10 +1503,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 234514) >+++ Tools/Scripts/webkitpy/port/win.py (working copy) >@@ -62,6 +62,8 @@ class WinPort(ApplePort): > > ARCHITECTURES = ['x86', 'x86_64'] > >+ API_TEST_BINARIES = ['TestWTF', 'TestWebCore', 'TestWebKitLegacy'] >+ > CRASH_LOG_PREFIX = "CrashLog" > > if sys.platform.startswith('win'): >@@ -212,6 +214,11 @@ class WinPort(ApplePort): > > return self._build_path('ImageDiff.exe') > >+ def path_to_api_test_binaries(self): >+ if self.is_cygwin(): >+ return super(WinPort, self).path_to_api_test_binaries() >+ return {binary: self._build_path(binary + '.exe') for binary in self.API_TEST_BINARIES} >+ > 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