From eb397a2ce96fae733663d40a6e151952195452d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sun, 16 Jun 2024 14:51:03 +0200 Subject: [PATCH] Skip some build system tests if Xcode is not installed We rely on a valid Xcode (command line tools) installation to run qmake. Change-Id: I8d6746942507680dd585a41f32cbe4e4d34822e4 Reviewed-by: Alexey Edelev (cherry picked from commit 06b33134b38ffabdf0c0d80c2c3b9581294ff715) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/tools/macdeployqt/tst_macdeployqt.cpp | 3 +++ tests/auto/tools/qmake/tst_qmake.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/tests/auto/tools/macdeployqt/tst_macdeployqt.cpp b/tests/auto/tools/macdeployqt/tst_macdeployqt.cpp index 3c17acda56d..d408554319d 100644 --- a/tests/auto/tools/macdeployqt/tst_macdeployqt.cpp +++ b/tests/auto/tools/macdeployqt/tst_macdeployqt.cpp @@ -224,6 +224,9 @@ void tst_macdeployqt::initTestCase() QSKIP("This test requires QProcess support"); #endif + if (QProcess::execute("xcode-select", { "-p" }) != 0) + QSKIP("Xcode or Xcode command line tools not installed"); + // Set up test-global unique temporary directory g_temporaryDirectory = new QTemporaryDir(); g_temporaryDirectory->setAutoRemove(!lcTests().isDebugEnabled()); diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp index a32b4ab228c..278cf4ad232 100644 --- a/tests/auto/tools/qmake/tst_qmake.cpp +++ b/tests/auto/tools/qmake/tst_qmake.cpp @@ -93,6 +93,11 @@ static void copyDir(const QString &sourceDirPath, const QString &targetDirPath) void tst_qmake::initTestCase() { +#if defined(Q_OS_APPLE) + if (QProcess::execute("xcode-select", { "-p" }) != 0) + QSKIP("Xcode or Xcode command line tools not installed"); +#endif + QVERIFY2(tempWorkDir.isValid(), qPrintable(tempWorkDir.errorString())); QString binpath = QLibraryInfo::path(QLibraryInfo::BinariesPath); QString cmd = QString("%1/qmake").arg(binpath);