diff options
author | Tobias Hunger <tobias.hunger@nokia.com> | 2010-09-15 13:55:01 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@nokia.com> | 2010-09-15 14:46:33 +0200 |
commit | 0204ef21f57b87b6e1957d5c9babf3779a6eecd3 (patch) | |
tree | 8308eedaaa701855d22abee972fcf712feade4f9 | |
parent | 49d6fc27ec41d48d601bdff9289353a89cfe4691 (diff) | |
download | qt-creator-0204ef21f57b87b6e1957d5c9babf3779a6eecd3.tar.gz |
Parser debugging/testing improvements
* Set objectname on all parsers to be able to distinguish between
them more easily when debugging
* Add some unit tests about pass-through of data we need in the
gcc parser to the parsers that enhd up in front of the gcc parser
This is to address QTCREATORBUG-1917.
-rw-r--r-- | src/plugins/projectexplorer/gnumakeparser.cpp | 19 | ||||
-rw-r--r-- | src/plugins/projectexplorer/ldparser.cpp | 1 | ||||
-rw-r--r-- | src/plugins/projectexplorer/linuxiccparser.cpp | 1 | ||||
-rw-r--r-- | src/plugins/projectexplorer/msvcparser.cpp | 1 | ||||
-rw-r--r-- | src/plugins/qt4projectmanager/qmakeparser.cpp | 1 | ||||
-rw-r--r-- | src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp | 1 | ||||
-rw-r--r-- | src/plugins/qt4projectmanager/qt-s60/winscwparser.cpp | 1 | ||||
-rw-r--r-- | src/plugins/qt4projectmanager/qtparser.cpp | 17 |
8 files changed, 41 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/gnumakeparser.cpp b/src/plugins/projectexplorer/gnumakeparser.cpp index 24bbb873cf..0e2664bfff 100644 --- a/src/plugins/projectexplorer/gnumakeparser.cpp +++ b/src/plugins/projectexplorer/gnumakeparser.cpp @@ -46,6 +46,7 @@ GnuMakeParser::GnuMakeParser(const QString &dir) : m_suppressIssues(false), m_fatalErrorCount(0) { + setObjectName(QLatin1String("GnuMakeParser")); m_makeDir.setPattern(QLatin1String(MAKE_PATTERN) + QLatin1String("(\\w+) directory .(.+).$")); m_makeDir.setMinimal(true); @@ -206,6 +207,24 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << QList<Task>() << QString() << QStringList(); + QTest::newRow("pass-through gcc infos") + << QStringList() + << QString::fromLatin1("/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n" + "../../scriptbug/main.cpp: At global scope:\n" + "../../scriptbug/main.cpp: In instantiation of void bar(i) [with i = double]:\n" + "../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]\n" + "../../scriptbug/main.cpp:22: instantiated from here\n") + << OutputParserTester::STDERR + << QString() + << QString::fromLatin1("/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n" + "../../scriptbug/main.cpp: At global scope:\n" + "../../scriptbug/main.cpp: In instantiation of void bar(i) [with i = double]:\n" + "../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]\n" + "../../scriptbug/main.cpp:22: instantiated from here\n") + << QList<ProjectExplorer::Task>() + << QString() + << QStringList(); + // make sure adding directories works (once;-) QTest::newRow("entering directory") << (QStringList() << QString::fromLatin1("/test/dir") ) diff --git a/src/plugins/projectexplorer/ldparser.cpp b/src/plugins/projectexplorer/ldparser.cpp index 3ca85d3e22..4629426acb 100644 --- a/src/plugins/projectexplorer/ldparser.cpp +++ b/src/plugins/projectexplorer/ldparser.cpp @@ -43,6 +43,7 @@ namespace { LdParser::LdParser() { + setObjectName(QLatin1String("LdParser")); m_regExpLinker.setPattern(QString::fromLatin1(FILE_PATTERN) + '(' + QLatin1String(POSITION_PATTERN) + ")?\\s(.+)$"); m_regExpLinker.setMinimal(true); diff --git a/src/plugins/projectexplorer/linuxiccparser.cpp b/src/plugins/projectexplorer/linuxiccparser.cpp index 3516df1661..a1038aa32d 100644 --- a/src/plugins/projectexplorer/linuxiccparser.cpp +++ b/src/plugins/projectexplorer/linuxiccparser.cpp @@ -38,6 +38,7 @@ using namespace ProjectExplorer; LinuxIccParser::LinuxIccParser() : m_expectFirstLine(true), m_indent(0), m_temporary(Task()) { + setObjectName(QLatin1String("LinuxIccParser")); // main.cpp(53): error #308: function \"AClass::privatefunc\" (declared at line 4 of \"main.h\") is inaccessible m_firstLine.setPattern("^([^\\(\\)]+)" // filename (cap 1) diff --git a/src/plugins/projectexplorer/msvcparser.cpp b/src/plugins/projectexplorer/msvcparser.cpp index 37130af9fa..7051717870 100644 --- a/src/plugins/projectexplorer/msvcparser.cpp +++ b/src/plugins/projectexplorer/msvcparser.cpp @@ -39,6 +39,7 @@ using namespace ProjectExplorer; MsvcParser::MsvcParser() { + setObjectName(QLatin1String("MavcParser")); m_compileRegExp.setPattern(QString::fromLatin1("^") + QLatin1String(FILE_POS_PATTERN) + QLatin1String(" : .*(warning|error) (") + QLatin1String(ERROR_PATTERN) + QLatin1String(".*)$")); diff --git a/src/plugins/qt4projectmanager/qmakeparser.cpp b/src/plugins/qt4projectmanager/qmakeparser.cpp index 14971e7fe6..26c049a35e 100644 --- a/src/plugins/qt4projectmanager/qmakeparser.cpp +++ b/src/plugins/qt4projectmanager/qmakeparser.cpp @@ -40,6 +40,7 @@ using ProjectExplorer::Task; QMakeParser::QMakeParser() { + setObjectName(QLatin1String("QMakeParser")); } void QMakeParser::stdError(const QString &line) diff --git a/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp b/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp index e4c8c57283..5702d3611b 100644 --- a/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp @@ -39,6 +39,7 @@ RvctParser::RvctParser() : m_additionalInfo(false), m_lastLine(0) { + setObjectName(QLatin1String("RvctParser")); // Start of a error or warning: m_warningOrError.setPattern("^\"([^\\(\\)]+[^\\d])\", line (\\d+):(\\s(Warning|Error):)\\s(.+)$"); m_warningOrError.setMinimal(true); diff --git a/src/plugins/qt4projectmanager/qt-s60/winscwparser.cpp b/src/plugins/qt4projectmanager/qt-s60/winscwparser.cpp index d1d98a6e15..9d1522fe98 100644 --- a/src/plugins/qt4projectmanager/qt-s60/winscwparser.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/winscwparser.cpp @@ -37,6 +37,7 @@ using namespace ProjectExplorer::Constants; WinscwParser::WinscwParser() { + setObjectName(QLatin1String("WinscwParser")); // linker problems: m_linkerProblem.setPattern("^(\\S*)\\(\\S+\\):\\s(.+)$"); m_linkerProblem.setMinimal(true); diff --git a/src/plugins/qt4projectmanager/qtparser.cpp b/src/plugins/qt4projectmanager/qtparser.cpp index 7c9aa3d28d..581e5f98fa 100644 --- a/src/plugins/qt4projectmanager/qtparser.cpp +++ b/src/plugins/qt4projectmanager/qtparser.cpp @@ -45,6 +45,7 @@ namespace { QtParser::QtParser() { + setObjectName(QLatin1String("QtParser")); m_mocRegExp.setPattern(QString::fromLatin1(FILE_PATTERN) + "(\\d+):\\s(Warning|Error):\\s(.+)$"); m_mocRegExp.setMinimal(true); } @@ -102,7 +103,21 @@ void Qt4ProjectManagerPlugin::testQtOutputParser_data() << QString() << QString::fromLatin1("Sometext") << QList<ProjectExplorer::Task>() << QString(); - + QTest::newRow("pass-through gcc infos") + << QString::fromLatin1("/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n" + "../../scriptbug/main.cpp: At global scope:\n" + "../../scriptbug/main.cpp: In instantiation of void bar(i) [with i = double]:\n" + "../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]\n" + "../../scriptbug/main.cpp:22: instantiated from here\n") + << OutputParserTester::STDERR + << QString() + << QString::fromLatin1("/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n" + "../../scriptbug/main.cpp: At global scope:\n" + "../../scriptbug/main.cpp: In instantiation of void bar(i) [with i = double]:\n" + "../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]\n" + "../../scriptbug/main.cpp:22: instantiated from here\n") + << QList<ProjectExplorer::Task>() + << QString(); QTest::newRow("moc warning") << QString::fromLatin1("..\\untitled\\errorfile.h:0: Warning: No relevant classes found. No output generated.") << OutputParserTester::STDERR |