[Lldb-commits] [lldb] r177174 - Add icc support to the test suite

Matt Kopec Matt.Kopec at intel.com
Fri Mar 15 12:10:13 PDT 2013


Author: mkopec
Date: Fri Mar 15 14:10:12 2013
New Revision: 177174

URL: http://llvm.org/viewvc/llvm-project?rev=177174&view=rev
Log:
Add icc support to the test suite
-adds icc to the lit of compilers to run the tests
-adds icc test decorators
-skip TestAnonymous.py for icc

Patch by Ashok Thirumurthi.

Modified:
    lldb/trunk/test/lang/c/anonymous/TestAnonymous.py
    lldb/trunk/test/lldbtest.py
    lldb/trunk/test/make/Makefile.rules

Modified: lldb/trunk/test/lang/c/anonymous/TestAnonymous.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/anonymous/TestAnonymous.py?rev=177174&r1=177173&r2=177174&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/anonymous/TestAnonymous.py (original)
+++ lldb/trunk/test/lang/c/anonymous/TestAnonymous.py Fri Mar 15 14:10:12 2013
@@ -16,6 +16,7 @@ class AnonymousTestCase(TestBase):
         self.expr()
 
     @skipIfGcc # llvm.org/pr15036: LLDB is unable to parse DWARF generated by GCC
+    @skipIfIcc # llvm.org/pr15036: LLDB generates an incorrect AST layout for an anonymous struct when DWARF is generated by ICC
     @dwarf_test
     def test_expr_with_dwarf(self):
         self.buildDwarf()

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=177174&r1=177173&r2=177174&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Fri Mar 15 14:10:12 2013
@@ -440,6 +440,42 @@ def expectedFailureClang(bugnumber=None)
               return wrapper
         return expectedFailureClang_impl
 
+def expectedFailureIcc(bugnumber=None):
+     if callable(bugnumber):
+        @wraps(bugnumber)
+        def expectedFailureIcc_easy_wrapper(*args, **kwargs):
+            from unittest2 import case
+            self = args[0]
+            test_compiler = self.getCompiler()
+            try:
+                bugnumber(*args, **kwargs)
+            except Exception:
+                if "icc" in test_compiler:
+                    raise case._ExpectedFailure(sys.exc_info(),None)
+                else:
+                    raise
+            if "icc" in test_compiler:
+                raise case._UnexpectedSuccess(sys.exc_info(),None)
+        return expectedFailureIcc_easy_wrapper
+     else:
+        def expectedFailureIcc_impl(func):
+              @wraps(func)
+              def wrapper(*args, **kwargs):
+                from unittest2 import case
+                self = args[0]
+                test_compiler = self.getCompiler()
+                try:
+                    func(*args, **kwargs)
+                except Exception:
+                    if "icc" in test_compiler:
+                        raise case._ExpectedFailure(sys.exc_info(),bugnumber)
+                    else:
+                        raise
+                if "icc" in test_compiler:
+                    raise case._UnexpectedSuccess(sys.exc_info(),bugnumber)
+              return wrapper
+        return expectedFailureIcc_impl
+
 
 def expectedFailurei386(bugnumber=None):
      if callable(bugnumber):
@@ -542,6 +578,21 @@ def skipIfGcc(func):
         else:
             func(*args, **kwargs)
     return wrapper
+
+def skipIfIcc(func):
+    """Decorate the item to skip tests that should be skipped if building with icc ."""
+    if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+        raise Exception("@skipIfIcc 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 "icc" in compiler:
+            self.skipTest("skipping because icc is the test compiler")
+        else:
+            func(*args, **kwargs)
+    return wrapper
 
 class Base(unittest2.TestCase):
     """

Modified: lldb/trunk/test/make/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/make/Makefile.rules?rev=177174&r1=177173&r2=177174&view=diff
==============================================================================
--- lldb/trunk/test/make/Makefile.rules (original)
+++ lldb/trunk/test/make/Makefile.rules Fri Mar 15 14:10:12 2013
@@ -106,10 +106,10 @@ ifneq "$(DYLIB_NAME)" ""
 endif
 
 # Function that returns the counterpart C++ compiler, given $(CC) as arg.
-cxx_compiler = $(if $(findstring clang,$(1)), $(subst clang,clang++,$(1)), $(if $(findstring llvm-gcc,$(1)), $(subst llvm-gcc,llvm-g++,$(1)), $(subst gcc,g++,$(1))))
+cxx_compiler = $(if $(findstring clang,$(1)), $(subst clang,clang++,$(1)), if $(findstring icc,$(1)), $(subst icc,icpc,$(1)), $(if $(findstring llvm-gcc,$(1)), $(subst llvm-gcc,llvm-g++,$(1)), $(subst gcc,g++,$(1))))
 
 # Function that returns the C++ linker, given $(CC) as arg.
-cxx_linker = $(if $(findstring clang,$(1)), $(subst clang,clang++,$(1)), $(if $(findstring llvm-gcc,$(1)), $(subst llvm-gcc,llvm-g++,$(1)), $(subst gcc,g++,$(1))))
+cxx_linker = $(if $(findstring clang,$(1)), $(subst clang,clang++,$(1)), if $(findstring icc,$(1)), $(subst icc,icpc,$(1)), $(if $(findstring llvm-gcc,$(1)), $(subst llvm-gcc,llvm-g++,$(1)), $(subst gcc,g++,$(1))))
 
 #----------------------------------------------------------------------
 # dylib settings





More information about the lldb-commits mailing list