From: Mikko Rapeli Date: Tue, 3 Jun 2025 12:29:38 +0000 (+0300) Subject: oeqa decorator/data.py: add skipIfNotBuildArch decorator X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c59b74b8bfd3b351a31204f33e00351ad5e5b657;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git oeqa decorator/data.py: add skipIfNotBuildArch decorator To limit tests to specific build host architectures. For example KVM testing will only work if target and build architectures are the same. Signed-off-by: Mikko Rapeli Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py index 5444b2cb751..0daf46334f6 100644 --- a/meta/lib/oeqa/core/decorator/data.py +++ b/meta/lib/oeqa/core/decorator/data.py @@ -228,3 +228,15 @@ class skipIfNotArch(OETestDecorator): arch = self.case.td['HOST_ARCH'] if arch not in self.archs: self.case.skipTest('Test skipped on %s' % arch) + +@registerDecorator +class skipIfNotBuildArch(OETestDecorator): + """ + Skip test if BUILD_ARCH is not present in the tuple specified. + """ + + attrs = ('archs',) + def setUpDecorator(self): + arch = self.case.td['BUILD_ARCH'] + if arch not in self.archs: + self.case.skipTest('Test skipped on %s' % arch)