Commit a081e8c9 authored by Christian Kandeler's avatar Christian Kandeler

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: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent f0687458
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;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment