diff options
Diffstat (limited to 'meta/lib/oeqa/core/decorator/__init__.py')
-rw-r--r-- | meta/lib/oeqa/core/decorator/__init__.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/meta/lib/oeqa/core/decorator/__init__.py b/meta/lib/oeqa/core/decorator/__init__.py index 923b218266..1a5ac40134 100644 --- a/meta/lib/oeqa/core/decorator/__init__.py +++ b/meta/lib/oeqa/core/decorator/__init__.py | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | from functools import wraps | 7 | from functools import wraps |
8 | from abc import abstractmethod, ABCMeta | 8 | from abc import abstractmethod, ABCMeta |
9 | from oeqa.core.utils.misc import strToList | ||
9 | 10 | ||
10 | decoratorClasses = set() | 11 | decoratorClasses = set() |
11 | 12 | ||
@@ -63,12 +64,15 @@ class OETestDiscover(OETestDecorator): | |||
63 | def discover(registry): | 64 | def discover(registry): |
64 | return registry['cases'] | 65 | return registry['cases'] |
65 | 66 | ||
66 | class OETestFilter(OETestDecorator): | 67 | def OETestTag(*tags): |
68 | expandedtags = [] | ||
69 | for tag in tags: | ||
70 | expandedtags += strToList(tag) | ||
71 | def decorator(item): | ||
72 | if hasattr(item, "__oeqa_testtags"): | ||
73 | item.__oeqa_testtags += expandedtags | ||
74 | else: | ||
75 | item.__oeqa_testtags = expandedtags | ||
76 | return item | ||
77 | return decorator | ||
67 | 78 | ||
68 | # OETestLoader call it while loading the tests | ||
69 | # in loadTestsFromTestCase method, it needs to | ||
70 | # return a bool, True if needs to be filtered. | ||
71 | # This method must consume the filter used. | ||
72 | @abstractmethod | ||
73 | def filtrate(self, filters): | ||
74 | return False | ||