]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
oe-selftest: devtool: use assertRegex to match test output for meson
authorAdrian Freihofer <adrian.freihofer@siemens.com>
Mon, 6 Apr 2026 22:10:31 +0000 (00:10 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 13 Apr 2026 16:30:33 +0000 (17:30 +0100)
Replace strict string matching with assertRegex to allow for flexible
whitespace in the "Fail: 0" output from meson tests. This improves test
robustness against formatting changes.
This issue was discovered with scarthgap.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/devtool.py

index 36b7f16d3d7af6e3bbcddfdb7edaa6e259569be8..f4ccffd9b9b7b7acd4f6c2f0e38d9ab4cac80e63 100644 (file)
@@ -2911,7 +2911,7 @@ class DevtoolIdeSdkTests(DevtoolBase):
         result = runCmd('%s test -C %s' % (meson_exe, build_dir),
                         cwd=tempdir, output_log=self._cmd_logger)
         self.assertEqual(result.status, 0)
-        self.assertIn("Fail:              0", result.output)
+        self.assertRegex(result.output, r"Fail:\s+0")
 
         # Verify re-building and testing works again
         result = runCmd('%s compile -C %s --clean' % (meson_exe, build_dir),
@@ -2922,7 +2922,7 @@ class DevtoolIdeSdkTests(DevtoolBase):
         result = runCmd('%s test -C %s' % (meson_exe, build_dir),
                         cwd=tempdir, output_log=self._cmd_logger)
         self.assertEqual(result.status, 0)
-        self.assertIn("Fail:              0", result.output)
+        self.assertRegex(result.output, r"Fail:\s+0")
 
         return compile_cmd