forked from qt-creator/qt-creator
variables as complete words are better
Change-Id: If433c621466f2e1160a016d2b7b2539e4dc8b3d6 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -336,30 +336,29 @@ static QString which(const QString &path, const QString &cmd)
|
|||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
bool performExec(const QString &command, const QStringList &argumentList, const QString &workingDirectory,
|
||||||
bool performExec(const QString &cmd, const QStringList &args, const QString &workingDir,
|
const Utils::Environment &environment, int timeout)
|
||||||
const Utils::Environment &env, int timeout)
|
|
||||||
{
|
{
|
||||||
QString runCmd;
|
QString runCmd;
|
||||||
if (!QDir::toNativeSeparators(cmd).contains(QDir::separator())) {
|
if (!QDir::toNativeSeparators(command).contains(QDir::separator())) {
|
||||||
if (env.hasKey(QLatin1String("PATH")))
|
if (environment.hasKey(QLatin1String("PATH")))
|
||||||
runCmd = which(env.value(QLatin1String("PATH")), cmd);
|
runCmd = which(environment.value(QLatin1String("PATH")), command);
|
||||||
} else if (QFileInfo(cmd).exists()) {
|
} else if (QFileInfo(command).exists()) {
|
||||||
runCmd = cmd;
|
runCmd = command;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (runCmd.isEmpty()) {
|
if (runCmd.isEmpty()) {
|
||||||
emitTestResultCreated(FaultyTestResult(Result::MESSAGE_FATAL,
|
emitTestResultCreated(FaultyTestResult(Result::MESSAGE_FATAL,
|
||||||
QObject::tr("*** Could not find command '%1' ***").arg(cmd)));
|
QObject::tr("*** Could not find command '%1' ***").arg(command)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_runner->setWorkingDirectory(workingDir);
|
m_runner->setWorkingDirectory(workingDirectory);
|
||||||
m_runner->setProcessEnvironment(env.toProcessEnvironment());
|
m_runner->setProcessEnvironment(environment.toProcessEnvironment());
|
||||||
QTime executionTimer;
|
QTime executionTimer;
|
||||||
|
|
||||||
if (args.count()) {
|
if (argumentList.count()) {
|
||||||
m_runner->start(runCmd, args);
|
m_runner->start(runCmd, argumentList);
|
||||||
} else {
|
} else {
|
||||||
m_runner->start(runCmd);
|
m_runner->start(runCmd);
|
||||||
}
|
}
|
||||||
@@ -413,18 +412,18 @@ void performTestRun(QFutureInterface<void> &future, const QList<TestConfiguratio
|
|||||||
foreach (const TestConfiguration *tc, selectedTests) {
|
foreach (const TestConfiguration *tc, selectedTests) {
|
||||||
if (future.isCanceled())
|
if (future.isCanceled())
|
||||||
break;
|
break;
|
||||||
QString cmd = tc->targetFile();
|
QString command = tc->targetFile();
|
||||||
QString workDir = tc->workingDirectory();
|
QString workingDirectory = tc->workingDirectory();
|
||||||
QStringList args;
|
QStringList argumentList;
|
||||||
Utils::Environment env = tc->environment();
|
Utils::Environment environment = tc->environment();
|
||||||
|
|
||||||
args << QLatin1String("-xml");
|
argumentList << QLatin1String("-xml");
|
||||||
if (!metricsOption.isEmpty())
|
if (!metricsOption.isEmpty())
|
||||||
args << metricsOption;
|
argumentList << metricsOption;
|
||||||
if (tc->testCases().count())
|
if (tc->testCases().count())
|
||||||
args << tc->testCases();
|
argumentList << tc->testCases();
|
||||||
|
|
||||||
performExec(cmd, args, workDir, env, timeout);
|
performExec(command, argumentList, workingDirectory, environment, timeout);
|
||||||
}
|
}
|
||||||
future.setProgressValue(testCaseCount);
|
future.setProgressValue(testCaseCount);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user