From a081e8c96f11b8286a9e8810e438b1209727edcf Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 22 Jan 2016 11:09:37 +0100 Subject: [PATCH] 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 Reviewed-by: Joerg Bornemann --- qtcreator.qbs | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/qtcreator.qbs b/qtcreator.qbs index 0813a2d511d..e096281d503 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; + } + } }