Mark test cases affected by PR 15036 (GCC-generated DWARF causes parser crash)
- Add new decorator "@skipIfGcc" to lldbtest.py
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173394 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/lldbtest.py b/test/lldbtest.py
index ceb1617..17ad718 100644
--- a/test/lldbtest.py
+++ b/test/lldbtest.py
@@ -446,6 +446,22 @@
func(*args, **kwargs)
return wrapper
+def skipIfGcc(func):
+ """Decorate the item to skip tests that should be skipped if building with gcc ."""
+ if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+ raise Exception("@skipOnLinux can only be used to decorate a test method")
+ @wraps(func)
+ def wrapper(*args, **kwargs):
+ from unittest2 import case
+ self = args[0]
+ compiler = self.getCompiler()
+ if "gcc" in compiler:
+ self.skipTest("skipping because gcc is the test compiler")
+ else:
+ func(*args, **kwargs)
+ return wrapper
+
+
class Base(unittest2.TestCase):
"""
Abstract base for performing lldb (see TestBase) or other generic tests (see