[Lldb-commits] [lldb] r235368 - XFAIL tests that are failed on linux with gcc-4.9.2

Ying Chen chying at google.com
Mon Apr 20 18:15:48 PDT 2015


Author: chying
Date: Mon Apr 20 20:15:47 2015
New Revision: 235368

URL: http://llvm.org/viewvc/llvm-project?rev=235368&view=rev
Log:
XFAIL tests that are failed on linux with gcc-4.9.2

Summary:
- add decorator functions to xfail and skip test on specific os, architecture and version of comipler
- xfail failing test with gcc-4.9.2 on linux
- add one usage of skipIf function

Test Plan:
Run tests with different archs, and version of compilers to verify decorator function working as expected
Run tests with gcc-4.9.2 and no failure reported

Reviewers: sivachandra, ovyalov, vharron, chaoren

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8851

Modified:
    lldb/trunk/test/api/multithreaded/TestMultithreaded.py
    lldb/trunk/test/expression_command/test/TestExprs.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
    lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
    lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py
    lldb/trunk/test/functionalities/inline-stepping/TestInlineStepping.py
    lldb/trunk/test/functionalities/memory/read/TestMemoryRead.py
    lldb/trunk/test/lldbtest.py
    lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py

Modified: lldb/trunk/test/api/multithreaded/TestMultithreaded.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/api/multithreaded/TestMultithreaded.py?rev=235368&r1=235367&r2=235368&view=diff
==============================================================================
--- lldb/trunk/test/api/multithreaded/TestMultithreaded.py (original)
+++ lldb/trunk/test/api/multithreaded/TestMultithreaded.py Mon Apr 20 20:15:47 2015
@@ -33,6 +33,7 @@ class SBBreakpointCallbackCase(TestBase)
     @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 @@ class SBBreakpointCallbackCase(TestBase)
     @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 @@ class SBBreakpointCallbackCase(TestBase)
     @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',

Modified: lldb/trunk/test/expression_command/test/TestExprs.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/test/TestExprs.py?rev=235368&r1=235367&r2=235368&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/test/TestExprs.py (original)
+++ lldb/trunk/test/expression_command/test/TestExprs.py Mon Apr 20 20:15:47 2015
@@ -51,6 +51,7 @@ class BasicExprCommandsTestCase(TestBase
             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 @@ class BasicExprCommandsTestCase(TestBase
         # (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()

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py?rev=235368&r1=235367&r2=235368&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py Mon Apr 20 20:15:47 2015
@@ -20,6 +20,7 @@ class SynthDataFormatterTestCase(TestBas
         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()

Modified: lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py?rev=235368&r1=235367&r2=235368&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py Mon Apr 20 20:15:47 2015
@@ -22,7 +22,7 @@ class VectorTypesFormattingTestCase(Test
 
     # 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()

Modified: lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py?rev=235368&r1=235367&r2=235368&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py (original)
+++ lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py Mon Apr 20 20:15:47 2015
@@ -54,6 +54,7 @@ class CrashingInferiorTestCase(TestBase)
         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 @@ class CrashingInferiorTestCase(TestBase)
         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()

Modified: lldb/trunk/test/functionalities/inline-stepping/TestInlineStepping.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/inline-stepping/TestInlineStepping.py?rev=235368&r1=235367&r2=235368&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/inline-stepping/TestInlineStepping.py (original)
+++ lldb/trunk/test/functionalities/inline-stepping/TestInlineStepping.py Mon Apr 20 20:15:47 2015
@@ -22,6 +22,7 @@ class TestInlineStepping(TestBase):
     @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 @@ class TestInlineStepping(TestBase):
 
     @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()

Modified: lldb/trunk/test/functionalities/memory/read/TestMemoryRead.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/memory/read/TestMemoryRead.py?rev=235368&r1=235367&r2=235368&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/memory/read/TestMemoryRead.py (original)
+++ lldb/trunk/test/functionalities/memory/read/TestMemoryRead.py Mon Apr 20 20:15:47 2015
@@ -21,6 +21,7 @@ class MemoryReadTestCase(TestBase):
         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()

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=235368&r1=235367&r2=235368&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Mon Apr 20 20:15:47 2015
@@ -582,6 +582,19 @@ def expectedFailureCompiler(compiler, co
         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 @@ def skipIfLinuxClang(func):
             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):
@@ -1452,6 +1496,17 @@ class Base(unittest2.TestCase):
                 return True
 
         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

Modified: lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py?rev=235368&r1=235367&r2=235368&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py (original)
+++ lldb/trunk/test/tools/lldb-mi/control/TestMiExec.py Mon Apr 20 20:15:47 2015
@@ -13,6 +13,7 @@ class MiExecTestCase(lldbmi_testcase.MiT
     @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 @@ class MiExecTestCase(lldbmi_testcase.MiT
     @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 @@ class MiExecTestCase(lldbmi_testcase.MiT
     @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 @@ class MiExecTestCase(lldbmi_testcase.MiT
     @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 @@ class MiExecTestCase(lldbmi_testcase.MiT
     @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."""
 





More information about the lldb-commits mailing list