From: Adrian Freihofer <[email protected]> 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 <[email protected]> --- meta/lib/oeqa/selftest/cases/devtool.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index f7f9deb6c7..6e6bada147 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -3338,8 +3338,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 = "" -- 2.53.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#231694): https://lists.openembedded.org/g/openembedded-core/message/231694 Mute This Topic: https://lists.openembedded.org/mt/117965266/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
