diff options
author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2016-01-22 11:09:37 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2016-01-25 09:39:52 +0000 |
commit | a081e8c96f11b8286a9e8810e438b1209727edcf (patch) | |
tree | eae94ef427730a96bbaf4676fb8cf9cdb3576b1b /qtcreator.qbs | |
parent | f068745868322a5eaa484cc0edda192af1dae464 (diff) | |
download | qt-creator-a081e8c96f11b8286a9e8810e438b1209727edcf.tar.gz |
qbs build: Fix autotest runner on Windows.
The tests need to find Creator's libraries and plugins at run-time.
Change-Id: Ided40e70693650a0099661dd961223c5b68da646
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'qtcreator.qbs')
-rw-r--r-- | qtcreator.qbs | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/qtcreator.qbs b/qtcreator.qbs index 0813a2d511..e096281d50 100644 --- a/qtcreator.qbs +++ b/qtcreator.qbs @@ -1,4 +1,5 @@ import qbs 1.0 +import qbs.FileInfo Project { name: "Qt Creator" @@ -66,5 +67,32 @@ Project { "tests/tests.qbs" ] - AutotestRunner {} + AutotestRunner { + Depends { name: "Qt.core" } + environment: { + var env = base; + if (!qbs.hostOS.contains("windows") || !qbs.targetOS.contains("windows")) + return env; + var path = ""; + for (var i = 0; i < env.length; ++i) { + if (env[i].startsWith("PATH=")) { + path = env[i].substring(5); + break; + } + } + var fullQtcInstallDir + = FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix, qbs.InstallDir); + var fullLibInstallDir = FileInfo.joinPaths(fullQtcInstallDir, project.ide_library_path); + var fullPluginInstallDir + = FileInfo.joinPaths(fullQtcInstallDir, project.ide_plugin_path); + path = Qt.core.binPath + ";" + fullLibInstallDir + ";" + fullPluginInstallDir + + ";" + path; + var arrayElem = "PATH=" + path; + if (i < env.length) + env[i] = arrayElem; + else + env.push(arrayElem); + return env; + } + } } |