[Lldb-commits] [lldb] r187816 - Centralizing Intel compiler detection logic in lldbtest.py to avoid duplication in the future.

Daniel Malea daniel.malea at intel.com
Tue Aug 6 13:51:41 PDT 2013


Author: dmalea
Date: Tue Aug  6 15:51:41 2013
New Revision: 187816

URL: http://llvm.org/viewvc/llvm-project?rev=187816&view=rev
Log:
Centralizing Intel compiler detection logic in lldbtest.py to avoid duplication in the future.
- Addresses review comments from Stefanus!


Modified:
    lldb/trunk/test/functionalities/thread/step_out/TestThreadStepOut.py
    lldb/trunk/test/lldbtest.py

Modified: lldb/trunk/test/functionalities/thread/step_out/TestThreadStepOut.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/thread/step_out/TestThreadStepOut.py?rev=187816&r1=187815&r2=187816&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/thread/step_out/TestThreadStepOut.py (original)
+++ lldb/trunk/test/functionalities/thread/step_out/TestThreadStepOut.py Tue Aug  6 15:51:41 2013
@@ -56,7 +56,7 @@ class ThreadStepOutTestCase(TestBase):
         TestBase.setUp(self)
         # Find the line number for our breakpoint.
         self.breakpoint = line_number('main.cpp', '// Set breakpoint here')
-        if any([x in self.getCompiler() for x in ["gcc", "icc", "icpc", "icl"]]):
+        if "gcc" in self.getCompiler() or self.isIntelCompiler(): 
             self.step_out_destination = line_number('main.cpp', '// Expect to stop here after step-out (icc and gcc)')
         else:
             self.step_out_destination = line_number('main.cpp', '// Expect to stop here after step-out (clang)')

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=187816&r1=187815&r2=187816&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Tue Aug  6 15:51:41 2013
@@ -1255,6 +1255,10 @@ class Base(unittest2.TestCase):
                 version = m.group(1)
         return version
 
+    def isIntelCompiler(self):
+        """ Returns true if using an Intel (ICC) compiler, false otherwise. """
+        return any([x in self.getCompiler() for x in ["icc", "icpc", "icl"]])
+
     def expectedCompilerVersion(self, compiler_version):
         """Returns True iff compiler_version[1] matches the current compiler version.
            Use compiler_version[0] to specify the operator used to determine if a match has occurred.





More information about the lldb-commits mailing list