AutoTest: Fix handling of multiple build targets

If project files are not mapped 1:1 to targets the result
of the chosen executable was more or less random.
Try to handle multiple targets as correct as possible by
checking for build targets already where we still know
which files are part of the respective test cases.

Task-number: QTCREATORBUG-17783
Task-number: QTCREATORBUG-18357
Change-Id: I82dcc26bf52c9918e2727b439a719af08879ef49
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Christian Stenger
2017-06-09 09:30:21 +02:00
parent bde8ebc56c
commit cce1e130d7
13 changed files with 78 additions and 23 deletions

View File

@@ -498,8 +498,10 @@ void CMakeProject::updateApplicationAndDeploymentTargets()
if (ct.targetType == ExecutableType || ct.targetType == DynamicLibraryType)
deploymentData.addFile(ct.executable.toString(), deploymentPrefix + buildDir.relativeFilePath(ct.executable.toFileInfo().dir().path()), DeployableFile::TypeExecutable);
if (ct.targetType == ExecutableType) {
FileName srcWithTrailingSlash = FileName::fromString(ct.sourceDirectory.toString());
srcWithTrailingSlash.appendString('/');
// TODO: Put a path to corresponding .cbp file into projectFilePath?
appTargetList.list << BuildTargetInfo(ct.title, ct.executable, ct.executable);
appTargetList.list << BuildTargetInfo(ct.title, ct.executable, srcWithTrailingSlash);
}
}