[Lldb-commits] [lldb] r182155 - Fix xpasses on the gcc buildbots using compiler versions to qualify the xfail.
Ashok Thirumurthi
ashok.thirumurthi at intel.com
Fri May 17 13:15:07 PDT 2013
Author: athirumu
Date: Fri May 17 15:15:07 2013
New Revision: 182155
URL: http://llvm.org/viewvc/llvm-project?rev=182155&view=rev
Log:
Fix xpasses on the gcc buildbots using compiler versions to qualify the xfail.
- Note that this is not correct, as the failure is associated with build options of libc.so, however it's failing on a Debian buildbot that uses gcc 4.6.2 (and the real goal is a complete backtrace even with -fomit-frame-pointer).
- Adds helpers to lldbtest.py to check the expectedCompiler and expectedVersion, with an eventual goal of reducing the number of test decorators.
--- Currently allows a comparison operator and a compiler version to be specified.
--- Can be extended to support ranges of compiler versions.
Modified:
lldb/trunk/test/functionalities/inferior-assert/TestInferiorAssert.py
lldb/trunk/test/lldbtest.py
Modified: lldb/trunk/test/functionalities/inferior-assert/TestInferiorAssert.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/inferior-assert/TestInferiorAssert.py?rev=182155&r1=182154&r2=182155&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/inferior-assert/TestInferiorAssert.py (original)
+++ lldb/trunk/test/functionalities/inferior-assert/TestInferiorAssert.py Fri May 17 15:15:07 2013
@@ -15,7 +15,8 @@ class AssertingInferiorTestCase(TestBase
self.buildDsym()
self.inferior_asserting()
- @expectedFailureLinux # bugzilla 15671 - backtrace does not include the assert site
+ @expectedFailureLinux(15671, ['clang', 'icc']) # llvm.org/pr15671 - backtrace does not include the assert site
+ @expectedFailureGcc(15671, ['>=', '4.6.3']) # avoid an xpass on the buildbots where libc was not built with -fomit-frame-pointer
def test_inferior_asserting_dwarf(self):
"""Test that lldb reliably catches the inferior asserting (command)."""
self.buildDwarf()
@@ -44,7 +45,8 @@ class AssertingInferiorTestCase(TestBase
self.buildDsym()
self.inferior_asserting_expr()
- @expectedFailureLinux # bugzilla 15671 - backtrace does not include the assert site
+ @expectedFailureLinux(15671, ['clang', 'icc']) # llvm.org/pr15671 - backtrace does not include the assert site
+ @expectedFailureGcc(15671, ['>=', '4.6.3']) # avoid an xpass on the buildbots where libc was not built with -fomit-frame-pointer
def test_inferior_asserting_expr(self):
"""Test that the lldb expression interpreter can read from the inferior after asserting (command)."""
self.buildDwarf()
@@ -56,7 +58,8 @@ class AssertingInferiorTestCase(TestBase
self.buildDsym()
self.inferior_asserting_step()
- @expectedFailureLinux # bugzilla 15671 - backtrace does not include the assert site
+ @expectedFailureLinux(15671, ['clang', 'icc']) # llvm.org/pr15671 - backtrace does not include the assert site
+ @expectedFailureGcc(15671, ['>=', '4.6.3']) # avoid an xpass on the buildbots where libc was not built with -fomit-frame-pointer
def test_inferior_asserting_step(self):
"""Test that lldb functions correctly after stepping through a call to assert()."""
self.buildDwarf()
Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=182155&r1=182154&r2=182155&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Fri May 17 15:15:07 2013
@@ -370,7 +370,7 @@ def dwarf_test(func):
wrapper.__dwarf_test__ = True
return wrapper
-def expectedFailureGcc(bugnumber=None):
+def expectedFailureGcc(bugnumber=None, compiler_version=["=", None]):
if callable(bugnumber):
@wraps(bugnumber)
def expectedFailureGcc_easy_wrapper(*args, **kwargs):
@@ -380,7 +380,7 @@ def expectedFailureGcc(bugnumber=None):
try:
bugnumber(*args, **kwargs)
except Exception:
- if "gcc" in test_compiler:
+ if "gcc" in test_compiler and self.expectedVersion(compiler_version):
raise case._ExpectedFailure(sys.exc_info(),None)
else:
raise
@@ -397,7 +397,7 @@ def expectedFailureGcc(bugnumber=None):
try:
func(*args, **kwargs)
except Exception:
- if "gcc" in test_compiler:
+ if "gcc" in test_compiler and self.expectedVersion(compiler_version):
raise case._ExpectedFailure(sys.exc_info(),bugnumber)
else:
raise
@@ -515,7 +515,7 @@ def expectedFailurei386(bugnumber=None):
return wrapper
return expectedFailurei386_impl
-def expectedFailureLinux(bugnumber=None):
+def expectedFailureLinux(bugnumber=None, compilers=None):
if callable(bugnumber):
@wraps(bugnumber)
def expectedFailureLinux_easy_wrapper(*args, **kwargs):
@@ -525,11 +525,11 @@ def expectedFailureLinux(bugnumber=None)
try:
bugnumber(*args, **kwargs)
except Exception:
- if "linux" in platform:
+ if "linux" in platform and self.expectedCompiler(compilers):
raise case._ExpectedFailure(sys.exc_info(),None)
else:
raise
- if "linux" in platform:
+ if "linux" in platform and self.expectedCompiler(compilers):
raise case._UnexpectedSuccess(sys.exc_info(),None)
return expectedFailureLinux_easy_wrapper
else:
@@ -542,11 +542,11 @@ def expectedFailureLinux(bugnumber=None)
try:
func(*args, **kwargs)
except Exception:
- if "linux" in platform:
+ if "linux" in platform and self.expectedCompiler(compilers):
raise case._ExpectedFailure(sys.exc_info(),bugnumber)
else:
raise
- if "linux" in platform:
+ if "linux" in platform and self.expectedCompiler(compilers):
raise case._UnexpectedSuccess(sys.exc_info(),bugnumber)
return wrapper
return expectedFailureLinux_impl
@@ -1151,6 +1151,32 @@ class Base(unittest2.TestCase):
version = m.group(1)
return version
+ def expectedVersion(self, compiler_version):
+ """Determines if compiler_version matches the current tool chain."""
+ if (compiler_version == None):
+ return True
+ operator = str(compiler_version[0])
+ version = compiler_version[1]
+
+ if (version == None):
+ return True
+ if (operator == '>'):
+ return self.getCompilerVersion() > version
+ if (operator == '>=' or operator == '=>'):
+ return self.getCompilerVersion() >= version
+ if (operator == '<'):
+ return self.getCompilerVersion() < version
+ if (operator == '<=' or operator == '=<'):
+ return self.getCompilerVersion() <= version
+ if (operator == '!=' or operator == '!' or operator == 'not'):
+ return str(version) not in str(self.getCompilerVersion())
+ return str(version) in str(self.getCompilerVersion())
+
+ def expectedCompiler(self, compilers):
+ if (compilers == None):
+ return True
+ return self.getCompiler() in compilers
+
def getRunOptions(self):
"""Command line option for -A and -C to run this test again, called from
self.dumpSessionInfo()."""
More information about the lldb-commits
mailing list