From 8c42cd9e23ee3be7d757960be95678f9743a5ed7 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 27 Jul 2016 14:48:16 +0200 Subject: [PATCH] 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 --- src/plugins/autotest/testconfiguration.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/autotest/testconfiguration.cpp b/src/plugins/autotest/testconfiguration.cpp index 0e92789ae3f..1082594009b 100644 --- a/src/plugins/autotest/testconfiguration.cpp +++ b/src/plugins/autotest/testconfiguration.cpp @@ -151,7 +151,12 @@ void TestConfiguration::completeTestInformation(int runMode) Runnable runnable = rc->runnable(); if (isLocal(rc) && runnable.is()) { StandardRunnable stdRunnable = runnable.as(); - 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); env = stdRunnable.environment; hasDesktopTarget = true;