Changeset 253371 in webkit


Ignore:
Timestamp:
Dec 11, 2019 7:13:16 AM (4 years ago)
Author:
Jonathan Bedard
Message:

Add test-lldb-webkit
https://bugs.webkit.org/show_bug.cgi?id=187916

Reviewed by Stephanie Lewis.

  • Scripts/test-lldb-webkit: Added.

(NoAction): Argparse action which support --<variable> and --no-<variable>.
(LldbTester): Wrapper around webkitpy's Tester class.
(LldbTester.parse_args): Specialized argparse for lldb tests.
(LldbTester.run): Setup environment and build lldb test runner.
(main):

  • Scripts/webkitpy/test/main.py:

(main): Remove lldb testing code.
(Tester._parse_args): Ditto.
(Tester.run): Ditto.
(Tester._run_tests): Ditto.
(Tester._test_names): Ditto.
(_supports_building_and_running_lldb_tests): Deleted.

Location:
trunk/Tools
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r253355 r253371  
     12019-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
    1222019-12-10  Per Arne Vollan  <pvollan@apple.com>
    223
  • trunk/Tools/Scripts/webkitpy/test/main.py

    r253219 r253371  
    4242from webkitpy.common.host import Host
    4343from webkitpy.common.unicode_compatibility import StringIO
    44 from webkitpy.port.config import Config
    4544from webkitpy.test.finder import Finder
    4645from webkitpy.test.printer import Printer
     
    6867    if not (sys.platform.startswith('win') or sys.platform == 'cygwin'):
    6968        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 = False
    75     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 = False
    78     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 = True
    8369
    8470    tester.skip(('webkitpy.common.checkout.scm.scm_unittest',), 'are really, really, slow', 31818)
     
    9985        _log.info('Skipping QueueStatusServer tests; the Google AppEngine Python SDK is not installed.')
    10086
    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()
    11188
    11289
     
    128105        self.printer = Printer(sys.stderr)
    129106        self._options = None
     107        self.upload_style = 'release'
    130108
    131109    def add_tree(self, top_directory, starting_subdirectory=None):
     
    137115    def _parse_args(self, argv=None):
    138116        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)
    147117
    148118        upload_group = optparse.OptionGroup(parser, 'Upload Options')
     
    177147        return parser.parse_args(argv)
    178148
    179     def run(self, will_run_lldb_webkit_tests=False):
     149    def run(self):
    180150        self._options, args = self._parse_args()
    181151        self.printer.configure(self._options)
     
    188158            return False
    189159
    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):
    193163        # Make sure PYTHONPATH is set up properly.
    194164        sys.path = self.finder.additional_paths(sys.path) + sys.path
     
    201171
    202172        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):
    220175            _log.warning("Checking code coverage, so running things serially")
    221176            self._options.child_processes = 1
     
    242197        start = time.time()
    243198        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))
    245200        test_runner.run(serial_tests, 1)
    246201        end_time = time.time()
     
    248203        self.printer.print_result(time.time() - start)
    249204
    250         if self._options.json:
     205        if getattr(self._options, 'json', False):
    251206            _print_results_as_json(sys.stdout, itertools.chain(parallel_tests, serial_tests), test_runner.failures, test_runner.errors)
    252207
    253         if self._options.json_file_name:
     208        if getattr(self._options, 'json_file_name', None):
    254209            self._options.json_file_name = os.path.abspath(self._options.json_file_name)
    255210            with open(self._options.json_file_name, 'w') as json_file:
    256211                _print_results_as_json(json_file, itertools.chain(parallel_tests, serial_tests), test_runner.failures, test_runner.errors)
    257212
    258         if self._options.coverage:
     213        if getattr(self._options, 'coverage', False):
    259214            cov.stop()
    260215            cov.save()
    261216
    262217        failed_uploads = 0
    263         if self._options.report_urls:
     218        if getattr(self._options, 'report_urls', None):
    264219            self.printer.meter.writeln('\n')
    265220            self.printer.write_update('Preparing upload data ...')
     
    279234                    version=str(_host.platform.os_version),
    280235                    version_name=_host.platform.os_version_name(),
    281                     style='asan' if config.asan else configuration_to_use.lower(),
     236                    style=self.upload_style,
    282237                    sdk=_host.platform.build_version(),
    283238                    flavor=self._options.result_report_flavor,
     
    301256            self.printer.meter.writeln('Uploads completed!')
    302257
    303         if self._options.coverage:
     258        if getattr(self._options, 'coverage', False):
    304259            cov.report(show_missing=False)
    305260
     
    323278        parallel_test_method_prefixes = ['test_']
    324279        serial_test_method_prefixes = ['serial_test_']
    325         if self._options.integration_tests:
     280        if getattr(self._options, 'integration_tests', None):
    326281            parallel_test_method_prefixes.append('integration_test_')
    327282            serial_test_method_prefixes.append('serial_integration_test_')
Note: See TracChangeset for help on using the changeset viewer.