]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/sdk: use ensure_*_package helpers
authorRoss Burton <ross.burton@arm.com>
Sat, 10 May 2025 08:43:42 +0000 (09:43 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 12 May 2025 09:52:52 +0000 (10:52 +0100)
Clean up lots of dependency checking code by using the new helpers.

This means that a lot of tests that were previously skipped inside the
eSDK testing on the autobuilder are now executed, and fail.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/sdk/cases/cmake.py
meta/lib/oeqa/sdk/cases/gtk3.py
meta/lib/oeqa/sdk/cases/kmod.py
meta/lib/oeqa/sdk/cases/maturin.py
meta/lib/oeqa/sdk/cases/meson.py
meta/lib/oeqa/sdk/cases/perl.py
meta/lib/oeqa/sdk/cases/python.py

index cb0944ee995740d86b97e12378c84e8afebe8677..070682ef084d8e786dce63b813bf3af304d1ab84 100644 (file)
@@ -23,9 +23,7 @@ class CMakeTest(OESDKTestCase):
         if libc in [ 'newlib' ]:
             raise unittest.SkipTest("CMakeTest class: SDK doesn't contain a supported C library")
 
-        if not (self.tc.hasHostPackage("nativesdk-cmake") or
-                self.tc.hasHostPackage("cmake-native")):
-            raise unittest.SkipTest("CMakeTest: needs cmake")
+        self.ensure_host_package("cmake")
 
     def test_assimp(self):
         with tempfile.TemporaryDirectory(prefix="assimp", dir=self.tc.sdk_dir) as testdir:
index 8f60d5e7da7c736b498375f109051c860c18baed..1d953eecf1da65980e4b2dc63b348ca1819a06b4 100644 (file)
@@ -22,12 +22,8 @@ class GTK3Test(OESDKTestCase):
         if libc in [ 'newlib' ]:
             raise unittest.SkipTest("GTK3Test class: SDK doesn't contain a supported C library")
 
-        if not (self.tc.hasTargetPackage("gtk+3", multilib=True) or \
-                self.tc.hasTargetPackage("libgtk-3.0", multilib=True)):
-            raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3")
-        if not (self.tc.hasHostPackage("nativesdk-gettext-dev") or
-                self.tc.hasHostPackage("gettext-native")):
-            raise unittest.SkipTest("GalculatorTest class: SDK doesn't contain gettext")
+        self.ensure_host_package(recipe="intltool")
+        self.ensure_target_package("gtk+3", "libgtk-3.0", recipe="gtk+3")
 
     def test_galculator(self):
         with tempfile.TemporaryDirectory(prefix="galculator", dir=self.tc.sdk_dir) as testdir:
index 9e8fdbcd403e4b5ec917e813fe1f13f9b6f332b0..af9fcf5150d8e604e51deb5536c2a0cc3cc3388d 100644 (file)
@@ -7,7 +7,6 @@
 import os
 import subprocess
 import tempfile
-import unittest
 
 from oeqa.sdk.case import OESDKTestCase
 from oeqa.utils.subprocesstweak import errors_have_output
@@ -17,16 +16,11 @@ class KernelModuleTest(OESDKTestCase):
     """
     Test that out-of-tree kernel modules build.
     """
-
-    def setUp(self):
-        if not self.tc.hasTargetPackage("kernel-devsrc"):
-            raise unittest.SkipTest("KernelModuleTest needs kernel-devsrc")
-
+    def test_cryptodev(self):
+        self.ensure_target_package("kernel-devsrc")
         # These targets need to be built before kernel modules can be built.
         self._run("make -j -C $OECORE_TARGET_SYSROOT/usr/src/kernel prepare scripts")
 
-
-    def test_cryptodev(self):
         with tempfile.TemporaryDirectory(prefix="cryptodev", dir=self.tc.sdk_dir) as testdir:
             git_url = "https://github.com/cryptodev-linux/cryptodev-linux"
             # This is a knnown-good commit post-1.13 that builds with kernel 6.7+
index 20f6b553d0bac84da12e71af973f5c3cd0de6091..42394c7a973296ebba60a235adceaf5db2974732 100644 (file)
@@ -16,11 +16,7 @@ errors_have_output()
 
 class MaturinTest(OESDKTestCase):
     def setUp(self):
-        if not (
-            self.tc.hasHostPackage("nativesdk-python3-maturin")
-            or self.tc.hasHostPackage("python3-maturin-native")
-        ):
-            raise unittest.SkipTest("No python3-maturin package in the SDK")
+        self.ensure_host_package("python3-maturin")
 
     def test_maturin_list_python(self):
         py_major = self._run("python3 -c 'import sys; print(sys.version_info.major)'")
@@ -49,11 +45,8 @@ class MaturinDevelopTest(OESDKTestCase):
 
     def setUp(self):
         machine = self.td.get("MACHINE")
-        if not (
-            self.tc.hasHostPackage("nativesdk-python3-maturin")
-            or self.tc.hasHostPackage("python3-maturin-native")
-        ):
-            raise unittest.SkipTest("No python3-maturin package in the SDK")
+        self.ensure_host_package("python3-maturin")
+
         if not (
             self.tc.hasHostPackage("packagegroup-rust-cross-canadian-%s" % machine)
         ):
index 1edf78720ac73ec0aece8cbf641b561b3988a79c..6f773544e3d460df7d1da2d2ba640415a279a6df 100644 (file)
@@ -22,9 +22,7 @@ class MesonTest(OESDKTestCase):
         if libc in [ 'newlib' ]:
             raise unittest.SkipTest("MesonTest class: SDK doesn't contain a supported C library")
 
-        if not (self.tc.hasHostPackage("nativesdk-meson") or
-                self.tc.hasHostPackage("meson-native")):
-            raise unittest.SkipTest("MesonTest: needs meson")
+        self.ensure_host_package("meson")
 
     def test_epoxy(self):
         with tempfile.TemporaryDirectory(prefix="epoxy", dir=self.tc.sdk_dir) as testdir:
index 8eab4442e85873aa1cba0d37f395df8e0e4bcf57..a72bd2461a6babb4a44ce2e4303998dbe200bc54 100644 (file)
@@ -4,7 +4,6 @@
 # SPDX-License-Identifier: MIT
 #
 
-import unittest
 from oeqa.sdk.case import OESDKTestCase
 
 from oeqa.utils.subprocesstweak import errors_have_output
@@ -12,9 +11,7 @@ errors_have_output()
 
 class PerlTest(OESDKTestCase):
     def setUp(self):
-        if not (self.tc.hasHostPackage("nativesdk-perl") or
-                self.tc.hasHostPackage("perl-native")):
-            raise unittest.SkipTest("No perl package in the SDK")
+        self.ensure_host_package("perl")
 
     def test_perl(self):
         cmd = "perl -e '$_=\"Uryyb, jbeyq\"; tr/a-zA-Z/n-za-mN-ZA-M/;print'"
index 51284949f507b90b4ea6fde2283d97a67c925a9d..b990cd889ad9e30bb34f62cb3cf6da46803478e7 100644 (file)
@@ -4,7 +4,6 @@
 # SPDX-License-Identifier: MIT
 #
 
-import unittest
 from oeqa.sdk.case import OESDKTestCase
 
 from oeqa.utils.subprocesstweak import errors_have_output
@@ -12,9 +11,7 @@ errors_have_output()
 
 class Python3Test(OESDKTestCase):
     def setUp(self):
-        if not (self.tc.hasHostPackage("nativesdk-python3-core") or
-                self.tc.hasHostPackage("python3-core-native")):
-            raise unittest.SkipTest("No python3 package in the SDK")
+        self.ensure_host_package("python3-core", recipe="python3")
 
     def test_python3(self):
         cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""