mirror of
https://git.yoctoproject.org/poky
synced 2026-04-18 12:32:12 +02:00
oeqa/core/decorator: add decorators to skip based on HOST_ARCH
There are already decorators to skip on the value of MACHINE, but for flexibility it's better to skip based on the target architecture. This means, for example, the ISO image tests could skip if the architecture isn't x86. (From OE-Core rev: 0c21ff0a92906b6b4820eb8beddf8762fe70653d) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
5f0f366d1a
commit
be8de607a9
@@ -194,3 +194,27 @@ class skipIfQemu(OETestDecorator):
|
||||
self.logger.debug("Checking if qemu MACHINE")
|
||||
if self.case.td.get('MACHINE', '').startswith('qemu'):
|
||||
self.case.skipTest('Test only runs on real hardware')
|
||||
|
||||
@registerDecorator
|
||||
class skipIfArch(OETestDecorator):
|
||||
"""
|
||||
Skip test if HOST_ARCH is present in the tuple specified.
|
||||
"""
|
||||
|
||||
attrs = ('archs',)
|
||||
def setUpDecorator(self):
|
||||
arch = self.case.td['HOST_ARCH']
|
||||
if arch in self.archs:
|
||||
self.case.skipTest('Test skipped on %s' % arch)
|
||||
|
||||
@registerDecorator
|
||||
class skipIfNotArch(OETestDecorator):
|
||||
"""
|
||||
Skip test if HOST_ARCH is not present in the tuple specified.
|
||||
"""
|
||||
|
||||
attrs = ('archs',)
|
||||
def setUpDecorator(self):
|
||||
arch = self.case.td['HOST_ARCH']
|
||||
if arch not in self.archs:
|
||||
self.case.skipTest('Test skipped on %s' % arch)
|
||||
|
||||
Reference in New Issue
Block a user