Changeset 253371 in webkit
- Timestamp:
- Dec 11, 2019 7:13:16 AM (4 years ago)
- Location:
- trunk/Tools
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r253355 r253371 1 2019-12-11 Jonathan Bedard <jbedard@apple.com> 2 3 Add test-lldb-webkit 4 https://bugs.webkit.org/show_bug.cgi?id=187916 5 6 Reviewed by Stephanie Lewis. 7 8 * Scripts/test-lldb-webkit: Added. 9 (NoAction): Argparse action which support --<variable> and --no-<variable>. 10 (LldbTester): Wrapper around webkitpy's Tester class. 11 (LldbTester.parse_args): Specialized argparse for lldb tests. 12 (LldbTester.run): Setup environment and build lldb test runner. 13 (main): 14 * Scripts/webkitpy/test/main.py: 15 (main): Remove lldb testing code. 16 (Tester._parse_args): Ditto. 17 (Tester.run): Ditto. 18 (Tester._run_tests): Ditto. 19 (Tester._test_names): Ditto. 20 (_supports_building_and_running_lldb_tests): Deleted. 21 1 22 2019-12-10 Per Arne Vollan <pvollan@apple.com> 2 23 -
trunk/Tools/Scripts/webkitpy/test/main.py
r253219 r253371 42 42 from webkitpy.common.host import Host 43 43 from webkitpy.common.unicode_compatibility import StringIO 44 from webkitpy.port.config import Config45 44 from webkitpy.test.finder import Finder 46 45 from webkitpy.test.printer import Printer … … 68 67 if not (sys.platform.startswith('win') or sys.platform == 'cygwin'): 69 68 tester.add_tree(os.path.join(_webkit_root, 'Source', 'WebKit', 'Scripts'), 'webkit') 70 71 lldb_python_directory = _host.path_to_lldb_python_directory()72 if not _supports_building_and_running_lldb_tests():73 _log.info("Skipping lldb_webkit tests; not yet supported on macOS Catalina.")74 will_run_lldb_webkit_tests = False75 elif not os.path.isdir(lldb_python_directory):76 _log.info("Skipping lldb_webkit tests; could not find path to lldb.py '{}'.".format(lldb_python_directory))77 will_run_lldb_webkit_tests = False78 else:79 if lldb_python_directory not in sys.path:80 sys.path.append(lldb_python_directory)81 tester.add_tree(os.path.join(_webkit_root, 'Tools', 'lldb'))82 will_run_lldb_webkit_tests = True83 69 84 70 tester.skip(('webkitpy.common.checkout.scm.scm_unittest',), 'are really, really, slow', 31818) … … 99 85 _log.info('Skipping QueueStatusServer tests; the Google AppEngine Python SDK is not installed.') 100 86 101 return not tester.run(will_run_lldb_webkit_tests=will_run_lldb_webkit_tests) 102 103 104 def _supports_building_and_running_lldb_tests(): 105 # FIXME: Remove when test-lldb is in its own script 106 # https://bugs.webkit.org/show_bug.cgi?id=187916 107 build_version = _host.platform.build_version() 108 if build_version is None: 109 return False 110 return True 87 return not tester.run() 111 88 112 89 … … 128 105 self.printer = Printer(sys.stderr) 129 106 self._options = None 107 self.upload_style = 'release' 130 108 131 109 def add_tree(self, top_directory, starting_subdirectory=None): … … 137 115 def _parse_args(self, argv=None): 138 116 parser = optparse.OptionParser(usage='usage: %prog [options] [args...]') 139 140 # Configuration options only effect the building of lldbWebKitTester.141 configuration_group = optparse.OptionGroup(parser, 'Configuration options')142 configuration_group.add_option('--debug', action='store_const', const='Debug', dest="configuration",143 help='Set the configuration to Debug')144 configuration_group.add_option('--release', action='store_const', const='Release', dest="configuration",145 help='Set the configuration to Release')146 parser.add_option_group(configuration_group)147 117 148 118 upload_group = optparse.OptionGroup(parser, 'Upload Options') … … 177 147 return parser.parse_args(argv) 178 148 179 def run(self , will_run_lldb_webkit_tests=False):149 def run(self): 180 150 self._options, args = self._parse_args() 181 151 self.printer.configure(self._options) … … 188 158 return False 189 159 190 return self._run_tests(names , will_run_lldb_webkit_tests)191 192 def _run_tests(self, names , will_run_lldb_webkit_tests):160 return self._run_tests(names) 161 162 def _run_tests(self, names): 193 163 # Make sure PYTHONPATH is set up properly. 194 164 sys.path = self.finder.additional_paths(sys.path) + sys.path … … 201 171 202 172 start_time = time.time() 203 config = Config(_host.executive, self.finder.filesystem) 204 configuration_to_use = self._options.configuration or config.default_configuration() 205 206 if will_run_lldb_webkit_tests: 207 self.printer.write_update('Building lldbWebKitTester ...') 208 build_lldbwebkittester = self.finder.filesystem.join(_webkit_root, 'Tools', 'Scripts', 'build-lldbwebkittester') 209 try: 210 _host.executive.run_and_throw_if_fail([build_lldbwebkittester, config.flag_for_configuration(configuration_to_use)], quiet=(not bool(self._options.verbose))) 211 except ScriptError as e: 212 _log.error(e.message_with_output(output_limit=None)) 213 return False 214 os.environ['LLDB_WEBKIT_TESTER_EXECUTABLE'] = str(self.finder.filesystem.join(config.build_directory(configuration_to_use), 'lldbWebKitTester')) 215 if not self.finder.filesystem.exists(os.environ['LLDB_WEBKIT_TESTER_EXECUTABLE']): 216 _log.error('Failed to find lldbWebKitTester.') 217 return False 218 219 if self._options.coverage: 173 174 if getattr(self._options, 'coverage', False): 220 175 _log.warning("Checking code coverage, so running things serially") 221 176 self._options.child_processes = 1 … … 242 197 start = time.time() 243 198 test_runner = Runner(self.printer, loader) 244 test_runner.run(parallel_tests, self._options.child_processes)199 test_runner.run(parallel_tests, getattr(self._options, 'child_processes', 1)) 245 200 test_runner.run(serial_tests, 1) 246 201 end_time = time.time() … … 248 203 self.printer.print_result(time.time() - start) 249 204 250 if self._options.json:205 if getattr(self._options, 'json', False): 251 206 _print_results_as_json(sys.stdout, itertools.chain(parallel_tests, serial_tests), test_runner.failures, test_runner.errors) 252 207 253 if self._options.json_file_name:208 if getattr(self._options, 'json_file_name', None): 254 209 self._options.json_file_name = os.path.abspath(self._options.json_file_name) 255 210 with open(self._options.json_file_name, 'w') as json_file: 256 211 _print_results_as_json(json_file, itertools.chain(parallel_tests, serial_tests), test_runner.failures, test_runner.errors) 257 212 258 if self._options.coverage:213 if getattr(self._options, 'coverage', False): 259 214 cov.stop() 260 215 cov.save() 261 216 262 217 failed_uploads = 0 263 if self._options.report_urls:218 if getattr(self._options, 'report_urls', None): 264 219 self.printer.meter.writeln('\n') 265 220 self.printer.write_update('Preparing upload data ...') … … 279 234 version=str(_host.platform.os_version), 280 235 version_name=_host.platform.os_version_name(), 281 style= 'asan' if config.asan else configuration_to_use.lower(),236 style=self.upload_style, 282 237 sdk=_host.platform.build_version(), 283 238 flavor=self._options.result_report_flavor, … … 301 256 self.printer.meter.writeln('Uploads completed!') 302 257 303 if self._options.coverage:258 if getattr(self._options, 'coverage', False): 304 259 cov.report(show_missing=False) 305 260 … … 323 278 parallel_test_method_prefixes = ['test_'] 324 279 serial_test_method_prefixes = ['serial_test_'] 325 if self._options.integration_tests:280 if getattr(self._options, 'integration_tests', None): 326 281 parallel_test_method_prefixes.append('integration_test_') 327 282 serial_test_method_prefixes.append('serial_integration_test_')
Note: See TracChangeset
for help on using the changeset viewer.