AutoTest: Modernize code a bit

Change-Id: Ie56f6e5cb8a4f1962bd8df5e57214911ae609921
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2016-09-29 12:15:43 +02:00
parent 8b579fca6a
commit b0bf07c64a
44 changed files with 207 additions and 235 deletions

View File

@@ -118,10 +118,8 @@ void TestConfiguration::completeTestInformation(int runMode)
// some project manager store line/column information as well inside ProjectPart
if (bti.isValid() && m_proFile.startsWith(bti.projectFilePath.toString())) {
targetFile = bti.targetFilePath.toString();
if (Utils::HostOsInfo::isWindowsHost()
&& !targetFile.toLower().endsWith(QLatin1String(".exe"))) {
if (Utils::HostOsInfo::isWindowsHost() && !targetFile.toLower().endsWith(".exe"))
targetFile = Utils::HostOsInfo::withExecutableSuffix(targetFile);
}
targetName = bti.targetName;
break;
}
@@ -274,7 +272,7 @@ QString TestConfiguration::executableFilePath() const
} else if (commandFileInfo.path() == "."){
QString fullCommandFileName = m_targetFile;
if (Utils::HostOsInfo::isWindowsHost() && !m_targetFile.endsWith(".exe"))
fullCommandFileName = m_targetFile + QLatin1String(".exe");
fullCommandFileName = m_targetFile + ".exe";
// TODO: check if we can use searchInPath() from Utils::Environment
const QStringList &pathList = m_environment.toProcessEnvironment().value("PATH").split(
Utils::HostOsInfo::pathListSeparator());