]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa decorator/data.py: add skipIfNotBuildArch decorator
authorMikko Rapeli <mikko.rapeli@linaro.org>
Tue, 3 Jun 2025 12:29:38 +0000 (15:29 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 5 Jun 2025 10:01:24 +0000 (11:01 +0100)
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 <mikko.rapeli@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/core/decorator/data.py

index 5444b2cb751836a7baa4ed4a53d629b007464c77..0daf46334f623dc3b83c65c1b9ee28d015f64178 100644 (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)