forked from qt-creator/qt-creator
RunControl: Announce starting and finishing in Application output pane
Change-Id: I040f848dbdd6ef92ce03525e91c4b536390df9b4 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -90,12 +90,16 @@ bool ClangStaticAnalyzerRunControl::startEngine()
|
|||||||
Project *project = target->project();
|
Project *project = target->project();
|
||||||
QTC_ASSERT(project, emit finished(); return false);
|
QTC_ASSERT(project, emit finished(); return false);
|
||||||
|
|
||||||
|
const QString projectFile = project->projectFilePath().toString();
|
||||||
|
appendMessage(tr("Running Clang Static Analyzer on %1").arg(projectFile) + QLatin1Char('\n'),
|
||||||
|
Utils::NormalMessageFormat);
|
||||||
|
|
||||||
// Check clang executable
|
// Check clang executable
|
||||||
bool isValidClangExecutable;
|
bool isValidClangExecutable;
|
||||||
const QString executable = clangExecutableFromSettings(&isValidClangExecutable);
|
const QString executable = clangExecutableFromSettings(&isValidClangExecutable);
|
||||||
if (!isValidClangExecutable) {
|
if (!isValidClangExecutable) {
|
||||||
emit appendMessage(tr("Clang Static Analyzer: Invalid executable \"%1\", stop.\n")
|
emit appendMessage(tr("Clang Static Analyzer: Invalid executable \"%1\", stop.")
|
||||||
.arg(executable),
|
.arg(executable) + QLatin1Char('\n'),
|
||||||
Utils::ErrorMessageFormat);
|
Utils::ErrorMessageFormat);
|
||||||
emit finished();
|
emit finished();
|
||||||
return false;
|
return false;
|
||||||
@@ -106,8 +110,8 @@ bool ClangStaticAnalyzerRunControl::startEngine()
|
|||||||
QTemporaryDir temporaryDir(QDir::tempPath() + QLatin1String("/qtc-clangstaticanalyzer-XXXXXX"));
|
QTemporaryDir temporaryDir(QDir::tempPath() + QLatin1String("/qtc-clangstaticanalyzer-XXXXXX"));
|
||||||
temporaryDir.setAutoRemove(false);
|
temporaryDir.setAutoRemove(false);
|
||||||
if (!temporaryDir.isValid()) {
|
if (!temporaryDir.isValid()) {
|
||||||
emit appendMessage(tr("Clang Static Analyzer: Failed to create temporary dir, stop.\n"),
|
emit appendMessage(tr("Clang Static Analyzer: Failed to create temporary dir, stop.")
|
||||||
Utils::ErrorMessageFormat);
|
+ QLatin1Char('\n'), Utils::ErrorMessageFormat);
|
||||||
emit finished();
|
emit finished();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -162,6 +166,8 @@ void ClangStaticAnalyzerRunControl::analyzeNextFile()
|
|||||||
|
|
||||||
if (m_filesToProcess.isEmpty()) {
|
if (m_filesToProcess.isEmpty()) {
|
||||||
if (m_runners.size() == 0) {
|
if (m_runners.size() == 0) {
|
||||||
|
appendMessage(tr("Clang Static Analyzer finished.") + QLatin1Char('\n'),
|
||||||
|
Utils::NormalMessageFormat);
|
||||||
m_progress.reportFinished();
|
m_progress.reportFinished();
|
||||||
emit finished();
|
emit finished();
|
||||||
}
|
}
|
||||||
@@ -199,6 +205,7 @@ void ClangStaticAnalyzerRunControl::onRunnerFinishedWithSuccess(const QString &l
|
|||||||
|
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
const QList<Diagnostic> diagnostics = LogFileReader::read(logFilePath, &errorMessage);
|
const QList<Diagnostic> diagnostics = LogFileReader::read(logFilePath, &errorMessage);
|
||||||
|
QTC_CHECK(errorMessage.isEmpty());
|
||||||
if (!errorMessage.isEmpty())
|
if (!errorMessage.isEmpty())
|
||||||
qCDebug(LOG) << "onRunnerFinishedWithSuccess: Error reading log file:" << errorMessage;
|
qCDebug(LOG) << "onRunnerFinishedWithSuccess: Error reading log file:" << errorMessage;
|
||||||
if (!diagnostics.isEmpty())
|
if (!diagnostics.isEmpty())
|
||||||
|
Reference in New Issue
Block a user