forked from qt-creator/qt-creator
CMake: Improve parsing of "CMake Error at" messages
Handle more "CMake error at" messages. This includes the generic "Parsing failed" message from cmake. Change-Id: Ie036c606bd7a8ad9cafbc32a34a77f8b95c3defa Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -32,7 +32,7 @@
|
|||||||
using namespace CMakeProjectManager;
|
using namespace CMakeProjectManager;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
const char COMMON_ERROR_PATTERN[] = "^CMake Error at (.*):([0-9]*) \\((.*)\\):";
|
const char COMMON_ERROR_PATTERN[] = "^CMake Error at (.*):([0-9]*)( \\((.*)\\))?:";
|
||||||
const char NEXT_SUBERROR_PATTERN[] = "^CMake Error in (.*):";
|
const char NEXT_SUBERROR_PATTERN[] = "^CMake Error in (.*):";
|
||||||
const char LOCATION_LINE_PATTERN[] = ":(\\d+):(?:(\\d+))?$";
|
const char LOCATION_LINE_PATTERN[] = ":(\\d+):(?:(\\d+))?$";
|
||||||
|
|
||||||
@@ -250,6 +250,20 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data()
|
|||||||
Utils::FileName(), -1, categoryBuild))
|
Utils::FileName(), -1, categoryBuild))
|
||||||
<< QString();
|
<< QString();
|
||||||
|
|
||||||
|
QTest::newRow("cmake error at")
|
||||||
|
<< QString::fromLatin1("CMake Error at CMakeLists.txt:4:\n"
|
||||||
|
" Parse error. Expected \"(\", got newline with text \"\n"
|
||||||
|
"\n"
|
||||||
|
" \".\n")
|
||||||
|
<< OutputParserTester::STDERR
|
||||||
|
<< QString() << QString()
|
||||||
|
<< (QList<ProjectExplorer::Task>()
|
||||||
|
<< Task(Task::Error,
|
||||||
|
QLatin1String("Parse error. Expected \"(\", got newline with text \" \"."),
|
||||||
|
Utils::FileName::fromUserInput(QLatin1String("CMakeLists.txt")), 4,
|
||||||
|
categoryBuild))
|
||||||
|
<< QString();
|
||||||
|
|
||||||
QTest::newRow("cmake warning")
|
QTest::newRow("cmake warning")
|
||||||
<< QString::fromLatin1("Syntax Warning in cmake code at\n"
|
<< QString::fromLatin1("Syntax Warning in cmake code at\n"
|
||||||
"/test/path/CMakeLists.txt:9:15\n"
|
"/test/path/CMakeLists.txt:9:15\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user