diff options
author | Ross Burton <ross.burton@arm.com> | 2025-07-09 11:24:45 +0800 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2025-07-18 08:32:26 -0700 |
commit | 0a3f902542af91479fc15b6d4eeae18fbe4b9e80 (patch) | |
tree | f12a5ab3ed0d98eea1325fe8e95ea669110674d6 | |
parent | 9b3bd34826f0fe3d532e16881cc026b04c67bd3b (diff) | |
download | poky-0a3f902542af91479fc15b6d4eeae18fbe4b9e80.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: a8381f4b7d7c294d9ad8a9d3f0b1f7c409753716)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 0c21ff0a92906b6b4820eb8beddf8762fe70653d)
Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r-- | meta/lib/oeqa/core/decorator/data.py | 24 |
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 | ||
199 | class 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 | ||
211 | class 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) | ||