summaryrefslogtreecommitdiffstats
path: root/external/poky/meta/lib/oeqa/core/decorator/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'external/poky/meta/lib/oeqa/core/decorator/__init__.py')
-rw-r--r--external/poky/meta/lib/oeqa/core/decorator/__init__.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/external/poky/meta/lib/oeqa/core/decorator/__init__.py b/external/poky/meta/lib/oeqa/core/decorator/__init__.py
index 14d7bfcd..1a82518a 100644
--- a/external/poky/meta/lib/oeqa/core/decorator/__init__.py
+++ b/external/poky/meta/lib/oeqa/core/decorator/__init__.py
@@ -1,8 +1,12 @@
+#
# Copyright (C) 2016 Intel Corporation
-# Released under the MIT license (see COPYING.MIT)
+#
+# SPDX-License-Identifier: MIT
+#
from functools import wraps
from abc import abstractmethod, ABCMeta
+from oeqa.core.utils.misc import strToList
decoratorClasses = set()
@@ -60,12 +64,16 @@ class OETestDiscover(OETestDecorator):
def discover(registry):
return registry['cases']
-class OETestFilter(OETestDecorator):
+def OETestTag(*tags):
+ expandedtags = []
+ for tag in tags:
+ expandedtags += strToList(tag)
+ def decorator(item):
+ if hasattr(item, "__oeqa_testtags"):
+ # do not append, create a new list (to handle classes with inheritance)
+ item.__oeqa_testtags = list(item.__oeqa_testtags) + expandedtags
+ else:
+ item.__oeqa_testtags = expandedtags
+ return item
+ return decorator
- # OETestLoader call it while loading the tests
- # in loadTestsFromTestCase method, it needs to
- # return a bool, True if needs to be filtered.
- # This method must consume the filter used.
- @abstractmethod
- def filtrate(self, filters):
- return False