[oe-commits] [openembedded-core] 13/20: oeqa/core/decorator: add skipIfFeature

git at git.openembedded.org git at git.openembedded.org
Sat Oct 19 17:14:14 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit ff2218f7cc3992725dd35499c14ec3396120dcc5
Author: André Draszik <git at andred.net>
AuthorDate: Wed Oct 16 10:18:23 2019 +0100

    oeqa/core/decorator: add skipIfFeature
    
    skipIfFeature will skip a test if a given DIST_FEATURE
    or IMAGE_FEATURE is enabled.
    
    Signed-off-by: André Draszik <git at andred.net>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oeqa/core/decorator/data.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py
index babc978..12d462f 100644
--- a/meta/lib/oeqa/core/decorator/data.py
+++ b/meta/lib/oeqa/core/decorator/data.py
@@ -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)
+
+ at 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)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list