diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-11-20 16:27:19 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-11-21 12:31:21 +0000 |
commit | 428cc6188fb4f99bca8522530ed400357cfe38ec (patch) | |
tree | 5091edd0ee1184d50ddc2a8bf6ef305a9481e8d2 | |
parent | 04df7bbcf1a346c2e2bf15755790c8554a0b2c96 (diff) |
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 <ABBAPOH@gmail.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | qbs-resources/imports/QbsAutotest.qbs | 2 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackboxbase.cpp | 6 | ||||
-rw-r--r-- | 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) { |