Fix plugin unit tests when using projects

The ClangTools and the AutoTest plugins use an internal
mechanism to load and configure a project when performing
their integrated unit tests.
Both assumed to have exactly one kit present for these
tests.
Make it possible to have more kits present when starting
with existing settings or if more kits get automatically
generated when starting with clean settings.

Change-Id: If2bc66320c4854f1d34a19d17107e8f0b7d64d39
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Christian Stenger
2020-06-16 13:11:10 +02:00
parent c6db1c29d6
commit 6e798401a0
15 changed files with 65 additions and 29 deletions

View File

@@ -445,9 +445,11 @@ Utils::FilePath CompilationDatabaseProject::rootPathFromSettings() const
#endif
}
void CompilationDatabaseProject::configureAsExampleProject()
void CompilationDatabaseProject::configureAsExampleProject(Kit *kit)
{
if (KitManager::defaultKit())
if (kit)
addTargetForKit(kit);
else if (KitManager::defaultKit())
addTargetForKit(KitManager::defaultKit());
}