]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oe-selftest: devtool: improve test_devtool_ide_sdk_shared_sysroots
authorAdrian Freihofer <adrian.freihofer@siemens.com>
Mon, 23 Feb 2026 21:06:35 +0000 (22:06 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 5 Mar 2026 11:18:56 +0000 (11:18 +0000)
In shared-sysroot IDE SDK mode, the C++ CMake example test ran CMake
commands but did not assert that configure/build completed successfully.
This could hide failures and produce false positives.

Capture command output from both steps and assert expected messages:
- configure: "Build files have been written to: <builddir>"
- build: "Built target"

This makes the test explicitly fail when CMake configure or build does not
complete as expected.

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 ade79c881e4e4a78d8faa21d248fe09b01e8b035..aa9ee73d083575b354eb87714af0939758981652 100644 (file)
@@ -3354,8 +3354,12 @@ class DevtoolIdeSdkTests(DevtoolBase):
         cmake_native = os.path.normpath(result_cmake.output.strip())
         self.assertExists(cmake_native)
 
-        runCmdEnv('cmake %s' % cpp_example_src, cwd=tempdir_cmake, output_log=self._cmd_logger)
-        runCmdEnv('cmake --build %s' % tempdir_cmake, cwd=tempdir_cmake, output_log=self._cmd_logger)
+        result_cmake = runCmdEnv('cmake -S %s -B %s' % (cpp_example_src, tempdir_cmake),
+                                 cwd=tempdir_cmake, output_log=self._cmd_logger)
+        self.assertIn("Build files have been written to: %s" % tempdir_cmake, result_cmake.output)
+        result_cmake = runCmdEnv('cmake --build %s' % tempdir_cmake,
+                                 cwd=tempdir_cmake, output_log=self._cmd_logger)
+        self.assertIn("Built target", result_cmake.output)
 
         # Verify the printed note really referres to a cmake executable
         cmake_native_code = ""