[PATCH v6 6/6] oeqa/sdk/meson: Skip test when SDK arch != build machine arch

Tom Hochstein
2025-04-11T17:28:52Z

The SDK Meson test fails when the SDK is not for the build machine:
```
Traceback (most recent call last):
File "/srv/pokybuild/yocto-worker/qemux86/build/meta/lib/oeqa/sdk/cases/meson.py", line 47, in test_epoxy
self.assertNotEqual(data["build"]["c"]["exelist"], data["host"]["c"]["exelist"])
~~~~~~~~~~~~~^^^^^
KeyError: 'c'
```

Skip the test in this case.

Signed-off-by: Tom Hochstein <tom.hochstein@oss.nxp.com>
---
meta/lib/oeqa/sdk/cases/meson.py | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/meta/lib/oeqa/sdk/cases/meson.py b/meta/lib/oeqa/sdk/cases/meson.py
index 407b94d242..63bdac93a9 100644
--- a/meta/lib/oeqa/sdk/cases/meson.py
+++ b/meta/lib/oeqa/sdk/cases/meson.py
@@ -27,6 +27,11 @@ class MesonTest(OESDKTestCase):
self.tc.hasHostPackage("meson-native")):
raise unittest.SkipTest("MesonTest: needs meson")

+ sdk_arch = self.td["SDK_ARCH"]
+ build_arch = self._run("uname -m").strip()
+ if not sdk_arch == build_arch:
+ raise unittest.SkipTest("MesonTest: SDK arch '%s' not valid for build machine arch '%s'" % (sdk_arch, build_arch))
+
def test_epoxy(self):
with tempfile.TemporaryDirectory(prefix="epoxy", dir=self.tc.sdk_dir) as testdir:
tarball = self.fetch(testdir, self.td["DL_DIR"], "https://github.com/anholt/libepoxy/releases/download/1.5.3/libepoxy-1.5.3.tar.xz")
--
2.34.1