diff --git a/src/plugins/projectexplorer/gccparser.cpp b/src/plugins/projectexplorer/gccparser.cpp index acc5f9f95a98f53533d3a85f21da2c00b411162b..b276e07f26a084d20d83cf17d3980586eaf781fb 100644 --- a/src/plugins/projectexplorer/gccparser.cpp +++ b/src/plugins/projectexplorer/gccparser.cpp @@ -152,12 +152,12 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() QTest::newRow("pass-through stdout") << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT - << QString::fromLatin1("Sometext") << QString() + << QString::fromLatin1("Sometext\n") << QString() << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("pass-through stderr") << QString::fromLatin1("Sometext") << OutputParserTester::STDERR - << QString() << QString::fromLatin1("Sometext") + << QString() << QString::fromLatin1("Sometext\n") << QList<ProjectExplorer::Task>() << QString(); @@ -337,7 +337,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() "distcc[73168] (dcc_build_somewhere) Warning: failed to distribute, running locally instead") << OutputParserTester::STDERR << QString() << QString::fromLatin1("distcc[73168] (dcc_get_hostlist) Warning: no hostlist is set; can't distribute work\n" - "distcc[73168] (dcc_build_somewhere) Warning: failed to distribute, running locally instead") + "distcc[73168] (dcc_build_somewhere) Warning: failed to distribute, running locally instead\n") << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("ld warning (QTCREATORBUG-905)") @@ -363,7 +363,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() QTest::newRow("Teambuilder issues") << QString::fromLatin1("TeamBuilder Client:: error: could not find Scheduler, running Job locally...") << OutputParserTester::STDERR - << QString() << QString::fromLatin1("TeamBuilder Client:: error: could not find Scheduler, running Job locally...") + << QString() << QString::fromLatin1("TeamBuilder Client:: error: could not find Scheduler, running Job locally...\n") << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("note") @@ -394,13 +394,13 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() QTest::newRow("rm false positive") << QString::fromLatin1("rm: cannot remove `release/moc_mainwindow.cpp': No such file or directory") << OutputParserTester::STDERR - << QString() << QString("rm: cannot remove `release/moc_mainwindow.cpp': No such file or directory") + << QString() << QString("rm: cannot remove `release/moc_mainwindow.cpp': No such file or directory\n") << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("ranlib false positive") << QString::fromLatin1("ranlib: file: libSupport.a(HashTable.o) has no symbols") << OutputParserTester::STDERR - << QString() << QString("ranlib: file: libSupport.a(HashTable.o) has no symbols") + << QString() << QString("ranlib: file: libSupport.a(HashTable.o) has no symbols\n") << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("ld: missing library") diff --git a/src/plugins/projectexplorer/gnumakeparser.cpp b/src/plugins/projectexplorer/gnumakeparser.cpp index a6b0ea5a8abf970e560761b020b7ef0a752ff884..bd8573f7131b06aae911ee905b1248007d18f98e 100644 --- a/src/plugins/projectexplorer/gnumakeparser.cpp +++ b/src/plugins/projectexplorer/gnumakeparser.cpp @@ -204,14 +204,14 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() QTest::newRow("pass-through stdout") << QStringList() << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT - << QString::fromLatin1("Sometext") << QString() + << QString::fromLatin1("Sometext\n") << QString() << QList<Task>() << QString() << QStringList(); QTest::newRow("pass-through stderr") << QStringList() << QString::fromLatin1("Sometext") << OutputParserTester::STDERR - << QString() << QString::fromLatin1("Sometext") + << QString() << QString::fromLatin1("Sometext\n") << QList<Task>() << QString() << QStringList(); @@ -221,7 +221,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() "../../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") + "../../scriptbug/main.cpp:22: instantiated from here") << OutputParserTester::STDERR << QString() << QString::fromLatin1("/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n" @@ -237,7 +237,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() QTest::newRow("entering directory") << (QStringList() << QString::fromLatin1("/test/dir") ) << QString::fromLatin1("make[4]: Entering directory `/home/code/build/qt/examples/opengl/grabber'\n" - "make[4]: Entering directory `/home/code/build/qt/examples/opengl/grabber'\n") + "make[4]: Entering directory `/home/code/build/qt/examples/opengl/grabber'") << OutputParserTester::STDOUT << QString() << QString() << QList<Task>() @@ -320,7 +320,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << QStringList() << QString::fromLatin1("/home/dev/creator/share/qtcreator/gdbmacros/gdbmacros.cpp:1079: note: initialized from here") << OutputParserTester::STDERR - << QString() << QString::fromLatin1("/home/dev/creator/share/qtcreator/gdbmacros/gdbmacros.cpp:1079: note: initialized from here") + << QString() << QString::fromLatin1("/home/dev/creator/share/qtcreator/gdbmacros/gdbmacros.cpp:1079: note: initialized from here\n") << QList<ProjectExplorer::Task>() << QString() << QStringList(); diff --git a/src/plugins/projectexplorer/linuxiccparser.cpp b/src/plugins/projectexplorer/linuxiccparser.cpp index d362442b8f4391a57368a9024a618867d3104809..074eaf4352f3a66e479e1dd43844aef091cc5e2a 100644 --- a/src/plugins/projectexplorer/linuxiccparser.cpp +++ b/src/plugins/projectexplorer/linuxiccparser.cpp @@ -131,12 +131,12 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() QTest::newRow("pass-through stdout") << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT - << QString::fromLatin1("Sometext") << QString() + << QString::fromLatin1("Sometext\n") << QString() << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("pass-through stderr") << QString::fromLatin1("Sometext") << OutputParserTester::STDERR - << QString() << QString::fromLatin1("Sometext") + << QString() << QString::fromLatin1("Sometext\n") << QList<ProjectExplorer::Task>() << QString(); @@ -146,7 +146,7 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() " ^\n" "\n") << OutputParserTester::STDERR - << QString() << QString() + << QString() << QString::fromLatin1("\n") << (QList<ProjectExplorer::Task>() << Task(Task::Error, QLatin1String("identifier \"f\" is undefined\nf(0);"), @@ -160,7 +160,7 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() " ^\n" "\n") << OutputParserTester::STDERR - << QString() << QString() + << QString() << QString::fromLatin1("\n") << (QList<ProjectExplorer::Task>() << Task(Task::Error, QLatin1String("function \"AClass::privatefunc\" (declared at line 4 of \"main.h\") is inaccessible\nb.privatefunc();"), @@ -174,7 +174,7 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() " ^\n" "\n") << OutputParserTester::STDERR - << QString() << QString() + << QString() << QString::fromLatin1("\n") << (QList<ProjectExplorer::Task>() << Task(Task::Warning, QLatin1String("use of \"=\" where \"==\" may have been intended\nwhile (a = true)"), diff --git a/src/plugins/projectexplorer/msvcparser.cpp b/src/plugins/projectexplorer/msvcparser.cpp index 1b59a4893e927b76c34ebbd452e5e869a2dca02a..66ef257a80dbdad6f4ab2acf10963bb33bc137b2 100644 --- a/src/plugins/projectexplorer/msvcparser.cpp +++ b/src/plugins/projectexplorer/msvcparser.cpp @@ -163,12 +163,12 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() QTest::newRow("pass-through stdout") << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT - << QString::fromLatin1("Sometext") << QString() + << QString::fromLatin1("Sometext\n") << QString() << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("pass-through stderr") << QString::fromLatin1("Sometext") << OutputParserTester::STDERR - << QString() << QString::fromLatin1("Sometext") + << QString() << QString::fromLatin1("Sometext\n") << QList<ProjectExplorer::Task>() << QString(); diff --git a/src/plugins/projectexplorer/outputparser_test.cpp b/src/plugins/projectexplorer/outputparser_test.cpp index a9311a3910eeb014769c17e0283485a14e69b9d1..a6b273ae66ca3b9d50c2ea626535893bb43fa82e 100644 --- a/src/plugins/projectexplorer/outputparser_test.cpp +++ b/src/plugins/projectexplorer/outputparser_test.cpp @@ -63,9 +63,9 @@ void OutputParserTester::testParsing(const QString &lines, QStringList inputLines = lines.split(QChar('\n')); foreach (const QString &input, inputLines) { if (inputChannel == STDOUT) - childParser()->stdOutput(input); + childParser()->stdOutput(input + QLatin1Char('\n')); else - childParser()->stdError(input); + childParser()->stdError(input + QLatin1Char('\n')); } // first disconnect ourselves from the end of the parser chain again IOutputParser * parser = this; @@ -91,7 +91,7 @@ void OutputParserTester::testParsing(const QString &lines, QCOMPARE(m_receivedTasks.at(i).description, tasks.at(i).description); QCOMPARE(m_receivedTasks.at(i).file, tasks.at(i).file); QCOMPARE(m_receivedTasks.at(i).line, tasks.at(i).line); - QCOMPARE(m_receivedTasks.at(i).type, tasks.at(i).type); + QCOMPARE(static_cast<int>(m_receivedTasks.at(i).type), static_cast<int>(tasks.at(i).type)); } } } @@ -135,15 +135,13 @@ void OutputParserTester::setDebugEnabled(bool debug) void OutputParserTester::stdOutput(const QString &line) { - if (!m_receivedStdOutChildLine.isEmpty()) - m_receivedStdOutChildLine.append(QChar('\n')); + QVERIFY(line.endsWith(QLatin1Char('\n'))); m_receivedStdOutChildLine.append(line); } void OutputParserTester::stdError(const QString &line) { - if (!m_receivedStdErrChildLine.isEmpty()) - m_receivedStdErrChildLine.append(QChar('\n')); + QVERIFY(line.endsWith(QLatin1Char('\n'))); m_receivedStdErrChildLine.append(line); } diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index e60aa89c1d50a45114a1156913533506885b2f1f..5e6bbba1de1cac18333b01470aa3f67351e90b14 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -224,6 +224,9 @@ private slots: void testGccOutputParsers_data(); void testGccOutputParsers(); + void testClangOutputParser_data(); + void testClangOutputParser(); + void testLinuxIccOutputParsers_data(); void testLinuxIccOutputParsers(); diff --git a/src/plugins/qt4projectmanager/qmakeparser.cpp b/src/plugins/qt4projectmanager/qmakeparser.cpp index 342c4e04f4959d8088d3fc93a669ab6736f5c28e..19d8e7332de4d0eac0b653f518ae67b80a446e6f 100644 --- a/src/plugins/qt4projectmanager/qmakeparser.cpp +++ b/src/plugins/qt4projectmanager/qmakeparser.cpp @@ -116,12 +116,12 @@ void Qt4ProjectManagerPlugin::testQmakeOutputParsers_data() QTest::newRow("pass-through stdout") << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT - << QString::fromLatin1("Sometext") << QString() + << QString::fromLatin1("Sometext\n") << QString() << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("pass-through stderr") << QString::fromLatin1("Sometext") << OutputParserTester::STDERR - << QString() << QString::fromLatin1("Sometext") + << QString() << QString::fromLatin1("Sometext\n") << QList<ProjectExplorer::Task>() << QString(); diff --git a/src/plugins/qt4projectmanager/qt-s60/abldparser.cpp b/src/plugins/qt4projectmanager/qt-s60/abldparser.cpp index 248d0f464707399e595c340ea8fcd000058923ba..c54786eec276b517832c1f2fa9dca9a942af3d2f 100644 --- a/src/plugins/qt4projectmanager/qt-s60/abldparser.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/abldparser.cpp @@ -210,12 +210,12 @@ void Qt4ProjectManagerPlugin::testAbldOutputParsers_data() QTest::newRow("pass-through stdout") << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT - << QString::fromLatin1("Sometext") << QString() + << QString::fromLatin1("Sometext\n") << QString() << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("pass-through stderr") << QString::fromLatin1("Sometext") << OutputParserTester::STDERR - << QString() << QString::fromLatin1("Sometext") + << QString() << QString::fromLatin1("Sometext\n") << QList<ProjectExplorer::Task>() << QString(); } diff --git a/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp b/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp index ebb89ba95a5865facfac732f8c7dcbef7edb539d..54b1e4ecfb6cd5664423bcc42bef06424885d6ac 100644 --- a/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp @@ -157,12 +157,12 @@ void Qt4ProjectManagerPlugin::testRvctOutputParser_data() QTest::newRow("pass-through stdout") << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT - << QString::fromLatin1("Sometext") << QString() + << QString::fromLatin1("Sometext\n") << QString() << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("pass-through stderr") << QString::fromLatin1("Sometext") << OutputParserTester::STDERR - << QString() << QString::fromLatin1("Sometext") + << QString() << QString::fromLatin1("Sometext\n") << QList<ProjectExplorer::Task>() << QString(); diff --git a/src/plugins/qt4projectmanager/qtparser.cpp b/src/plugins/qt4projectmanager/qtparser.cpp index a32e63ec67d152bcf02f55245eb28747c85f7dff..5af65d36cecc506b792134ab8d6e4dd89c1c3c42 100644 --- a/src/plugins/qt4projectmanager/qtparser.cpp +++ b/src/plugins/qt4projectmanager/qtparser.cpp @@ -98,12 +98,12 @@ void Qt4ProjectManagerPlugin::testQtOutputParser_data() QTest::newRow("pass-through stdout") << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT - << QString::fromLatin1("Sometext") << QString() + << QString::fromLatin1("Sometext\n") << QString() << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("pass-through stderr") << QString::fromLatin1("Sometext") << OutputParserTester::STDERR - << QString() << QString::fromLatin1("Sometext") + << QString() << QString::fromLatin1("Sometext\n") << QList<ProjectExplorer::Task>() << QString(); QTest::newRow("pass-through gcc infos") @@ -111,7 +111,7 @@ void Qt4ProjectManagerPlugin::testQtOutputParser_data() "../../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") + "../../scriptbug/main.cpp:22: instantiated from here") << OutputParserTester::STDERR << QString() << QString::fromLatin1("/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n"