webkitpluginhost: Support ASan as a style
authorjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Jun 2019 18:44:03 +0000 (18:44 +0000)
committerjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Jun 2019 18:44:03 +0000 (18:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=198586
<rdar://problem/51459088>

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/port/base.py:
(Port.configuration_for_upload): Add ASan as a style.
* Scripts/webkitpy/port/config.py:
(Config._read_configuration):
(Config):
(Config.asan): Add property to check if the ASan configuration is active.
* Scripts/webkitpy/port/config_unittest.py:
(ConfigTest.test_default_configuration__scripterror):
(ConfigTest):
(ConfigTest.test_asan):
* Scripts/webkitpy/test/main.py:
(Tester._run_tests): Add Asan as a style.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246159 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/port/base.py
Tools/Scripts/webkitpy/port/config.py
Tools/Scripts/webkitpy/port/config_unittest.py
Tools/Scripts/webkitpy/test/main.py

index d32050e..2e98fe2 100644 (file)
@@ -1,3 +1,24 @@
+2019-06-06  Jonathan Bedard  <jbedard@apple.com>
+
+        webkitpluginhost: Support ASan as a style
+        https://bugs.webkit.org/show_bug.cgi?id=198586
+        <rdar://problem/51459088>
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Scripts/webkitpy/port/base.py:
+        (Port.configuration_for_upload): Add ASan as a style.
+        * Scripts/webkitpy/port/config.py:
+        (Config._read_configuration):
+        (Config):
+        (Config.asan): Add property to check if the ASan configuration is active.
+        * Scripts/webkitpy/port/config_unittest.py:
+        (ConfigTest.test_default_configuration__scripterror):
+        (ConfigTest):
+        (ConfigTest.test_asan):
+        * Scripts/webkitpy/test/main.py:
+        (Tester._run_tests): Add Asan as a style.
+
 2019-06-06  Alexey Proskuryakov  <ap@apple.com>
 
         block-spammers tool doesn't block e-mail
index 36267ca..c4d3285 100644 (file)
@@ -1583,12 +1583,19 @@ class Port(object):
         configuration = self.test_configuration()
         host = self.host or host
 
+        if self.get_option('guard_malloc'):
+            style = 'guard-malloc'
+        elif self._config.asan:
+            style = 'asan'
+        else:
+            style = configuration.build_type
+
         return Upload.create_configuration(
             platform=host.platform.os_name,
             version=str(host.platform.os_version),
             version_name=host.platform.os_version_name(INTERNAL_TABLE) or host.platform.os_version_name(),
             architecture=configuration.architecture,
-            style='guard-malloc' if self.get_option('guard_malloc') else configuration.build_type,
+            style=style,
             sdk=host.platform.build_version(),
         )
 
index b1cc4f2..0667a8a 100644 (file)
@@ -149,3 +149,11 @@ class Config(object):
             return None
 
         return self._filesystem.read_text_file(configuration_path).rstrip()
+
+    @property
+    @memoized
+    def asan(self):
+        try:
+            return self._filesystem.exists(self._filesystem.join(self.build_directory(None), "ASan"))
+        except:
+            return False
index c23c86d..68118b3 100644 (file)
@@ -156,3 +156,9 @@ class ConfigTest(unittest.TestCase):
         c = self.make_config(exception=ScriptError())
         actual = c.default_configuration()
         self.assertEqual(actual, 'Release')
+
+    def test_asan(self):
+        config = self.make_config(output='foo\nfoo/Release', files={'foo/Configuration': 'Release', 'foo/ASan': 'YES'})
+        self.assertEqual(config.asan, True)
+        config = self.make_config(output='foo\nfoo/Release', files={'foo/Configuration': 'Release'})
+        self.assertEqual(config.asan, False)
index 1cf70e4..bfa212b 100644 (file)
@@ -190,6 +190,7 @@ class Tester(object):
         start_time = time.time()
         config = Config(_host.executive, self.finder.filesystem)
         configuration_to_use = self._options.configuration or config.default_configuration()
+
         if will_run_lldb_webkit_tests:
             self.printer.write_update('Building lldbWebKitTester ...')
             build_lldbwebkittester = self.finder.filesystem.join(_webkit_root, 'Tools', 'Scripts', 'build-lldbwebkittester')
@@ -260,7 +261,7 @@ class Tester(object):
                     platform=_host.platform.os_name,
                     version=str(_host.platform.os_version),
                     version_name=_host.platform.os_version_name(),
-                    style=configuration_to_use,
+                    style='asan' if config.asan else configuration_to_use,
                     sdk=_host.platform.build_version(),
                 ),
                 details=Upload.create_details(options=self._options),