aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/tst_blackboxbase.cpp
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2018-02-16 10:33:23 -0800
committerJake Petroules <jake.petroules@qt.io>2018-02-19 09:32:05 +0000
commit70206df40307cb8b09306638966a19ca03313cf8 (patch)
treec25efdbec7e6c608ce923156a2b253a08d21312e /tests/auto/blackbox/tst_blackboxbase.cpp
parenta5e127d703bc813a4e1828ca91fca02508915494 (diff)
Run autotests using the qbs from the install root if available
...as opposed to relying on the qbs binary existing in the same directory as the test binaries and being usable from that location. This is necessary for some generators (as they generate projects which call the same qbs binary as they were generated with) where an invocation on the qbs binary in the non-installed location may fail to find dependent libraries when invoked from an outside environment. Change-Id: I4d35a6f70df3ad4c48b202f73399ffe1704f78ca Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'tests/auto/blackbox/tst_blackboxbase.cpp')
-rw-r--r--tests/auto/blackbox/tst_blackboxbase.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/blackbox/tst_blackboxbase.cpp b/tests/auto/blackbox/tst_blackboxbase.cpp
index cb36e13e1..85a9fc2fa 100644
--- a/tests/auto/blackbox/tst_blackboxbase.cpp
+++ b/tests/auto/blackbox/tst_blackboxbase.cpp
@@ -46,9 +46,10 @@ using qbs::Profile;
static QString initQbsExecutableFilePath()
{
- QString filePath = QCoreApplication::applicationDirPath() + QLatin1String("/qbs");
- filePath = HostOsInfo::appendExecutableSuffix(QDir::cleanPath(filePath));
- return filePath;
+ const QString qbsInstallRoot = QString::fromLocal8Bit(qgetenv("QBS_INSTALL_ROOT"));
+ return HostOsInfo::appendExecutableSuffix(QDir::cleanPath(!qbsInstallRoot.isEmpty()
+ ? qbsInstallRoot + QLatin1String("/bin/qbs")
+ : QCoreApplication::applicationDirPath() + QLatin1String("/qbs")));
}
static bool supportsBuildDirectoryOption(const QString &command) {