[Lldb-commits] [lldb] r220012 - Making all @expectedFailure markers take an explicit bugnumber annotation. This used to be optional, but that makes it harder to track what tests are failing for what reason. So, make it mandatory, in the form of refusing to run the test suite if annotations are missing

Enrico Granata egranata at apple.com
Thu Oct 16 18:11:29 PDT 2014


Author: enrico
Date: Thu Oct 16 20:11:29 2014
New Revision: 220012

URL: http://llvm.org/viewvc/llvm-project?rev=220012&view=rev
Log:
Making all @expectedFailure markers take an explicit bugnumber annotation. This used to be optional, but that makes it harder to track what tests are failing for what reason. So, make it mandatory, in the form of refusing to run the test suite if annotations are missing

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=220012&r1=220011&r2=220012&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/inferior-assert/TestInferiorAssert.py (original)
+++ lldb/trunk/test/functionalities/inferior-assert/TestInferiorAssert.py Thu Oct 16 20:11:29 2014
@@ -16,7 +16,7 @@ class AssertingInferiorTestCase(TestBase
         self.buildDsym()
         self.inferior_asserting()
 
-    @expectedFailurei386 # llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly'
+    @expectedFailurei386("llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly")
     @expectedFailureDarwin("rdar://15367233")
     def test_inferior_asserting_dwarf(self):
         """Test that lldb reliably catches the inferior asserting (command)."""
@@ -34,9 +34,9 @@ class AssertingInferiorTestCase(TestBase
         self.buildDwarf()
         self.inferior_asserting_registers()
 
-    @expectedFailurei386 # llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly
-    @expectedFailureFreeBSD('llvm.org/pr18533') # PC in __assert frame is outside of function
-    @expectedFailureLinux('') # PC in __GI___assert_fail frame is just after the function (this is a no-return so there is no epilogue afterwards)
+    @expectedFailurei386("llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly")
+    @expectedFailureFreeBSD('llvm.org/pr18533 - PC in __assert frame is outside of function')
+    @expectedFailureLinux("PC in __GI___assert_fail frame is just after the function (this is a no-return so there is no epilogue afterwards)")
     def test_inferior_asserting_disassemble(self):
         """Test that lldb reliably disassembles frames after asserting (command)."""
         self.buildDefault()
@@ -55,7 +55,7 @@ class AssertingInferiorTestCase(TestBase
         self.buildDsym()
         self.inferior_asserting_expr()
 
-    @expectedFailurei386 # llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly
+    @expectedFailurei386('llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly')
     @unittest2.expectedFailure("rdar://15367233")
     def test_inferior_asserting_expr(self):
         """Test that the lldb expression interpreter can read from the inferior after asserting (command)."""
@@ -69,7 +69,7 @@ class AssertingInferiorTestCase(TestBase
         self.buildDsym()
         self.inferior_asserting_step()
 
-    @expectedFailurei386 # llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly
+    @expectedFailurei386("llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly")
     @expectedFailureDarwin("rdar://15367233")
     def test_inferior_asserting_step(self):
         """Test that lldb functions correctly after stepping through a call to assert()."""

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=220012&r1=220011&r2=220012&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Thu Oct 16 20:11:29 2014
@@ -450,51 +450,52 @@ def expectedFailure(expected_fn, bugnumb
             if expected_fn(self):
                 raise case._UnexpectedSuccess(sys.exc_info(), bugnumber)
         return wrapper
-    if callable(bugnumber):
-        return expectedFailure_impl(bugnumber)
-    else:
-        return expectedFailure_impl
+    if bugnumber: 
+        if callable(bugnumber):
+            return expectedFailure_impl(bugnumber)
+        else:
+            return expectedFailure_impl
 
 def expectedFailureCompiler(compiler, compiler_version=None, bugnumber=None):
     if compiler_version is None:
         compiler_version=['=', None]
     def fn(self):
         return compiler in self.getCompiler() and self.expectedCompilerVersion(compiler_version)
-    return expectedFailure(fn, bugnumber)
+    if bugnumber: return expectedFailure(fn, bugnumber)
 
 def expectedFailureClang(bugnumber=None):
-    return expectedFailureCompiler('clang', None, bugnumber)
+    if bugnumber: return expectedFailureCompiler('clang', None, bugnumber)
 
 def expectedFailureGcc(bugnumber=None, compiler_version=None):
-    return expectedFailureCompiler('gcc', compiler_version, bugnumber)
+    if bugnumber: return expectedFailureCompiler('gcc', compiler_version, bugnumber)
 
 def expectedFailureIcc(bugnumber=None):
-    return expectedFailureCompiler('icc', None, bugnumber)
+    if bugnumber: return expectedFailureCompiler('icc', None, bugnumber)
 
 def expectedFailureArch(arch, bugnumber=None):
     def fn(self):
         return arch in self.getArchitecture()
-    return expectedFailure(fn, bugnumber)
+    if bugnumber: return expectedFailure(fn, bugnumber)
 
 def expectedFailurei386(bugnumber=None):
-    return expectedFailureArch('i386', bugnumber)
+    if bugnumber: return expectedFailureArch('i386', bugnumber)
 
 def expectedFailurex86_64(bugnumber=None):
-    return expectedFailureArch('x86_64', bugnumber)
+    if bugnumber: return expectedFailureArch('x86_64', bugnumber)
 
 def expectedFailureOS(os, bugnumber=None, compilers=None):
     def fn(self):
         return os in sys.platform and self.expectedCompiler(compilers)
-    return expectedFailure(fn, bugnumber)
+    if bugnumber: return expectedFailure(fn, bugnumber)
 
 def expectedFailureDarwin(bugnumber=None, compilers=None):
-    return expectedFailureOS('darwin', bugnumber, compilers)
+    if bugnumber: return expectedFailureOS('darwin', bugnumber, compilers)
 
 def expectedFailureFreeBSD(bugnumber=None, compilers=None):
-    return expectedFailureOS('freebsd', bugnumber, compilers)
+    if bugnumber: return expectedFailureOS('freebsd', bugnumber, compilers)
 
 def expectedFailureLinux(bugnumber=None, compilers=None):
-    return expectedFailureOS('linux', bugnumber, compilers)
+    if bugnumber: return expectedFailureOS('linux', bugnumber, compilers)
 
 def skipIfRemote(func):
     """Decorate the item to skip tests if testing remotely."""





More information about the lldb-commits mailing list