AutoTest: Simplify some RunConfiguration use

Change-Id: I8ed2ddb7f0ee683a96787c71a6627755d83c3e5f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2019-03-13 09:02:23 +01:00
parent a68b967609
commit 424267979d

View File

@@ -53,9 +53,8 @@ TestConfiguration::~TestConfiguration()
m_testCases.clear();
}
static bool isLocal(RunConfiguration *runConfiguration)
static bool isLocal(Target *target)
{
Target *target = runConfiguration ? runConfiguration->target() : nullptr;
Kit *kit = target ? target->kit() : nullptr;
return DeviceTypeKitAspect::deviceTypeId(kit) == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
}
@@ -183,7 +182,7 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode)
qCDebug(LOG) << "Iterating run configurations";
for (RunConfiguration *runConfig : target->runConfigurations()) {
qCDebug(LOG) << "RunConfiguration" << runConfig->id();
if (!isLocal(runConfig)) { // TODO add device support
if (!isLocal(target)) { // TODO add device support
qCDebug(LOG) << " Skipped as not being local";
continue;
}
@@ -204,7 +203,7 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode)
m_runnable.executable = currentExecutable;
m_displayName = runConfig->displayName();
if (runMode == TestRunMode::Debug || runMode == TestRunMode::DebugWithoutDeploy)
m_runConfig = new TestRunConfiguration(runConfig->target(), this);
m_runConfig = new TestRunConfiguration(target, this);
break;
}
}
@@ -219,7 +218,7 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode)
qCDebug(LOG) << " Fallback";
// we failed to find a valid runconfiguration - but we've got the executable already
if (auto rc = target->activeRunConfiguration()) {
if (isLocal(rc)) { // FIXME for now only Desktop support
if (isLocal(target)) { // FIXME for now only Desktop support
const Runnable runnable = rc->runnable();
m_runnable.environment = runnable.environment;
m_deducedConfiguration = true;