From 428cc6188fb4f99bca8522530ed400357cfe38ec Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 20 Nov 2018 16:27:19 +0100 Subject: qbs build: Fix look-up of qbs executable by autotests The code worked only if qbs.installPrefix was empty. Change-Id: I9ba69f10c976b4a2b71ae4934c4cdac58895882a Reviewed-by: Ivan Komissarov Reviewed-by: Joerg Bornemann --- qbs-resources/imports/QbsAutotest.qbs | 2 +- tests/auto/blackbox/tst_blackboxbase.cpp | 6 +++--- tests/tests.qbs | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/qbs-resources/imports/QbsAutotest.qbs b/qbs-resources/imports/QbsAutotest.qbs index 3dac063f2..78db72d11 100644 --- a/qbs-resources/imports/QbsAutotest.qbs +++ b/qbs-resources/imports/QbsAutotest.qbs @@ -30,7 +30,7 @@ QtApplication { } cpp.rpaths: [FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix, qbsbuildconfig.libDirName)] qbs.commonRunEnvironment: ({ - "QBS_INSTALL_ROOT": qbs.installRoot + "QBS_INSTALL_DIR": FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix) }) Group { fileTagsFilter: product.type diff --git a/tests/auto/blackbox/tst_blackboxbase.cpp b/tests/auto/blackbox/tst_blackboxbase.cpp index b07f14553..e1844b69c 100644 --- a/tests/auto/blackbox/tst_blackboxbase.cpp +++ b/tests/auto/blackbox/tst_blackboxbase.cpp @@ -46,9 +46,9 @@ using qbs::Profile; static QString initQbsExecutableFilePath() { - const QString qbsInstallRoot = QString::fromLocal8Bit(qgetenv("QBS_INSTALL_ROOT")); - return HostOsInfo::appendExecutableSuffix(QDir::cleanPath(!qbsInstallRoot.isEmpty() - ? qbsInstallRoot + QLatin1String("/bin/qbs") + const QString qbsInstallDir = QString::fromLocal8Bit(qgetenv("QBS_INSTALL_DIR")); + return HostOsInfo::appendExecutableSuffix(QDir::cleanPath(!qbsInstallDir.isEmpty() + ? qbsInstallDir + QLatin1String("/bin/qbs") : QCoreApplication::applicationDirPath() + QLatin1String("/qbs"))); } diff --git a/tests/tests.qbs b/tests/tests.qbs index 3a2cd3aa0..52eafb3f0 100644 --- a/tests/tests.qbs +++ b/tests/tests.qbs @@ -1,4 +1,5 @@ import qbs +import qbs.FileInfo Project { references: [ @@ -16,7 +17,7 @@ Project { wrapper: project.autotestWrapper environment: { var env = base; - env.push("QBS_INSTALL_ROOT=" + qbs.installRoot); + env.push("QBS_INSTALL_DIR=" + FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix)); if (qbs.hostOS.contains("windows") && qbs.targetOS.contains("windows")) { var path = ""; for (var i = 0; i < env.length; ++i) { -- cgit v1.2.3