From d11aa98219561650a5a10a02468f81eafedf3943 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 15 Oct 2020 13:30:11 +0200 Subject: [PATCH] AutoTest: Prefer active target over further If there are more than one target for a run configuration we ended up in the first matching. Tests may use different environments to test different things. If the user tried to handle this by using a modified environment for different targets failed even when the correct target was selected. Change-Id: Ie954c985969ffd187fe60b4ecb86aa2717d559f1 Reviewed-by: David Schulz --- src/plugins/autotest/testconfiguration.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/autotest/testconfiguration.cpp b/src/plugins/autotest/testconfiguration.cpp index 10709e38a61..785abe4f753 100644 --- a/src/plugins/autotest/testconfiguration.cpp +++ b/src/plugins/autotest/testconfiguration.cpp @@ -185,8 +185,11 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode) qCDebug(LOG) << " LocalExecutable" << localExecutable; qCDebug(LOG) << " DeployedExecutable" << deployedExecutable; - qCDebug(LOG) << "Iterating run configurations"; - for (RunConfiguration *runConfig : target->runConfigurations()) { + qCDebug(LOG) << "Iterating run configurations - prefer active over others"; + QList runConfigurations = target->runConfigurations(); + runConfigurations.removeOne(target->activeRunConfiguration()); + runConfigurations.prepend(target->activeRunConfiguration()); + for (RunConfiguration *runConfig : qAsConst(runConfigurations)) { qCDebug(LOG) << "RunConfiguration" << runConfig->id(); if (!isLocal(target)) { // TODO add device support qCDebug(LOG) << " Skipped as not being local";