Changeset 57256 in webkit


Ignore:
Timestamp:
Apr 8, 2010 12:27:59 AM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-04-08 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Rename target to configuration in new-run-webkit-tests to match the rest of WebKit
https://bugs.webkit.org/show_bug.cgi?id=37251

The rest of our tools call --debug or --release the configuration.
It's confusing to call it target in this script.

  • Scripts/webkitpy/layout_tests/driver_test.py:
  • Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
  • Scripts/webkitpy/layout_tests/port/base.py:
  • Scripts/webkitpy/layout_tests/port/chromium.py:
  • Scripts/webkitpy/layout_tests/port/chromium_linux.py:
  • Scripts/webkitpy/layout_tests/port/chromium_mac.py:
  • Scripts/webkitpy/layout_tests/port/chromium_win.py:
  • Scripts/webkitpy/layout_tests/port/mac.py:
  • Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
  • Scripts/webkitpy/layout_tests/run_webkit_tests.py:
  • Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
  • Scripts/webkitpy/layout_tests/test_types/image_diff.py:
  • Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
  • Scripts/webkitpy/layout_tests/test_types/text_diff.py:
Location:
trunk/WebKitTools
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r57254 r57256  
     12010-04-08  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Rename target to configuration in new-run-webkit-tests to match the rest of WebKit
     6        https://bugs.webkit.org/show_bug.cgi?id=37251
     7
     8        The rest of our tools call --debug or --release the configuration.
     9        It's confusing to call it target in this script.
     10
     11        * Scripts/webkitpy/layout_tests/driver_test.py:
     12        * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
     13        * Scripts/webkitpy/layout_tests/port/base.py:
     14        * Scripts/webkitpy/layout_tests/port/chromium.py:
     15        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
     16        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
     17        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
     18        * Scripts/webkitpy/layout_tests/port/mac.py:
     19        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
     20        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
     21        * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
     22        * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
     23        * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
     24        * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
     25
    1262010-04-07  Adam Barth  <abarth@webkit.org>
    227
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/driver_test.py

    r54710 r57256  
    6565    optparser.add_option('-p', '--platform', action='store', default='mac',
    6666                         help='Platform to test (e.g., "mac", "chromium-mac", etc.')
    67     optparser.add_option('-t', '--target', action='store', default='Release',
    68                          help='build type ("Debug" or "Release")')
     67    optparser.add_option('--debug', action='store_const', const='Debug',
     68                         dest="configuration", help='Set the configuration to Debug')
     69    optparser.add_option('--release', action='store_const', const='Release',
     70                         dest="configuration", help='Set the configuration to Release')
    6971    optparser.add_option('', '--timeout', action='store', default='2000',
    7072                         help='test timeout in milliseconds (2000 by default)')
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py

    r57187 r57256  
    5252
    5353
    54 def process_output(port, test_info, test_types, test_args, target, output_dir,
    55                    crash, timeout, test_run_time, actual_checksum,
     54def process_output(port, test_info, test_types, test_args, configuration,
     55                   output_dir, crash, timeout, test_run_time, actual_checksum,
    5656                   output, error):
    5757    """Receives the output from a test_shell process, subjects it to a number
     
    6464      test_types: list of test types to subject the output to
    6565      test_args: arguments to be passed to each test
    66       target: Debug or Release
     66      configuration: Debug or Release
    6767      output_dir: directory to put crash stack traces into
    6868
     
    102102        new_failures = test_type.compare_output(port, test_info.filename,
    103103                                                output, local_test_args,
    104                                                 target)
     104                                                configuration)
    105105        # Don't add any more failures if we already have a crash, so we don't
    106106        # double-report those tests. We do double-report for timeouts since
     
    131131
    132132    def __init__(self, port, image_path, shell_args, test_info,
    133         test_types, test_args, target, output_dir):
     133        test_types, test_args, configuration, output_dir):
    134134        """
    135135        Args:
     
    147147        self._test_types = test_types
    148148        self._test_args = test_args
    149         self._target = target
     149        self._configuration = configuration
    150150        self._output_dir = output_dir
    151151
     
    160160        self._test_stats = process_output(self._port,
    161161            test_info, self._test_types, self._test_args,
    162             self._target, self._output_dir, crash, timeout, end - start,
     162            self._configuration, self._output_dir, crash, timeout, end - start,
    163163            actual_checksum, output, error)
    164164        driver.stop()
     
    366366                                  self._test_types,
    367367                                  self._test_args,
    368                                   self._options.target,
     368                                  self._options.configuration,
    369369                                  self._options.results_directory)
    370370
     
    421421
    422422        stats = process_output(self._port, test_info, self._test_types,
    423                                self._test_args, self._options.target,
     423                               self._test_args, self._options.configuration,
    424424                               self._options.results_directory, crash,
    425425                               timeout, end - start, actual_checksum,
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py

    r56876 r57256  
    580580        raise NotImplementedError('Port.path_to_apache_config_file')
    581581
    582     def _path_to_driver(self, target=None):
     582    def _path_to_driver(self, configuration=None):
    583583        """Returns the full path to the test driver (DumpRenderTree)."""
    584584        raise NotImplementedError('Port.path_to_driver')
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py

    r57173 r57256  
    8181                                   'test driver')
    8282        if result:
    83             result = (self._check_driver_build_up_to_date(self._options.target)
     83            result = (self._check_driver_build_up_to_date(self._options.configuration)
    8484                      and result)
    8585        else:
     
    130130
    131131    def results_directory(self):
    132         return self.path_from_chromium_base('webkit', self._options.target,
     132        return self.path_from_chromium_base('webkit', self._options.configuration,
    133133                                            self._options.results_directory)
    134134
     
    202202    #
    203203
    204     def _check_driver_build_up_to_date(self, target):
    205         if target in ('Debug', 'Release'):
     204    def _check_driver_build_up_to_date(self, configuration):
     205        if configuration in ('Debug', 'Release'):
    206206            try:
    207207                debug_path = self._path_to_driver('Debug')
     
    211211                release_mtime = os.stat(release_path).st_mtime
    212212
    213                 if (debug_mtime > release_mtime and target == 'Release' or
    214                     release_mtime > debug_mtime and target == 'Debug'):
     213                if (debug_mtime > release_mtime and configuration == 'Release' or
     214                    release_mtime > debug_mtime and configuration == 'Debug'):
    215215                    _log.warning('You are not running the most '
    216216                                 'recent test_shell binary. You need to '
     
    237237        self._port = port
    238238        self._options = options
    239         self._target = port._options.target
     239        self._configuration = port._options.configuration
    240240        self._image_path = image_path
    241241
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py

    r56287 r57256  
    4747        if port_name is None:
    4848            port_name = 'chromium-linux'
    49         if options and not hasattr(options, 'target'):
    50             options.target = 'Release'
     49        if options and not hasattr(options, 'configuration'):
     50            options.configuration = 'Release'
    5151        chromium.ChromiumPort.__init__(self, port_name, options)
    5252
     
    170170        return "/usr/bin/php-cgi"
    171171
    172     def _path_to_driver(self, target=None):
    173         if not target:
    174             target = self._options.target
    175         return self._build_path(target, 'test_shell')
     172    def _path_to_driver(self, configuration=None):
     173        if not configuration:
     174            configuration = self._options.configuration
     175        return self._build_path(configuration, 'test_shell')
    176176
    177177    def _path_to_helper(self):
     
    179179
    180180    def _path_to_image_diff(self):
    181         return self._build_path(self._options.target, 'image_diff')
     181        return self._build_path(self._options.configuration, 'image_diff')
    182182
    183183    def _path_to_wdiff(self):
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py

    r56287 r57256  
    4747        if port_name is None:
    4848            port_name = 'chromium-mac'
    49         if options and not hasattr(options, 'target'):
    50             options.target = 'Release'
     49        if options and not hasattr(options, 'configuration'):
     50            options.configuration = 'Release'
    5151        chromium.ChromiumPort.__init__(self, port_name, options)
    5252
     
    146146        return self._lighttpd_path('bin', 'php-cgi')
    147147
    148     def _path_to_driver(self, target=None):
    149         # TODO(pinkerton): make |target| happy with case-sensitive file
     148    def _path_to_driver(self, configuration=None):
     149        # FIXME: make |configuration| happy with case-sensitive file
    150150        # systems.
    151         if not target:
    152             target = self._options.target
    153         return self._build_path(target, 'TestShell.app', 'Contents', 'MacOS',
    154                                 'TestShell')
     151        if not configuration:
     152            configuration = self._options.configuration
     153        return self._build_path(configuration, 'TestShell.app', 'Contents',
     154                                'MacOS', 'TestShell')
    155155
    156156    def _path_to_helper(self):
    157         return self._build_path(self._options.target, 'layout_test_helper')
     157        return self._build_path(self._options.configuration, 'layout_test_helper')
    158158
    159159    def _path_to_image_diff(self):
    160         return self._build_path(self._options.target, 'image_diff')
     160        return self._build_path(self._options.configuration, 'image_diff')
    161161
    162162    def _path_to_wdiff(self):
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py

    r56774 r57256  
    4848        if port_name is None:
    4949            port_name = 'chromium-win' + self.version()
    50         if options and not hasattr(options, 'target'):
    51             options.target = 'Release'
     50        if options and not hasattr(options, 'configuration'):
     51            options.configuration = 'Release'
    5252        chromium.ChromiumPort.__init__(self, port_name, options)
    5353
     
    142142        return self._lighttpd_path('php5', 'php-cgi.exe')
    143143
    144     def _path_to_driver(self, target=None):
    145         if not target:
    146             target = self._options.target
    147         return self._build_path(target, 'test_shell.exe')
     144    def _path_to_driver(self, configuration=None):
     145        if not configuration:
     146            configuration = self._options.configuration
     147        return self._build_path(configuration, 'test_shell.exe')
    148148
    149149    def _path_to_helper(self):
    150         return self._build_path(self._options.target, 'layout_test_helper.exe')
     150        return self._build_path(self._options.configuration, 'layout_test_helper.exe')
    151151
    152152    def _path_to_image_diff(self):
    153         return self._build_path(self._options.target, 'image_diff.exe')
     153        return self._build_path(self._options.configuration, 'image_diff.exe')
    154154
    155155    def _path_to_wdiff(self):
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py

    r57254 r57256  
    8181    def check_build(self, needs_http):
    8282        build_drt_command = [self.script_path("build-dumprendertree")]
    83         if self._options.target == "Debug":
     83        if self._options.configuration == "Debug":
    8484            build_drt_command.append('--debug')
    8585        if executive.run_command(build_drt_command, return_exit_code=True):
     
    320320                [self.script_path("webkit-build-directory"),
    321321                 "--top-level"]).rstrip()
    322         return os.path.join(self._cached_build_root, self._options.target,
     322        return os.path.join(self._cached_build_root, self._options.configuration,
    323323                            *comps)
    324324
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py

    r56876 r57256  
    10041004                        datefmt='%y%m%d %H:%M:%S')
    10051005
    1006     # options.target is used by port to locate image_diff binary.
     1006    # options.configuration is used by port to locate image_diff binary.
    10071007    # Check the imgage_diff release binary, if it does not exist,
    10081008    # fallback to debug.
    1009     options.target = "release"
     1009    options.configuration = "release"
    10101010    port_obj = port.get(None, options)
    10111011    if not port_obj.check_image_diff(override_step=None, logging=False):
    10121012        _log.debug('No release version image diff binary found.')
    1013         options.target = "debug"
     1013        options.configuration = "debug"
    10141014        port_obj = port.get(None, options)
    10151015    else:
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

    r57185 r57256  
    348348            self._expectations = self.parse_expectations(
    349349                self._port.test_platform_name(),
    350                 self._options.target == 'Debug')
     350                self._options.configuration == 'Debug')
    351351
    352352            self._test_files = set(files)
     
    13881388                        stream=meter)
    13891389
    1390     if not options.target:
    1391         if options.debug:
    1392             options.target = "Debug"
    1393         else:
    1394             options.target = "Release"
     1390    if not options.configuration:
     1391        options.configuration = "Release"
     1392        # FIXME: We should detect from set-webkit-configuration.
    13951393
    13961394    port_obj = port.get(options.platform, options)
     
    14321430
    14331431    if not options.time_out_ms:
    1434         if options.target == "Debug":
     1432        if options.configuration == "Debug":
    14351433            options.time_out_ms = str(2 * TestRunner.DEFAULT_TEST_TIMEOUT_MS)
    14361434        else:
     
    14611459
    14621460    if options.lint_test_files:
    1463         # Creating the expecations for each platform/target pair does all the
    1464         # test list parsing and ensures it's correct syntax (e.g. no dupes).
     1461        # Creating the expecations for each platform/configuration pair does
     1462        # all the test list parsing and ensures it's correct syntax (e.g. no
     1463        # dupes).
    14651464        for platform in port_obj.test_platform_names():
    14661465            test_runner.parse_expectations(platform, is_debug_mode=True)
     
    14761475    if options.new_baseline:
    14771476        write("Placing new baselines in %s" % port_obj.baseline_path())
    1478     write("Using %s build" % options.target)
     1477    write("Using %s build" % options.configuration)
    14791478    if options.pixel_tests:
    14801479        write("Pixel tests enabled")
     
    14851484    meter.update("Parsing expectations ...")
    14861485    test_runner.parse_expectations(port_obj.test_platform_name(),
    1487                                    options.target == 'Debug')
     1486                                   options.configuration == 'Debug')
    14881487
    14891488    meter.update("Checking build ...")
     
    15711570                             default=False,
    15721571                             help="run a separate test_shell for each test")
    1573     option_parser.add_option("", "--debug", action="store_true", default=False,
    1574                              help="use the debug binary instead of the release"
    1575                                   " binary")
    15761572    option_parser.add_option("", "--num-slow-tests-to-log", default=50,
    15771573                             help="Number of slow tests whose timings "
     
    15791575    option_parser.add_option("", "--platform",
    15801576                             help="Override the platform for expected results")
    1581     option_parser.add_option("", "--target", default="",
    1582                              help="Set the build target configuration "
    1583                                   "(overrides --debug)")
     1577    option_parser.add_option('--debug', action='store_const', const='Debug',
     1578                             dest="configuration",
     1579                             help='Set the configuration to Debug')
     1580    option_parser.add_option('--release', action='store_const', const='Release',
     1581                             dest="configuration",
     1582                             help='Set the configuration to Release')
    15841583    option_parser.add_option("", "--log", action="store",
    15851584                             default="detailed-progress,unexpected",
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py

    r56475 r57256  
    4545class FuzzyImageDiff(test_type_base.TestTypeBase):
    4646
    47     def compare_output(self, filename, output, test_args, target):
     47    def compare_output(self, filename, output, test_args, configuration):
    4848        """Implementation of CompareOutput that checks the output image and
    4949        checksum against the expected files from the LayoutTest directory.
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py

    r56647 r57256  
    8585        self._save_baseline_data(filename, checksum, ".checksum")
    8686
    87     def _create_image_diff(self, port, filename, target):
     87    def _create_image_diff(self, port, filename, configuration):
    8888        """Creates the visual diff of the expected/actual PNGs.
    8989
    9090        Args:
    9191          filename: the name of the test
    92           target: Debug or Release
     92          configuration: Debug or Release
    9393        Returns True if the files are different, False if they match
    9494        """
     
    111111        if not _compare_available and not _compare_msg_printed:
    112112            _compare_msg_printed = True
    113             print('image_diff not found. Make sure you have a ' + target +
    114                   ' build of the image_diff executable.')
     113            print('image_diff not found. Make sure you have a ' +
     114                  configuration + ' build of the image_diff executable.')
    115115
    116116        return result
    117117
    118     def compare_output(self, port, filename, output, test_args, target):
     118    def compare_output(self, port, filename, output, test_args, configuration):
    119119        """Implementation of CompareOutput that checks the output image and
    120120        checksum against the expected files from the LayoutTest directory.
     
    170170        # Even though we only use the result in one codepath below but we
    171171        # still need to call CreateImageDiff for other codepaths.
    172         images_are_different = self._create_image_diff(port, filename, target)
     172        images_are_different = self._create_image_diff(port, filename, configuration)
    173173        if expected_hash == '':
    174174            failures.append(test_failures.FailureMissingImageHash(self))
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py

    r55938 r57256  
    132132        return os.path.splitext(output_filename)[0] + modifier
    133133
    134     def compare_output(self, port, filename, output, test_args, target):
     134    def compare_output(self, port, filename, output, test_args, configuration):
    135135        """Method that compares the output from the test with the
    136136        expected value.
     
    143143          test_args: a TestArguments object holding optional additional
    144144              arguments
    145           target: Debug or Release
     145          configuration: Debug or Release
    146146
    147147        Return:
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py

    r55603 r57256  
    8181        return text.strip("\r\n").replace("\r\n", "\n") + "\n"
    8282
    83     def compare_output(self, port, filename, output, test_args, target):
     83    def compare_output(self, port, filename, output, test_args, configuration):
    8484        """Implementation of CompareOutput that checks the output text against
    8585        the expected text from the LayoutTest directory."""
Note: See TracChangeset for help on using the changeset viewer.