AutoTest: Fix retrieval of executable

Respect different location if tests are installed
before executing.

Task-number: QTCREATORBUG-16638
Change-Id: I2d154e26cdd0f28bd51e7a885c5486d36af38a68
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Christian Stenger
2016-07-27 14:48:16 +02:00
parent 80ca67e43f
commit 8c42cd9e23

View File

@@ -151,7 +151,12 @@ void TestConfiguration::completeTestInformation(int runMode)
Runnable runnable = rc->runnable(); Runnable runnable = rc->runnable();
if (isLocal(rc) && runnable.is<StandardRunnable>()) { if (isLocal(rc) && runnable.is<StandardRunnable>()) {
StandardRunnable stdRunnable = runnable.as<StandardRunnable>(); StandardRunnable stdRunnable = runnable.as<StandardRunnable>();
if (stdRunnable.executable == targetFile) { // we might have an executable that gets installed - in such a case the
// runnable's executable and targetFile won't match - but the (unique) display name
// of the run configuration should match targetName
if (stdRunnable.executable == targetFile
|| (!targetName.isEmpty() && rc->displayName() == targetName)) {
targetFile = stdRunnable.executable;
workDir = Utils::FileUtils::normalizePathName(stdRunnable.workingDirectory); workDir = Utils::FileUtils::normalizePathName(stdRunnable.workingDirectory);
env = stdRunnable.environment; env = stdRunnable.environment;
hasDesktopTarget = true; hasDesktopTarget = true;