Title: [234099] trunk/Tools
Revision
234099
Author
[email protected]
Date
2018-07-23 10:02:32 -0700 (Mon, 23 Jul 2018)

Log Message

test-webkitpy should take configuration command line options
https://bugs.webkit.org/show_bug.cgi?id=187872

Reviewed by David Kilzer.

Add --debug and --release optional command line options and teach the test bots to invoke test-webkitpy
with the appropriate configuration. At the moment these options are only meaningful on Mac since they
effect the configuration lldbWebKitTester is built with and we only build lldbWebKitTester on Mac.

* BuildSlaveSupport/build.webkit.org-config/steps.py:
(RunPythonTests): Pass the configuration to test-webkitpy. On Mac this will effect
how lldbWebKitTester is built. All other ports do not make use of the specified configuration.
* Scripts/webkitpy/test/main.py:
(_build_lldb_webkit_tester): Modified to take the configuration to build lldbWebKitTester. If
the specified configuration is None then we fall back to using the default configuration (as set
by script set-webkit-configuration).
(Tester._parse_args): Add command line options --debug and --release to build lldbWebKitTester
with a Debug configuration and a Release configuration, respectively
(Tester._run_tests): Pass the configuration to build lldbWebKitTester that we parsed from
the command line options. It may be None if neither --debug nor --release were passed.

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/steps.py (234098 => 234099)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/steps.py	2018-07-23 16:53:54 UTC (rev 234098)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/steps.py	2018-07-23 17:02:32 UTC (rev 234099)
@@ -526,7 +526,7 @@
     name = "webkitpy-test"
     description = ["python-tests running"]
     descriptionDone = ["python-tests"]
-    command = ["python", "./Tools/Scripts/test-webkitpy", "--verbose"]
+    command = ["python", "./Tools/Scripts/test-webkitpy", "--verbose", WithProperties("--%(configuration)s")]
     failedTestsFormatString = "%d python test%s failed"
 
     def start(self):

Modified: trunk/Tools/ChangeLog (234098 => 234099)


--- trunk/Tools/ChangeLog	2018-07-23 16:53:54 UTC (rev 234098)
+++ trunk/Tools/ChangeLog	2018-07-23 17:02:32 UTC (rev 234099)
@@ -1,3 +1,26 @@
+2018-07-23  Daniel Bates  <[email protected]>
+
+        test-webkitpy should take configuration command line options
+        https://bugs.webkit.org/show_bug.cgi?id=187872
+
+        Reviewed by David Kilzer.
+
+        Add --debug and --release optional command line options and teach the test bots to invoke test-webkitpy
+        with the appropriate configuration. At the moment these options are only meaningful on Mac since they
+        effect the configuration lldbWebKitTester is built with and we only build lldbWebKitTester on Mac.
+
+        * BuildSlaveSupport/build.webkit.org-config/steps.py:
+        (RunPythonTests): Pass the configuration to test-webkitpy. On Mac this will effect
+        how lldbWebKitTester is built. All other ports do not make use of the specified configuration.
+        * Scripts/webkitpy/test/main.py:
+        (_build_lldb_webkit_tester): Modified to take the configuration to build lldbWebKitTester. If
+        the specified configuration is None then we fall back to using the default configuration (as set
+        by script set-webkit-configuration).
+        (Tester._parse_args): Add command line options --debug and --release to build lldbWebKitTester
+        with a Debug configuration and a Release configuration, respectively
+        (Tester._run_tests): Pass the configuration to build lldbWebKitTester that we parsed from
+        the command line options. It may be None if neither --debug nor --release were passed.
+
 2018-07-23  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r233030.

Modified: trunk/Tools/Scripts/webkitpy/test/main.py (234098 => 234099)


--- trunk/Tools/Scripts/webkitpy/test/main.py	2018-07-23 16:53:54 UTC (rev 234098)
+++ trunk/Tools/Scripts/webkitpy/test/main.py	2018-07-23 17:02:32 UTC (rev 234099)
@@ -52,7 +52,7 @@
 _webkit_root = None
 
 
-def _build_lldb_webkit_tester():
+def _build_lldb_webkit_tester(configuration):
     if not _host.platform.is_mac():
         _log.error('lldbWebKitTester is not supported on this platform.')
         return False
@@ -59,7 +59,7 @@
     config = Config(_host.executive, _host.filesystem)
     build_lldbwebkittester = os.path.join(_webkit_root, 'Tools', 'Scripts', 'build-lldbwebkittester')
     try:
-        _host.executive.run_and_throw_if_fail([build_lldbwebkittester, config.flag_for_configuration(config.default_configuration())], quiet=True)
+        _host.executive.run_and_throw_if_fail([build_lldbwebkittester, config.flag_for_configuration(configuration or config.default_configuration())], quiet=True)
     except ScriptError as e:
         _log.error(e.message_with_output(output_limit=None))
         return False
@@ -137,6 +137,15 @@
 
     def _parse_args(self, argv=None):
         parser = optparse.OptionParser(usage='usage: %prog [options] [args...]')
+
+        #  Configuration options only effect the building of lldbWebKitTester.
+        configuration_group = optparse.OptionGroup(parser, 'Configuration options')
+        configuration_group.add_option('--debug', action='', const='Debug', dest="configuration",
+            help='Set the configuration to Debug')
+        configuration_group.add_option('--release', action='', const='Release', dest="configuration",
+            help='Set the configuration to Release')
+        parser.add_option_group(configuration_group)
+
         parser.add_option('-a', '--all', action='', default=False,
                           help='run all the tests')
         parser.add_option('-c', '--coverage', action='', default=False,
@@ -189,7 +198,7 @@
 
         if will_run_lldb_webkit_tests:
             self.printer.write_update('Building lldbWebKitTester ...')
-            if not _build_lldb_webkit_tester():
+            if not _build_lldb_webkit_tester(configuration=self._options.configuration):
                 _log.error('Failed to build lldbWebKitTester.')
                 return False
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to