mirror of
https://git.yoctoproject.org/poky
synced 2026-04-18 03:32:13 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
077c3bbf2f
commit
34cce61ece
@@ -113,3 +113,21 @@ class skipIfNotFeature(OETestDecorator):
|
||||
self.logger.debug(msg)
|
||||
if not has_feature(self.case.td, self.value):
|
||||
self.case.skipTest(self.msg)
|
||||
|
||||
@registerDecorator
|
||||
class skipIfFeature(OETestDecorator):
|
||||
"""
|
||||
Skip test based on DISTRO_FEATURES.
|
||||
|
||||
value must not be in distro features or it will skip the test
|
||||
with msg as the reason.
|
||||
"""
|
||||
|
||||
attrs = ('value', 'msg')
|
||||
|
||||
def setUpDecorator(self):
|
||||
msg = ('Checking if %s is not in DISTRO_FEATURES '
|
||||
'or IMAGE_FEATURES' % (self.value))
|
||||
self.logger.debug(msg)
|
||||
if has_feature(self.case.td, self.value):
|
||||
self.case.skipTest(self.msg)
|
||||
|
||||
Reference in New Issue
Block a user