Skip to content

Commit

Permalink
qbs build: Fix autotest runner on Windows.
Browse files Browse the repository at this point in the history
The tests need to find Creator's libraries and plugins at run-time.

Change-Id: Ided40e70693650a0099661dd961223c5b68da646
Reviewed-by: Nikolai Kosjar <[email protected]>
Reviewed-by: Joerg Bornemann <[email protected]>
  • Loading branch information
Christian Kandeler committed Jan 25, 2016
1 parent f068745 commit a081e8c
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion qtcreator.qbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import qbs 1.0
import qbs.FileInfo

Project {
name: "Qt Creator"
Expand Down Expand Up @@ -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;
}
}
}

0 comments on commit a081e8c

Please sign in to comment.