diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2017-06-20 17:19:21 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2017-06-21 08:06:08 +0000 |
commit | bee61b0fec2bf945794e2243c05b3857ae6138a5 (patch) | |
tree | c90348cb9ac597277eaff7b88d967dde8747e4e4 | |
parent | 228dec629f89c170992dad5d9092a76cff2b4ebf (diff) | |
download | qt-creator-bee61b0fec2bf945794e2243c05b3857ae6138a5.tar.gz |
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>
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakeparser.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakeparser.cpp b/src/plugins/cmakeprojectmanager/cmakeparser.cpp index d31ee71daf..a06a68f684 100644 --- a/src/plugins/cmakeprojectmanager/cmakeparser.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeparser.cpp @@ -32,7 +32,7 @@ using namespace CMakeProjectManager; 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 LOCATION_LINE_PATTERN[] = ":(\\d+):(?:(\\d+))?$"; @@ -250,6 +250,20 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data() Utils::FileName(), -1, categoryBuild)) << 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") << QString::fromLatin1("Syntax Warning in cmake code at\n" "/test/path/CMakeLists.txt:9:15\n" |