summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2022-11-09 19:31:22 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-11-11 13:43:40 +0000
commitbe8de607a99152cf29bc2239bd885a4159e62500 (patch)
tree0f2522f807092bdb48e7a22ec044c59c61add9d5
parent5f0f366d1ab49bb37efb8dda3e3c5fc40f235eef (diff)
downloadpoky-be8de607a99152cf29bc2239bd885a4159e62500.tar.gz
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>
-rw-r--r--meta/lib/oeqa/core/decorator/data.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py
index 3ce10e5499..de881e097a 100644
--- a/meta/lib/oeqa/core/decorator/data.py
+++ b/meta/lib/oeqa/core/decorator/data.py
@@ -194,3 +194,27 @@ class skipIfQemu(OETestDecorator):
194 self.logger.debug("Checking if qemu MACHINE") 194 self.logger.debug("Checking if qemu MACHINE")
195 if self.case.td.get('MACHINE', '').startswith('qemu'): 195 if self.case.td.get('MACHINE', '').startswith('qemu'):
196 self.case.skipTest('Test only runs on real hardware') 196 self.case.skipTest('Test only runs on real hardware')
197
198@registerDecorator
199class skipIfArch(OETestDecorator):
200 """
201 Skip test if HOST_ARCH is present in the tuple specified.
202 """
203
204 attrs = ('archs',)
205 def setUpDecorator(self):
206 arch = self.case.td['HOST_ARCH']
207 if arch in self.archs:
208 self.case.skipTest('Test skipped on %s' % arch)
209
210@registerDecorator
211class skipIfNotArch(OETestDecorator):
212 """
213 Skip test if HOST_ARCH is not present in the tuple specified.
214 """
215
216 attrs = ('archs',)
217 def setUpDecorator(self):
218 arch = self.case.td['HOST_ARCH']
219 if arch not in self.archs:
220 self.case.skipTest('Test skipped on %s' % arch)