From f399eff35ec7f7e85367766ed0ee9f61e7d9d75b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sun, 16 Jun 2024 18:50:55 +0200 Subject: [PATCH] tst_qt_cmake_create: Skip test if CMake is not found Change-Id: Ifd84135c756d5140bea1952e069f82854afe1ecd Reviewed-by: Alexey Edelev (cherry picked from commit 4cb492e14a31b6497b81bfbbcbec09f94595698a) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/tools/qt_cmake_create/tst_qt_cmake_create.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/auto/tools/qt_cmake_create/tst_qt_cmake_create.cpp b/tests/auto/tools/qt_cmake_create/tst_qt_cmake_create.cpp index 6bbc58ef320..52c3bef14a9 100644 --- a/tests/auto/tools/qt_cmake_create/tst_qt_cmake_create.cpp +++ b/tests/auto/tools/qt_cmake_create/tst_qt_cmake_create.cpp @@ -42,12 +42,17 @@ void tst_qt_cmake_create::initTestCase() #ifdef Q_OS_WINDOWS m_shell = QString("cmd.exe"); m_cmd = QString("%1/qt-cmake-create.bat").arg(binpath); + const QString cmake = QStandardPaths::findExecutable("cmake.exe"); #else m_shell = QString("/bin/sh"); m_cmd = QString("%1/qt-cmake-create").arg(binpath); QVERIFY(QFile::exists(m_shell)); + const QString cmake = QStandardPaths::findExecutable("cmake"); #endif + if (cmake.isEmpty()) + QSKIP("CMake not found"); + QVERIFY(QFile::exists(m_cmd)); }