summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-11-10 19:16:17 +0000
committerChris Bieneman <beanz@apple.com>2016-11-10 19:16:17 +0000
commit58ddb8d0415fe3e704943118a6e3b7cf02515739 (patch)
treeb680f5b0e46af3b2a19a9740c49366b411bd708f /lldb/packages/Python/lldbsuite/test
parent916f4455351ebf2422c0cf08a7cd583ef8b7684b (diff)
downloadbcm5719-llvm-58ddb8d0415fe3e704943118a6e3b7cf02515739.tar.gz
bcm5719-llvm-58ddb8d0415fe3e704943118a6e3b7cf02515739.zip
[Test-Suite] Fix all the sanitizer tests to be based on compiler capabilities
Summary: This patch reworks all the @skip... lines for sanitizer libraries to be based on whether or not the compiler actually works, rather than whether or not the compiler-rt sources are present in some magically derived directory. Reviewers: lldb-commits Subscribers: kubabrecka, tfiala Differential Revision: https://reviews.llvm.org/D26513 llvm-svn: 286490
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/decorators.py41
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py1
9 files changed, 18 insertions, 33 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py
index 690cd0ace53..ba0d37827bb 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -656,31 +656,6 @@ def skipIfTargetAndroid(api_levels=None, archs=None):
archs))
-def skipUnlessCompilerRt(func):
- """Decorate the item to skip tests if testing remotely."""
- def is_compiler_rt_missing():
- compilerRtPath = os.path.join(
- os.environ["LLDB_SRC"],
- "..",
- "..",
- "..",
- "llvm",
- "projects",
- "compiler-rt")
- if not os.path.exists(compilerRtPath):
- compilerRtPath = os.path.join(
- os.environ["LLDB_SRC"],
- "..",
- "..",
- "..",
- "llvm",
- "runtimes",
- "compiler-rt")
- return "compiler-rt not found" if not os.path.exists(
- compilerRtPath) else None
- return skipTestIfFn(is_compiler_rt_missing)(func)
-
-
def skipUnlessThreadSanitizer(func):
"""Decorate the item to skip test unless Clang -fsanitize=thread is supported."""
@@ -701,3 +676,19 @@ def skipUnlessThreadSanitizer(func):
return "Compiler cannot compile with -fsanitize=thread"
return None
return skipTestIfFn(is_compiler_clang_with_thread_sanitizer)(func)
+
+def skipUnlessAddressSanitizer(func):
+ """Decorate the item to skip test unless Clang -fsanitize=thread is supported."""
+
+ def is_compiler_with_address_sanitizer(self):
+ compiler_path = self.getCompiler()
+ compiler = os.path.basename(compiler_path)
+ f = tempfile.NamedTemporaryFile()
+ cmd = "echo 'int main() {}' | %s -x c -o %s -" % (compiler_path, f.name)
+ if os.popen(cmd).close() is not None:
+ return None # The compiler cannot compile at all, let's *not* skip the test
+ cmd = "echo 'int main() {}' | %s -fsanitize=address -x c -o %s -" % (compiler_path, f.name)
+ if os.popen(cmd).close() is not None:
+ return "Compiler cannot compile with -fsanitize=address"
+ return None
+ return skipTestIfFn(is_compiler_with_address_sanitizer)(func)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py b/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
index 29e75f86308..3803104bef7 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
@@ -23,7 +23,7 @@ class AsanTestCase(TestBase):
bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)")
@skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
@skipIfRemote
- @skipUnlessCompilerRt
+ @skipUnlessAddressSanitizer
def test(self):
self.build()
self.asan_tests()
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py b/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
index 91bfa9eb9f6..6d461b5e264 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
@@ -23,7 +23,7 @@ class AsanTestReportDataCase(TestBase):
bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)")
@skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
@skipIfRemote
- @skipUnlessCompilerRt
+ @skipUnlessAddressSanitizer
@expectedFailureAll(archs=['i386'], bugnumber="rdar://28658860")
def test(self):
self.build()
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
index 241c49897ef..f1689a8fda0 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
@@ -20,7 +20,6 @@ class TsanBasicTestCase(TestBase):
bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)")
@skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
@skipIfRemote
- @skipUnlessCompilerRt
@skipUnlessThreadSanitizer
def test(self):
self.build()
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py
index 8aa75d22e97..8baba9beed3 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py
@@ -20,7 +20,6 @@ class TsanCPPGlobalLocationTestCase(TestBase):
bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)")
@skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
@skipIfRemote
- @skipUnlessCompilerRt
@skipUnlessThreadSanitizer
def test(self):
self.build()
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py
index cec74eeaf44..3f0cae6a54c 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py
@@ -20,7 +20,6 @@ class TsanGlobalLocationTestCase(TestBase):
bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)")
@skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
@skipIfRemote
- @skipUnlessCompilerRt
@skipUnlessThreadSanitizer
def test(self):
self.build()
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py
index b9baaf89b05..436fcf63d07 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py
@@ -20,7 +20,6 @@ class TsanMultipleTestCase(TestBase):
bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)")
@skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
@skipIfRemote
- @skipUnlessCompilerRt
@skipUnlessThreadSanitizer
def test(self):
self.build()
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py
index 45e5dbf9b30..f4380cf7749 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py
@@ -20,7 +20,6 @@ class TsanThreadLeakTestCase(TestBase):
bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)")
@skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
@skipIfRemote
- @skipUnlessCompilerRt
@skipUnlessThreadSanitizer
def test(self):
self.build()
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py
index abcf1f4eca0..684e6f71d93 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py
@@ -20,7 +20,6 @@ class TsanThreadNumbersTestCase(TestBase):
bugnumber="non-core functionality, need to reenable and fix later (DES 2014.11.07)")
@skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
@skipIfRemote
- @skipUnlessCompilerRt
@skipUnlessThreadSanitizer
def test(self):
self.build()
OpenPOWER on IntegriCloud