diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py --- a/lldb/packages/Python/lldbsuite/test/decorators.py +++ b/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, diff --git a/lldb/test/API/test_utils/TestDecorators.py b/lldb/test/API/test_utils/TestDecorators.py new file mode 100644 --- /dev/null +++ b/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