This revision was automatically updated to reflect the committed changes.
Closed by commit rG343f3de559c6: [lldb] Fix a bug in the decorator matching 
logic. (authored by JDevlieghere).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D123401?vs=421548&id=422673#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123401/new/

https://reviews.llvm.org/D123401

Files:
  lldb/packages/Python/lldbsuite/test/decorators.py
  lldb/test/API/test_utils/TestDecorators.py


Index: lldb/test/API/test_utils/TestDecorators.py
===================================================================
--- /dev/null
+++ lldb/test/API/test_utils/TestDecorators.py
@@ -0,0 +1,13 @@
+from lldbsuite.test.lldbtest import Base
+from lldbsuite.test.decorators import *
+
+
+class TestDecorators(Base):
+
+    mydir = Base.compute_mydir(__file__)
+    NO_DEBUG_INFO_TESTCASE = True
+
+    @expectedFailureAll(debug_info="dwarf")
+    def test_decorator_skip_no_debug_info(self):
+        """Test that specifying a debug info category works for a 
NO_DEBUG_INFO_TESTCASE"""
+        pass
Index: lldb/packages/Python/lldbsuite/test/decorators.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -73,18 +73,23 @@
 
 _re_pattern_type = type(re.compile(''))
 def _match_decorator_property(expected, actual):
-    if actual is None or expected is None:
+    if expected is None:
         return True
 
+    if actual is None :
+        return False
+
     if isinstance(expected, no_match):
         return not _match_decorator_property(expected.item, actual)
-    elif isinstance(expected, (_re_pattern_type,) + six.string_types):
+
+    if isinstance(expected, (_re_pattern_type,) + six.string_types):
         return re.search(expected, actual) is not None
-    elif hasattr(expected, "__iter__"):
+
+    if hasattr(expected, "__iter__"):
         return any([x is not None and _match_decorator_property(x, actual)
                     for x in expected])
-    else:
-        return expected == actual
+
+    return expected == actual
 
 
 def _compiler_supports(compiler,


Index: lldb/test/API/test_utils/TestDecorators.py
===================================================================
--- /dev/null
+++ lldb/test/API/test_utils/TestDecorators.py
@@ -0,0 +1,13 @@
+from lldbsuite.test.lldbtest import Base
+from lldbsuite.test.decorators import *
+
+
+class TestDecorators(Base):
+
+    mydir = Base.compute_mydir(__file__)
+    NO_DEBUG_INFO_TESTCASE = True
+
+    @expectedFailureAll(debug_info="dwarf")
+    def test_decorator_skip_no_debug_info(self):
+        """Test that specifying a debug info category works for a NO_DEBUG_INFO_TESTCASE"""
+        pass
Index: lldb/packages/Python/lldbsuite/test/decorators.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -73,18 +73,23 @@
 
 _re_pattern_type = type(re.compile(''))
 def _match_decorator_property(expected, actual):
-    if actual is None or expected is None:
+    if expected is None:
         return True
 
+    if actual is None :
+        return False
+
     if isinstance(expected, no_match):
         return not _match_decorator_property(expected.item, actual)
-    elif isinstance(expected, (_re_pattern_type,) + six.string_types):
+
+    if isinstance(expected, (_re_pattern_type,) + six.string_types):
         return re.search(expected, actual) is not None
-    elif hasattr(expected, "__iter__"):
+
+    if hasattr(expected, "__iter__"):
         return any([x is not None and _match_decorator_property(x, actual)
                     for x in expected])
-    else:
-        return expected == actual
+
+    return expected == actual
 
 
 def _compiler_supports(compiler,
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to