Index: test/api/multithreaded/TestMultithreaded.py =================================================================== --- test/api/multithreaded/TestMultithreaded.py +++ test/api/multithreaded/TestMultithreaded.py @@ -33,6 +33,7 @@ @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', @@ -43,6 +44,7 @@ @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. @@ -56,6 +58,7 @@ @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', Index: test/expression_command/test/TestExprs.py =================================================================== --- test/expression_command/test/TestExprs.py +++ test/expression_command/test/TestExprs.py @@ -51,6 +51,7 @@ 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() @@ -92,6 +93,7 @@ # (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() Index: test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py =================================================================== --- test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py +++ test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py @@ -20,6 +20,7 @@ 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() Index: test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py =================================================================== --- test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py +++ test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py @@ -22,7 +22,7 @@ # 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() Index: test/functionalities/inferior-crashing/TestInferiorCrashing.py =================================================================== --- test/functionalities/inferior-crashing/TestInferiorCrashing.py +++ test/functionalities/inferior-crashing/TestInferiorCrashing.py @@ -54,6 +54,7 @@ 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() @@ -78,6 +79,7 @@ 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() Index: test/functionalities/inline-stepping/TestInlineStepping.py =================================================================== --- test/functionalities/inline-stepping/TestInlineStepping.py +++ test/functionalities/inline-stepping/TestInlineStepping.py @@ -22,6 +22,7 @@ @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() @@ -37,6 +38,7 @@ @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() Index: test/functionalities/memory/read/TestMemoryRead.py =================================================================== --- test/functionalities/memory/read/TestMemoryRead.py +++ test/functionalities/memory/read/TestMemoryRead.py @@ -21,6 +21,7 @@ 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() Index: test/lldbtest.py =================================================================== --- test/lldbtest.py +++ test/lldbtest.py @@ -582,6 +582,19 @@ 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): @@ -741,6 +754,37 @@ 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): @@ -1453,6 +1497,17 @@ 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().""" Index: test/tools/lldb-mi/control/TestMiExec.py =================================================================== --- test/tools/lldb-mi/control/TestMiExec.py +++ test/tools/lldb-mi/control/TestMiExec.py @@ -13,6 +13,7 @@ @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.""" @@ -63,6 +64,7 @@ @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.""" @@ -106,6 +108,7 @@ @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.""" @@ -188,6 +191,7 @@ @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.""" @@ -373,6 +377,7 @@ @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."""