[Lldb-commits] [lldb] 09de6e0 - Let @skipUnlessAddressSanitizer imply @skipIfAsan

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Tue May 26 13:51:28 PDT 2020


Author: Adrian Prantl
Date: 2020-05-26T13:51:08-07:00
New Revision: 09de6e0fbd0b6ca7fa8760ac3513be6bbbba5a81

URL: https://github.com/llvm/llvm-project/commit/09de6e0fbd0b6ca7fa8760ac3513be6bbbba5a81
DIFF: https://github.com/llvm/llvm-project/commit/09de6e0fbd0b6ca7fa8760ac3513be6bbbba5a81.diff

LOG: Let @skipUnlessAddressSanitizer imply @skipIfAsan

Don't run tests that use address sanitizer inside an address-sanitized
LLDB. The tests don't support that configuration. Incidentally they
were skipped on green dragon for a different reason, so this hasn't
come up there before.

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/decorators.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py
index 65b63b4b40a8..b94b672e4499 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -785,10 +785,21 @@ def is_compiler_clang_with_ubsan(self):
 
     return skipTestIfFn(is_compiler_clang_with_ubsan)(func)
 
+def is_running_under_asan():
+    if ('ASAN_OPTIONS' in os.environ):
+        return "ASAN unsupported"
+    return None
+
 def skipUnlessAddressSanitizer(func):
     """Decorate the item to skip test unless Clang -fsanitize=thread is supported."""
 
     def is_compiler_with_address_sanitizer(self):
+        # Also don't run tests that use address sanitizer inside an
+        # address-sanitized LLDB. The tests don't support that
+        # configuration.
+        if is_running_under_asan():
+            return "Address sanitizer tests are disabled when runing under ASAN"
+
         compiler_path = self.getCompiler()
         compiler = os.path.basename(compiler_path)
         f = tempfile.NamedTemporaryFile()
@@ -803,6 +814,10 @@ def is_compiler_with_address_sanitizer(self):
         return None
     return skipTestIfFn(is_compiler_with_address_sanitizer)(func)
 
+def skipIfAsan(func):
+    """Skip this test if the environment is set up to run LLDB *itself* under ASAN."""
+    return skipTestIfFn(is_running_under_asan)(func)
+
 def _get_bool_config_skip_if_decorator(key):
     config = lldb.SBDebugger.GetBuildConfiguration()
     value_node = config.GetValueForKey(key)
@@ -847,14 +862,6 @@ def is_feature_enabled(self):
                 return "%s is not supported on this system." % feature
     return skipTestIfFn(is_feature_enabled)
 
-def skipIfAsan(func):
-    """Skip this test if the environment is set up to run LLDB itself under ASAN."""
-    def is_asan():
-        if ('ASAN_OPTIONS' in os.environ):
-            return "ASAN unsupported"
-        return None
-    return skipTestIfFn(is_asan)(func)
-
 def skipIfReproducer(func):
     """Skip this test if the environment is set up to run LLDB with reproducers."""
     def is_reproducer():


        


More information about the lldb-commits mailing list