[Lldb-commits] [lldb] 57da8f7 - Add support for XFAILing a test based on a setting.

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 12 19:26:53 PDT 2020


Author: Adrian Prantl
Date: 2020-03-12T19:26:24-07:00
New Revision: 57da8f720ce18100c5c6fb5c2247109e1ef963b5

URL: https://github.com/llvm/llvm-project/commit/57da8f720ce18100c5c6fb5c2247109e1ef963b5
DIFF: https://github.com/llvm/llvm-project/commit/57da8f720ce18100c5c6fb5c2247109e1ef963b5.diff

LOG: Add support for XFAILing a test based on a setting.

This is analogous to the skipping mechanism introduced in
https://reviews.llvm.org/D75864

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/decorators.py
    lldb/test/API/sanity/TestSettingSkipping.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py
index d2241833f494..cc28ae901634 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -258,7 +258,8 @@ def expectedFailureAll(bugnumber=None,
                        debug_info=None,
                        swig_version=None, py_version=None,
                        macos_version=None,
-                       remote=None, dwarf_version=None):
+                       remote=None, dwarf_version=None,
+                       setting=None):
     return _decorateTest(DecorateMode.Xfail,
                          bugnumber=bugnumber,
                          oslist=oslist, hostoslist=hostoslist,
@@ -267,7 +268,8 @@ def expectedFailureAll(bugnumber=None,
                          debug_info=debug_info,
                          swig_version=swig_version, py_version=py_version,
                          macos_version=None,
-                         remote=remote,dwarf_version=dwarf_version)
+                         remote=remote,dwarf_version=dwarf_version,
+                         setting=setting)
 
 
 # provide a function to skip on defined oslist, compiler version, and archs

diff  --git a/lldb/test/API/sanity/TestSettingSkipping.py b/lldb/test/API/sanity/TestSettingSkipping.py
index 10e7144a0068..206c7b4ecd73 100644
--- a/lldb/test/API/sanity/TestSettingSkipping.py
+++ b/lldb/test/API/sanity/TestSettingSkipping.py
@@ -27,3 +27,11 @@ def testNoMatch(self):
   def testNotExisting(self):
     self.assertTrue(True, "This test should run!")
 
+  @expectedFailureAll(setting=('target.prefer-dynamic-value', 'no-dynamic-values'))
+  def testXFAIL(self):
+    self.assertTrue(False, "This test should run and fail!")
+
+  @expectedFailureAll(setting=('target.prefer-dynamic-value', 'run-target'))
+  def testNotXFAIL(self):
+    self.assertTrue(True, "This test should run and succeed!")
+


        


More information about the lldb-commits mailing list