summaryrefslogtreecommitdiffstats
path: root/poky/meta/lib/oeqa/core/decorator/oetag.py
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/lib/oeqa/core/decorator/oetag.py')
-rw-r--r--poky/meta/lib/oeqa/core/decorator/oetag.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/poky/meta/lib/oeqa/core/decorator/oetag.py b/poky/meta/lib/oeqa/core/decorator/oetag.py
new file mode 100644
index 000000000..ad38ab78a
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/decorator/oetag.py
@@ -0,0 +1,24 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from . import OETestFilter, registerDecorator
+from oeqa.core.utils.misc import strToList
+
+def _tagFilter(tags, filters):
+ return False if set(tags) & set(filters) else True
+
+@registerDecorator
+class OETestTag(OETestFilter):
+ attrs = ('oetag',)
+
+ def bind(self, registry, case):
+ super(OETestTag, self).bind(registry, case)
+ self.oetag = strToList(self.oetag, 'oetag')
+
+ def filtrate(self, filters):
+ if filters.get('oetag'):
+ filterx = strToList(filters['oetag'], 'oetag')
+ del filters['oetag']
+ if _tagFilter(self.oetag, filterx):
+ return True
+ return False
OpenPOWER on IntegriCloud