@skipIfRemote
@skipIfLinuxClang # buildbot clang version unable to use libstdc++ with c++11
@skipIfNoSBHeaders
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"])
def test_sb_api_listener_event_description(self):
""" Test the description of an SBListener breakpoint event is valid."""
self.build_and_test('driver.cpp listener_test.cpp test_listener_event_description.cpp',
@skipIfRemote
@skipIfLinuxClang # buildbot clang version unable to use libstdc++ with c++11
@skipIfNoSBHeaders
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"])
def test_sb_api_listener_event_process_state(self):
""" Test that a registered SBListener receives events when a process
changes state.
@skipIfRemote
@skipIfLinuxClang # buildbot clang version unable to use libstdc++ with c++11
@skipIfNoSBHeaders
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"])
def test_sb_api_listener_resume(self):
""" Test that a process can be resumed from a non-main thread. """
self.build_and_test('driver.cpp listener_test.cpp test_listener_resume.cpp',
patterns = ["\(float\) \$.* = 2\.234"])
# (float) $2 = 2.234
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"])
def test_many_expr_commands(self):
self.build_and_run()
# (const char *) $8 = 0x... "/Volumes/data/lldb/svn/trunk/test/expression_command/test/a.out"
@python_api_test
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"])
def test_evaluate_expression_python(self):
"""Test SBFrame.EvaluateExpression() API for evaluating an expression."""
self.buildDefault()
self.data_formatter_commands()
@dwarf_test
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64","i386"])
def test_with_dwarf_and_run_command(self):
"""Test data formatter commands."""
self.buildDwarf()
# rdar://problem/14035604
@dwarf_test
- @skipIfGcc # gcc don't have ext_vector_type extension
+ @skipIf(compiler='gcc') # gcc don't have ext_vector_type extension
def test_with_dwarf_and_run_command(self):
"""Check that vector types format properly"""
self.buildDwarf()
self.buildDsym()
self.inferior_crashing_step()
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"])
def test_inferior_crashing_step_dwarf(self):
"""Test that stepping after a crash behaves correctly."""
self.buildDwarf()
self.inferior_crashing_expr_step_expr()
@expectedFailureFreeBSD('llvm.org/pr15989') # Couldn't allocate space for the stack frame
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"])
def test_inferior_crashing_expr_step_and_expr_dwarf(self):
"""Test that lldb expressions work before and after stepping after a crash."""
self.buildDwarf()
@dwarf_test
@expectedFailureFreeBSD('llvm.org/pr17214')
@expectedFailureIcc # Not really a bug. ICC combines two inlined functions.
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"])
def test_with_dwarf_and_python_api(self):
"""Test stepping over and into inlined functions."""
self.buildDwarf()
@python_api_test
@dwarf_test
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"])
def test_step_over_with_dwarf_and_python_api(self):
"""Test stepping over and into inlined functions."""
self.buildDwarf()
self.memory_read_command()
@dwarf_test
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"])
def test_memory_read_with_dwarf(self):
"""Test the 'memory read' command with plain and vector formats."""
self.buildDwarf()
return compiler in self.getCompiler() and self.expectedCompilerVersion(compiler_version)
return expectedFailure(fn, bugnumber)
+# provide a function to xfail on defined oslist, compiler version, and archs
+# if none is specified for any argument, that argument won't be checked and thus means for all
+# for example,
+# @expectedFailureAll, xfail for all platform/compiler/arch,
+# @expectedFailureAll(compiler='gcc'), xfail for gcc on all platform/architecture
+# @expectedFailureAll(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), xfail for gcc>=4.9 on linux with i386
+def expectedFailureAll(bugnumber=None, oslist=None, compiler=None, compiler_version=None, archs=None):
+ def fn(self):
+ return ((oslist is None or self.getPlatform() in oslist) and
+ (compiler is None or (compiler in self.getCompiler() and self.expectedCompilerVersion(compiler_version))) and
+ self.expectedArch(archs))
+ return expectedFailure(fn, bugnumber)
+
# to XFAIL a specific clang versions, try this
# @expectedFailureClang('bugnumber', ['<=', '3.4'])
def expectedFailureClang(bugnumber=None, compiler_version=None):
func(*args, **kwargs)
return wrapper
+# provide a function to skip on defined oslist, compiler version, and archs
+# if none is specified for any argument, that argument won't be checked and thus means for all
+# for example,
+# @skipIf, skip for all platform/compiler/arch,
+# @skipIf(compiler='gcc'), skip for gcc on all platform/architecture
+# @skipIf(bugnumber, ["linux"], "gcc", ['>=', '4.9'], ['i386']), skip for gcc>=4.9 on linux with i386
+
+# TODO: refactor current code, to make skipIfxxx functions to call this function
+def skipIf(bugnumber=None, oslist=None, compiler=None, compiler_version=None, archs=None):
+ def fn(self):
+ return ((oslist is None or self.getPlatform() in oslist) and
+ (compiler is None or (compiler in self.getCompiler() and self.expectedCompilerVersion(compiler_version))) and
+ self.expectedArch(archs))
+ return skipTestIfFn(fn, bugnumber, skipReason="skipping because os:%s compiler: %s %s arch: %s"%(oslist, compiler, compiler_version, archs))
+
+def skipTestIfFn(expected_fn, bugnumber=None, skipReason=None):
+ def skipTestIfFn_impl(func):
+ @wraps(func)
+ def wrapper(*args, **kwargs):
+ from unittest2 import case
+ self = args[0]
+ if expected_fn(self):
+ self.skipTest(skipReason)
+ else:
+ func(*args, **kwargs)
+ return wrapper
+ if callable(bugnumber):
+ return skipTestIfFn_impl(bugnumber)
+ else:
+ return skipTestIfFn_impl
+
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):
return False
+ def expectedArch(self, archs):
+ """Returns True iff any element of archs is a sub-string of the current architecture."""
+ if (archs == None):
+ return True
+
+ for arch in archs:
+ if arch in self.getArchitecture():
+ return True
+
+ return False
+
def getRunOptions(self):
"""Command line option for -A and -C to run this test again, called from
self.dumpSessionInfo()."""
@lldbmi_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"])
def test_lldbmi_exec_abort(self):
"""Test that 'lldb-mi --interpreter' works for -exec-abort."""
@lldbmi_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"])
def test_lldbmi_exec_arguments_set(self):
"""Test that 'lldb-mi --interpreter' can pass args using -exec-arguments."""
@lldbmi_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"])
def test_lldbmi_exec_arguments_reset(self):
"""Test that 'lldb-mi --interpreter' can reset previously set args using -exec-arguments."""
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@expectedFailurei386 #xfail to get buildbot green, failing config: i386 binary running on ubuntu 14.04 x86_64
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"])
def test_lldbmi_exec_next_instruction(self):
"""Test that 'lldb-mi --interpreter' works for instruction stepping."""
@lldbmi_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+ @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"])
def test_lldbmi_exec_finish(self):
"""Test that 'lldb-mi --interpreter' works for -exec-finish."""