diff options
author | Nathan Rossi <nathan@nathanrossi.com> | 2019-09-03 16:56:41 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-09-07 21:56:43 +0100 |
commit | c3625e141dfbb6c8b8bfa3ff05e0e87f215bf606 (patch) | |
tree | 5c2e6dbfea3d050d7929234c4a880e923795a066 /meta/lib/oeqa/core/decorator/oetag.py | |
parent | 1220faf6659e404f6aa2c3155eb8840ac361c2b2 (diff) | |
download | poky-c3625e141dfbb6c8b8bfa3ff05e0e87f215bf606.tar.gz |
oeqa/core: Rework OETestTag and remove unused OETestFilter
Rework OETestTag so that it does not rely on the existing decorator code
base and instead inserts the tags into an attribute on the decorated
target (e.g. class/type or method). This allows the use of OETestTag on
classes and method.
In order to filter tagged tests rework the loaders filtering code,
removing the generic-ness (with validation and attributes/etc.) and
replace it with a "tags_filter" parameter which is a function that
filters a test based on the tags it has. This allows the loader user to
filter on tags in more specific ways (e.g. include all untagged tests
and any tests tagged with foo). Plumb all this through the context code
and testing code.
Update the associated tests to pass correctly with the changes.
(From OE-Core rev: b8a4a4c2de68110d74607cb9807c9e741ca9441c)
Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/core/decorator/oetag.py')
-rw-r--r-- | meta/lib/oeqa/core/decorator/oetag.py | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/meta/lib/oeqa/core/decorator/oetag.py b/meta/lib/oeqa/core/decorator/oetag.py deleted file mode 100644 index 8c31138dac..0000000000 --- a/meta/lib/oeqa/core/decorator/oetag.py +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | # | ||
2 | # Copyright (C) 2016 Intel Corporation | ||
3 | # | ||
4 | # SPDX-License-Identifier: MIT | ||
5 | # | ||
6 | |||
7 | from . import OETestFilter, registerDecorator | ||
8 | from oeqa.core.utils.misc import strToList | ||
9 | |||
10 | def _tagFilter(tags, filters): | ||
11 | return False if set(tags) & set(filters) else True | ||
12 | |||
13 | @registerDecorator | ||
14 | class OETestTag(OETestFilter): | ||
15 | attrs = ('oetag',) | ||
16 | |||
17 | def bind(self, registry, case): | ||
18 | super(OETestTag, self).bind(registry, case) | ||
19 | self.oetag = strToList(self.oetag, 'oetag') | ||
20 | |||
21 | def filtrate(self, filters): | ||
22 | if filters.get('oetag'): | ||
23 | filterx = strToList(filters['oetag'], 'oetag') | ||
24 | del filters['oetag'] | ||
25 | if _tagFilter(self.oetag, filterx): | ||
26 | return True | ||
27 | return False | ||