aboutsummaryrefslogtreecommitdiffstats
path: root/qtcreator.qbs
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2016-01-22 11:09:37 +0100
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2016-01-25 09:39:52 +0000
commita081e8c96f11b8286a9e8810e438b1209727edcf (patch)
treeeae94ef427730a96bbaf4676fb8cf9cdb3576b1b /qtcreator.qbs
parentf068745868322a5eaa484cc0edda192af1dae464 (diff)
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.qbs30
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;
+ }
+ }
}