[Lldb-commits] [PATCH] D15451: Make test categories composable
Todd Fiala via lldb-commits
lldb-commits at lists.llvm.org
Fri Dec 11 10:24:24 PST 2015
tfiala accepted this revision.
tfiala added a comment.
LGTM. I added a few optional comments on possible improvements, but I think they're orthogonal to what you're doing here.
Comment at: packages/Python/lldbsuite/test/lldbtest.py:512
@@ -510,3 +511,3 @@
- """Decorate an item with test categories"""
+ """Add test categories to a test item"""
cat = test_categories.validate(cat, True)
> Can you be more specific about where can we add this decorator? "item" doesn't really tell anything to me
I think we're talking TestCase test method, right?
Comment at: packages/Python/lldbsuite/test/lldbtest.py:518
@@ +517,3 @@
+ if hasattr(func, "categories"):
+ func.categories = cat
This code could potentially accept a single category and drop the need for the list. It could check the type of the input (i.e. the categories input) and, if a single element rather than a list, it could just cat.append() it.
That would enable a single argument passed to @add_test_categories()
Totally minor and you can skip this, it just makes for a nice usability enhancement provided the decorator is documented as such.
More information about the lldb-commits