aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/autotest/testconfiguration.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2018-04-09 12:33:10 +0200
committerhjk <[email protected]>2018-04-12 12:11:45 +0000
commitbc698d4ce61b95555e1d4ed16cd0d609e7e295e8 (patch)
tree9ecb48aa27ade853f6d1bae246ce1a01ef903b93 /src/plugins/autotest/testconfiguration.cpp
parent4ab7c19e848701b666a720d85bf5b63fa34a2ce6 (diff)
ProjectExplorer: Consolidate RunConfiguration identifications
The previously per-Project/RunConfiguration changing meanings of BuildTargetInfo::buildTarget have by now been split into separate values in BuildTargetInfo: - buildKey a handle to one item in Target::applicationTargetList - displayName a user-visible string in the run settings page The buildKey was tweaked to coincide with the previous 'extraId', i.e. the non-RunConfiguration-type part of the project configuration id that (still) use id mangling. This allows replacing the cases of locally stored seven different versions of buildKey(-ish) data by one RunConfiguration::m_buildKey, and do all remaining extraId handling in RC::{from,to}Map only, i.e. remove the base ProjectConfiguration::extraId() virtual and remove the "re-try fromMap with mangled id" hack entirely. The id mangling is still used to temporarily maintain .user file compatibility in some cases for now, but should be replaced by storing the build key and the RunConfiguration type soon. Qbs already changes in here to only use the uniqueProductName as buildKey, without the previously added display name which is stored as part of the ProjectConfiguration already. It turns out that RunConfiguration::buildSystemTarget was intended and used to retrieve an item from the Target::applicationTargetList for some configurations, coinciding with what buildKey does always. So use that insteand and drop RunConfiguration::buildSystemTarget. There is clearly is further consolidation potential left. handling of (default)displayNames is still a per-runconfiguration mess and there is further consolidation potential left. Change-Id: I448ed30f1b562fb91b970e328a42fa5f6fb2e43e Reviewed-by: Tobias Hunger <[email protected]>
Diffstat (limited to 'src/plugins/autotest/testconfiguration.cpp')
-rw-r--r--src/plugins/autotest/testconfiguration.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/plugins/autotest/testconfiguration.cpp b/src/plugins/autotest/testconfiguration.cpp
index 46b38f19922..6e26b910a33 100644
--- a/src/plugins/autotest/testconfiguration.cpp
+++ b/src/plugins/autotest/testconfiguration.cpp
@@ -100,12 +100,8 @@ void TestConfiguration::completeTestInformation(ProjectExplorer::RunConfiguratio
m_displayName = rc->displayName();
m_project = rc->project();
- const QString buildSystemTarget = rc->buildSystemTarget();
- BuildTargetInfo targetInfo
- = Utils::findOrDefault(target->applicationTargets().list,
- [&buildSystemTarget] (const BuildTargetInfo &bti) {
- return bti.targetName == buildSystemTarget;
- });
+ const QString buildKey = rc->buildKey();
+ BuildTargetInfo targetInfo = target->applicationTargets().buildTargetInfo(buildKey);
if (!targetInfo.targetFilePath.isEmpty())
m_runnable.executable = ensureExeEnding(targetInfo.targetFilePath.toString());
@@ -156,7 +152,7 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode)
const QStringList targWithProjectFile = b.split('|');
if (targWithProjectFile.size() != 2) // some build targets might miss the project file
return false;
- return !bti.targetFilePath.isEmpty() && targWithProjectFile.at(0) == bti.targetName
+ return !bti.targetFilePath.isEmpty() && targWithProjectFile.at(0) == bti.buildKey
&& targWithProjectFile.at(1).startsWith(bti.projectFilePath.toString());
});
});
@@ -169,7 +165,7 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode)
if (buildTargets.size() == 1) {
targetInfo = buildTargets.first();
m_guessedConfiguration = true;
- m_guessedFrom = targetInfo.targetName;
+ m_guessedFrom = targetInfo.buildKey;
}
}
@@ -212,7 +208,7 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode)
// not the best approach - but depending on the build system and whether the executables
// are going to get installed or not we have to soften the condition...
const QString &currentExecutable = ensureExeEnding(stdRunnable.executable);
- const QString currentBST = runConfig->buildSystemTarget() + '|';
+ const QString currentBST = runConfig->buildKey() + '|';
qCDebug(LOG) << " CurrentExecutable" << currentExecutable;
qCDebug(LOG) << " BST of RunConfig" << currentBST;
const bool isQbs = runConfig->id().toString().startsWith("Qbs.RunConfiguration:"); // BAD!