diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-01 18:35:40 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-01 18:35:40 +0000 |
commit | 52f12f63f4ecaab157c9a056f6185746d87cd6e3 (patch) | |
tree | 87b217fbfa4a27372c511ea4eb8bd3151f41946a /lldb/packages/Python/lldbsuite | |
parent | 172838df6bc9c7754b030776428f875b57d70ed2 (diff) | |
download | bcm5719-llvm-52f12f63f4ecaab157c9a056f6185746d87cd6e3.tar.gz bcm5719-llvm-52f12f63f4ecaab157c9a056f6185746d87cd6e3.zip |
Fix `skipIfSanitized` decorator on macOS
For security reasons, DYLD_INSERT_LIBRARIES is not propagated to a child
process. This breaks the skipIfSanitized decorator, which checks for the
environment variable being set. Instead, always set the ASAN_OPTIONS and
make the decorator check for that.
Differential revision: https://reviews.llvm.org/D65594
llvm-svn: 367595
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
3 files changed, 7 insertions, 8 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py index d5b2ec3eb1e..272460fee1b 100644 --- a/lldb/packages/Python/lldbsuite/test/decorators.py +++ b/lldb/packages/Python/lldbsuite/test/decorators.py @@ -821,11 +821,10 @@ def skipUnlessFeature(feature): return "%s is not supported on this system." % feature return skipTestIfFn(is_feature_enabled) -def skipIfSanitized(func): +def skipIfAsan(func): """Skip this test if the environment is set up to run LLDB itself under ASAN.""" - def is_sanitized(): - if (('DYLD_INSERT_LIBRARIES' in os.environ) and - 'libclang_rt.asan' in os.environ['DYLD_INSERT_LIBRARIES']): + def is_asan(): + if ('ASAN_OPTIONS' in os.environ): return "ASAN unsupported" return None - return skipTestIfFn(is_sanitized)(func) + return skipTestIfFn(is_asan)(func) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py b/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py index dc51a3d4a36..9f75735ac17 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py @@ -21,7 +21,7 @@ class ExecTestCase(TestBase): @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532") @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://problem/34559552") # this exec test has problems on ios systems @expectedFailureNetBSD - @skipIfSanitized # rdar://problem/43756823 + @skipIfAsan # rdar://problem/43756823 @skipIfWindows def test_hitting_exec (self): self.do_test(False) @@ -29,7 +29,7 @@ class ExecTestCase(TestBase): @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532") @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://problem/34559552") # this exec test has problems on ios systems @expectedFailureNetBSD - @skipIfSanitized # rdar://problem/43756823 + @skipIfAsan # rdar://problem/43756823 @skipIfWindows def test_skipping_exec (self): self.do_test(True) diff --git a/lldb/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py b/lldb/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py index c9fa4870c0e..e0f4dd6f054 100644 --- a/lldb/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py +++ b/lldb/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py @@ -108,7 +108,7 @@ class HelloWorldTestCase(TestBase): @add_test_categories(['pyapi']) @skipIfiOSSimulator - @skipIfSanitized # FIXME: Hangs indefinitely. + @skipIfAsan # FIXME: Hangs indefinitely. @expectedFailureNetBSD def test_with_attach_to_process_with_name_api(self): """Create target, spawn a process, and attach to it with process name.""" |