forked from qt-creator/qt-creator
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>
This commit is contained in:
+29
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user