diff options
author | André Draszik <git@andred.net> | 2019-10-16 10:18:23 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-10-19 23:18:33 +0100 |
commit | 34cce61ece6ee6f5dd20a4319cfa60416da37f76 (patch) | |
tree | bd9e3534e8d8d3f2de6c0925f437558c7894a631 | |
parent | 077c3bbf2f6997bc1f4677f4d414a7a324360340 (diff) | |
download | poky-34cce61ece6ee6f5dd20a4319cfa60416da37f76.tar.gz |
oeqa/core/decorator: add skipIfFeature
skipIfFeature will skip a test if a given DIST_FEATURE
or IMAGE_FEATURE is enabled.
(From OE-Core rev: ff2218f7cc3992725dd35499c14ec3396120dcc5)
Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/core/decorator/data.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py index babc9789d6..12d462f202 100644 --- a/meta/lib/oeqa/core/decorator/data.py +++ b/meta/lib/oeqa/core/decorator/data.py | |||
@@ -113,3 +113,21 @@ class skipIfNotFeature(OETestDecorator): | |||
113 | self.logger.debug(msg) | 113 | self.logger.debug(msg) |
114 | if not has_feature(self.case.td, self.value): | 114 | if not has_feature(self.case.td, self.value): |
115 | self.case.skipTest(self.msg) | 115 | self.case.skipTest(self.msg) |
116 | |||
117 | @registerDecorator | ||
118 | class skipIfFeature(OETestDecorator): | ||
119 | """ | ||
120 | Skip test based on DISTRO_FEATURES. | ||
121 | |||
122 | value must not be in distro features or it will skip the test | ||
123 | with msg as the reason. | ||
124 | """ | ||
125 | |||
126 | attrs = ('value', 'msg') | ||
127 | |||
128 | def setUpDecorator(self): | ||
129 | msg = ('Checking if %s is not in DISTRO_FEATURES ' | ||
130 | 'or IMAGE_FEATURES' % (self.value)) | ||
131 | self.logger.debug(msg) | ||
132 | if has_feature(self.case.td, self.value): | ||
133 | self.case.skipTest(self.msg) | ||