forked from qt-creator/qt-creator
CMake: Better error parsing
Change-Id: I9065851f6c2b994d4819e202e6ce1571a3f53308 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
@@ -89,6 +89,11 @@ void CMakeParser::stdError(const QString &line)
|
||||
m_lastTask = Task(trimmedLine.contains(QLatin1String("Error")) ? Task::Error : Task::Warning,
|
||||
QString(), Utils::FileName(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM);
|
||||
return;
|
||||
} else if (trimmedLine.startsWith("CMake Error: ")) {
|
||||
m_lastTask = Task(Task::Error, trimmedLine.mid(13),
|
||||
Utils::FileName(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM);
|
||||
m_lines = 1;
|
||||
return;
|
||||
}
|
||||
IOutputParser::stdError(line);
|
||||
return;
|
||||
@@ -234,6 +239,18 @@ void CMakeProjectPlugin::testCMakeParser_data()
|
||||
categoryBuild))
|
||||
<< QString();
|
||||
|
||||
QTest::newRow("cmake error2")
|
||||
<< QString::fromLatin1("CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.\n"
|
||||
"Missing variable is:\n"
|
||||
"CMAKE_MAKE_PROGRAM\n")
|
||||
<< OutputParserTester::STDERR
|
||||
<< QString() << QString::fromLatin1("Missing variable is:\nCMAKE_MAKE_PROGRAM\n")
|
||||
<< (QList<ProjectExplorer::Task>()
|
||||
<< Task(Task::Error,
|
||||
QLatin1String("Error required internal CMake variable not set, cmake may be not be built correctly."),
|
||||
Utils::FileName(), -1, categoryBuild))
|
||||
<< QString();
|
||||
|
||||
QTest::newRow("cmake warning")
|
||||
<< QString::fromLatin1("Syntax Warning in cmake code at\n"
|
||||
"/test/path/CMakeLists.txt:9:15\n"
|
||||
|
||||
Reference in New Issue
Block a user