forked from OSchip/llvm-project
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. llvm-svn: 182155
This commit is contained in:
parent
a360d7e7a3
commit
c97a6083e2
|
@ -15,7 +15,8 @@ class AssertingInferiorTestCase(TestBase):
|
||||||
self.buildDsym()
|
self.buildDsym()
|
||||||
self.inferior_asserting()
|
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):
|
def test_inferior_asserting_dwarf(self):
|
||||||
"""Test that lldb reliably catches the inferior asserting (command)."""
|
"""Test that lldb reliably catches the inferior asserting (command)."""
|
||||||
self.buildDwarf()
|
self.buildDwarf()
|
||||||
|
@ -44,7 +45,8 @@ class AssertingInferiorTestCase(TestBase):
|
||||||
self.buildDsym()
|
self.buildDsym()
|
||||||
self.inferior_asserting_expr()
|
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):
|
def test_inferior_asserting_expr(self):
|
||||||
"""Test that the lldb expression interpreter can read from the inferior after asserting (command)."""
|
"""Test that the lldb expression interpreter can read from the inferior after asserting (command)."""
|
||||||
self.buildDwarf()
|
self.buildDwarf()
|
||||||
|
@ -56,7 +58,8 @@ class AssertingInferiorTestCase(TestBase):
|
||||||
self.buildDsym()
|
self.buildDsym()
|
||||||
self.inferior_asserting_step()
|
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):
|
def test_inferior_asserting_step(self):
|
||||||
"""Test that lldb functions correctly after stepping through a call to assert()."""
|
"""Test that lldb functions correctly after stepping through a call to assert()."""
|
||||||
self.buildDwarf()
|
self.buildDwarf()
|
||||||
|
|
|
@ -370,7 +370,7 @@ def dwarf_test(func):
|
||||||
wrapper.__dwarf_test__ = True
|
wrapper.__dwarf_test__ = True
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
def expectedFailureGcc(bugnumber=None):
|
def expectedFailureGcc(bugnumber=None, compiler_version=["=", None]):
|
||||||
if callable(bugnumber):
|
if callable(bugnumber):
|
||||||
@wraps(bugnumber)
|
@wraps(bugnumber)
|
||||||
def expectedFailureGcc_easy_wrapper(*args, **kwargs):
|
def expectedFailureGcc_easy_wrapper(*args, **kwargs):
|
||||||
|
@ -380,7 +380,7 @@ def expectedFailureGcc(bugnumber=None):
|
||||||
try:
|
try:
|
||||||
bugnumber(*args, **kwargs)
|
bugnumber(*args, **kwargs)
|
||||||
except Exception:
|
except Exception:
|
||||||
if "gcc" in test_compiler:
|
if "gcc" in test_compiler and self.expectedVersion(compiler_version):
|
||||||
raise case._ExpectedFailure(sys.exc_info(),None)
|
raise case._ExpectedFailure(sys.exc_info(),None)
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
@ -397,7 +397,7 @@ def expectedFailureGcc(bugnumber=None):
|
||||||
try:
|
try:
|
||||||
func(*args, **kwargs)
|
func(*args, **kwargs)
|
||||||
except Exception:
|
except Exception:
|
||||||
if "gcc" in test_compiler:
|
if "gcc" in test_compiler and self.expectedVersion(compiler_version):
|
||||||
raise case._ExpectedFailure(sys.exc_info(),bugnumber)
|
raise case._ExpectedFailure(sys.exc_info(),bugnumber)
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
@ -515,7 +515,7 @@ def expectedFailurei386(bugnumber=None):
|
||||||
return wrapper
|
return wrapper
|
||||||
return expectedFailurei386_impl
|
return expectedFailurei386_impl
|
||||||
|
|
||||||
def expectedFailureLinux(bugnumber=None):
|
def expectedFailureLinux(bugnumber=None, compilers=None):
|
||||||
if callable(bugnumber):
|
if callable(bugnumber):
|
||||||
@wraps(bugnumber)
|
@wraps(bugnumber)
|
||||||
def expectedFailureLinux_easy_wrapper(*args, **kwargs):
|
def expectedFailureLinux_easy_wrapper(*args, **kwargs):
|
||||||
|
@ -525,11 +525,11 @@ def expectedFailureLinux(bugnumber=None):
|
||||||
try:
|
try:
|
||||||
bugnumber(*args, **kwargs)
|
bugnumber(*args, **kwargs)
|
||||||
except Exception:
|
except Exception:
|
||||||
if "linux" in platform:
|
if "linux" in platform and self.expectedCompiler(compilers):
|
||||||
raise case._ExpectedFailure(sys.exc_info(),None)
|
raise case._ExpectedFailure(sys.exc_info(),None)
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
if "linux" in platform:
|
if "linux" in platform and self.expectedCompiler(compilers):
|
||||||
raise case._UnexpectedSuccess(sys.exc_info(),None)
|
raise case._UnexpectedSuccess(sys.exc_info(),None)
|
||||||
return expectedFailureLinux_easy_wrapper
|
return expectedFailureLinux_easy_wrapper
|
||||||
else:
|
else:
|
||||||
|
@ -542,11 +542,11 @@ def expectedFailureLinux(bugnumber=None):
|
||||||
try:
|
try:
|
||||||
func(*args, **kwargs)
|
func(*args, **kwargs)
|
||||||
except Exception:
|
except Exception:
|
||||||
if "linux" in platform:
|
if "linux" in platform and self.expectedCompiler(compilers):
|
||||||
raise case._ExpectedFailure(sys.exc_info(),bugnumber)
|
raise case._ExpectedFailure(sys.exc_info(),bugnumber)
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
if "linux" in platform:
|
if "linux" in platform and self.expectedCompiler(compilers):
|
||||||
raise case._UnexpectedSuccess(sys.exc_info(),bugnumber)
|
raise case._UnexpectedSuccess(sys.exc_info(),bugnumber)
|
||||||
return wrapper
|
return wrapper
|
||||||
return expectedFailureLinux_impl
|
return expectedFailureLinux_impl
|
||||||
|
@ -1151,6 +1151,32 @@ class Base(unittest2.TestCase):
|
||||||
version = m.group(1)
|
version = m.group(1)
|
||||||
return version
|
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):
|
def getRunOptions(self):
|
||||||
"""Command line option for -A and -C to run this test again, called from
|
"""Command line option for -A and -C to run this test again, called from
|
||||||
self.dumpSessionInfo()."""
|
self.dumpSessionInfo()."""
|
||||||
|
|
Loading…
Reference in New Issue