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.

(From OE-Core rev: c59b74b8bfd3b351a31204f33e00351ad5e5b657)

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Mikko Rapeli 2025-06-03 15:29:38 +03:00 committed by Richard Purdie
parent 8a941848e7
commit deffb5f00a

View File

@ -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)