ProjectExplorer: Use string lists to represent lines

... in the OutputParserTest.
All those trailing newlines in particular were enormously confusing.

Change-Id: I8b661402f4ae8c648c7d0ec662649e11da977616
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2024-11-20 17:27:26 +01:00
parent d7bc681ed9
commit b8ce8c146e
19 changed files with 418 additions and 425 deletions

View File

@@ -244,33 +244,33 @@ void IarParserTest::testIarOutputParsers_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<Tasks >("tasks");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks>("tasks");
QTest::newRow("pass-through stdout")
<< "Sometext" << OutputParserTester::STDOUT
<< "Sometext\n" << QString()
<< QStringList("Sometext") << QStringList()
<< Tasks();
QTest::newRow("pass-through stderr")
<< "Sometext" << OutputParserTester::STDERR
<< QString() << "Sometext\n"
<< QStringList() << QStringList("Sometext")
<< Tasks();
// For std out.
QTest::newRow("Error in command line")
<< QString::fromLatin1("Error in command line: Some error")
<< OutputParserTester::STDOUT
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"Error in command line: Some error"));
QTest::newRow("Linker error")
<< QString::fromLatin1("Error[e46]: Some error")
<< OutputParserTester::STDOUT
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"[e46]: Some error"));
@@ -279,8 +279,8 @@ void IarParserTest::testIarOutputParsers_data()
<< QString::fromLatin1("\"c:\\foo\\main.c\",63 Warning[Pe223]:\n"
" Some warning \"foo\" bar")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Warning,
"[Pe223]: Some warning \"foo\" bar",
Utils::FilePath::fromUserInput("c:\\foo\\main.c"),
@@ -292,8 +292,8 @@ void IarParserTest::testIarOutputParsers_data()
"\"c:\\foo\\main.c\",63 Warning[Pe223]:\n"
" Some warning")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Warning,
"[Pe223]: Some warning\n"
" some_detail;\n"
@@ -306,8 +306,8 @@ void IarParserTest::testIarOutputParsers_data()
" Some warning\n"
" , split")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Warning,
"[Pe223]: Some warning, split",
FilePath::fromUserInput("c:\\foo\\main.c"),
@@ -317,8 +317,8 @@ void IarParserTest::testIarOutputParsers_data()
<< QString::fromLatin1("\"c:\\foo\\main.c\",63 Error[Pe223]:\n"
" Some error")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"[Pe223]: Some error",
FilePath::fromUserInput("c:\\foo\\main.c"),
@@ -330,8 +330,8 @@ void IarParserTest::testIarOutputParsers_data()
"\"c:\\foo\\main.c\",63 Error[Pe223]:\n"
" Some error")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"[Pe223]: Some error\n"
" some_detail;\n"
@@ -344,8 +344,8 @@ void IarParserTest::testIarOutputParsers_data()
" Some error\n"
" , split")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"[Pe223]: Some error, split",
FilePath::fromUserInput("c:\\foo\\main.c"),
@@ -357,8 +357,8 @@ void IarParserTest::testIarOutputParsers_data()
" n.c.o\n"
"]")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"[Li005]: Some error \"foo\"",
FilePath::fromUserInput("c:\\foo\\bar\\main.c.o")));
@@ -369,8 +369,8 @@ void IarParserTest::testIarOutputParsers_data()
" c:\\bar.c\n"
"Fatal error detected, aborting.")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"[Su011]: Some error:\n"
" c:\\foo.c\n"
@@ -379,8 +379,8 @@ void IarParserTest::testIarOutputParsers_data()
QTest::newRow("At end of source")
<< QString::fromLatin1("At end of source Error[Pe040]: Some error \";\"")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"[Pe040]: Some error \";\""));
}
@@ -392,8 +392,8 @@ void IarParserTest::testIarOutputParsers()
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(Tasks, tasks);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
testbench.testParsing(input, inputChannel, tasks, childStdOutLines, childStdErrLines);
}

View File

@@ -266,17 +266,17 @@ void KeilParserTest::testKeilOutputParsers_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks >("tasks");
QTest::newRow("pass-through stdout")
<< "Sometext" << OutputParserTester::STDOUT
<< "Sometext\n" << QString()
<< QStringList("Sometext") << QStringList()
<< Tasks();
QTest::newRow("pass-through stderr")
<< "Sometext" << OutputParserTester::STDERR
<< QString() << "Sometext\n"
<< QStringList() << QStringList("Sometext")
<< Tasks();
// ARM compiler specific patterns.
@@ -284,8 +284,8 @@ void KeilParserTest::testKeilOutputParsers_data()
QTest::newRow("ARM: No details warning")
<< QString::fromLatin1("\"c:\\foo\\main.c\", line 63: Warning: #1234: Some warning")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Warning,
"#1234: Some warning",
FilePath::fromUserInput("c:\\foo\\main.c"),
@@ -296,8 +296,8 @@ void KeilParserTest::testKeilOutputParsers_data()
" int f;\n"
" ^")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Warning,
"#1234: Some warning\n"
" int f;\n"
@@ -308,8 +308,8 @@ void KeilParserTest::testKeilOutputParsers_data()
QTest::newRow("ARM: No details error")
<< QString::fromLatin1("\"c:\\foo\\main.c\", line 63: Error: #1234: Some error")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"#1234: Some error",
FilePath::fromUserInput("c:\\foo\\main.c"),
@@ -318,8 +318,8 @@ void KeilParserTest::testKeilOutputParsers_data()
QTest::newRow("ARM: No details error with column")
<< QString::fromLatin1("\"flash.sct\", line 51 (column 20): Error: L1234: Some error")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"L1234: Some error",
FilePath::fromUserInput("flash.sct"),
@@ -330,8 +330,8 @@ void KeilParserTest::testKeilOutputParsers_data()
" int f;\n"
" ^")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"#1234: Some error\n"
" int f;\n"
@@ -342,8 +342,8 @@ void KeilParserTest::testKeilOutputParsers_data()
QTest::newRow("ARM: At end of source")
<< QString::fromLatin1("\"c:\\foo\\main.c\", line 71: Error: At end of source: #40: Some error")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"#40: Some error",
FilePath::fromUserInput("c:\\foo\\main.c"),
@@ -352,8 +352,8 @@ void KeilParserTest::testKeilOutputParsers_data()
QTest::newRow("ARM: Starts with error")
<< QString::fromLatin1("Error: L6226E: Some error.")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"L6226E: Some error."));
@@ -363,8 +363,8 @@ void KeilParserTest::testKeilOutputParsers_data()
QTest::newRow("MCS51: Assembler simple warning")
<< QString::fromLatin1("*** WARNING #A9 IN 15 (c:\\foo\\dscr.a51, LINE 15): Some warning")
<< OutputParserTester::STDOUT
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Warning,
"#A9: Some warning",
FilePath::fromUserInput("c:\\foo\\dscr.a51"),
@@ -373,8 +373,8 @@ void KeilParserTest::testKeilOutputParsers_data()
QTest::newRow("MCS51: Assembler simple error")
<< QString::fromLatin1("*** ERROR #A9 IN 15 (c:\\foo\\dscr.a51, LINE 15): Some error")
<< OutputParserTester::STDOUT
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"#A9: Some error",
FilePath::fromUserInput("c:\\foo\\dscr.a51"),
@@ -385,8 +385,8 @@ void KeilParserTest::testKeilOutputParsers_data()
" Some detail 1\n"
" Some detail N")
<< OutputParserTester::STDOUT
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"Assembler fatal error\n"
" Some detail 1\n"
@@ -397,8 +397,8 @@ void KeilParserTest::testKeilOutputParsers_data()
"*** ___^\n"
"*** ERROR #A45 IN 28 (d:\\foo.a51, LINE 28): Some error")
<< OutputParserTester::STDOUT
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"#A45: Some error\n"
" Some detail\n"
@@ -410,8 +410,8 @@ void KeilParserTest::testKeilOutputParsers_data()
QTest::newRow("MCS51: Compiler simple warning")
<< QString::fromLatin1("*** WARNING C123 IN LINE 13 OF c:\\foo.c: Some warning")
<< OutputParserTester::STDOUT
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Warning,
"C123: Some warning",
FilePath::fromUserInput("c:\\foo.c"),
@@ -420,8 +420,8 @@ void KeilParserTest::testKeilOutputParsers_data()
QTest::newRow("MCS51: Compiler extended warning")
<< QString::fromLatin1("*** WARNING C123 IN LINE 13 OF c:\\foo.c: Some warning : 'extended text'")
<< OutputParserTester::STDOUT
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Warning,
"C123: Some warning : 'extended text'",
FilePath::fromUserInput("c:\\foo.c"),
@@ -430,8 +430,8 @@ void KeilParserTest::testKeilOutputParsers_data()
QTest::newRow("MCS51: Compiler simple error")
<< QString::fromLatin1("*** ERROR C123 IN LINE 13 OF c:\\foo.c: Some error")
<< OutputParserTester::STDOUT
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"C123: Some error",
FilePath::fromUserInput("c:\\foo.c"),
@@ -440,8 +440,8 @@ void KeilParserTest::testKeilOutputParsers_data()
QTest::newRow("MCS51: Compiler extended error")
<< QString::fromLatin1("*** ERROR C123 IN LINE 13 OF c:\\foo.c: Some error : 'extended text'")
<< OutputParserTester::STDOUT
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"C123: Some error : 'extended text'",
FilePath::fromUserInput("c:\\foo.c"),
@@ -452,8 +452,8 @@ void KeilParserTest::testKeilOutputParsers_data()
" Some detail 1\n"
" Some detail N")
<< OutputParserTester::STDOUT
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"Compiler fatal error\n"
" Some detail 1\n"
@@ -464,8 +464,8 @@ void KeilParserTest::testKeilOutputParsers_data()
<< QString::fromLatin1("*** WARNING L16: Some warning\n"
" Some detail 1")
<< OutputParserTester::STDOUT
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Warning,
"L16: Some warning\n"
" Some detail 1"));
@@ -473,8 +473,8 @@ void KeilParserTest::testKeilOutputParsers_data()
QTest::newRow("MCS51: Linker simple fatal error")
<< QString::fromLatin1("*** FATAL ERROR L456: Some error")
<< OutputParserTester::STDOUT
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"L456: Some error"));
@@ -483,8 +483,8 @@ void KeilParserTest::testKeilOutputParsers_data()
" Some detail 1\n"
" Some detail N")
<< OutputParserTester::STDOUT
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"L456: Some error\n"
" Some detail 1\n"
@@ -498,8 +498,8 @@ void KeilParserTest::testKeilOutputParsers()
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(Tasks, tasks);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
testbench.testParsing(input, inputChannel, tasks, childStdOutLines, childStdErrLines);
}

View File

@@ -159,17 +159,17 @@ void SdccParserTest::testSdccOutputParsers_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<Tasks >("tasks");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks>("tasks");
QTest::newRow("pass-through stdout")
<< "Sometext" << OutputParserTester::STDOUT
<< "Sometext\n" << QString()
<< QStringList("Sometext") << QStringList()
<< Tasks();
QTest::newRow("pass-through stderr")
<< "Sometext" << OutputParserTester::STDERR
<< QString() << "Sometext\n"
<< QStringList() << QStringList("Sometext")
<< Tasks();
// Compiler messages.
@@ -177,8 +177,8 @@ void SdccParserTest::testSdccOutputParsers_data()
QTest::newRow("Assembler error")
<< QString::fromLatin1("c:\\foo\\main.c:63: Error: Some error")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"Some error",
FilePath::fromUserInput("c:\\foo\\main.c"),
@@ -187,8 +187,8 @@ void SdccParserTest::testSdccOutputParsers_data()
QTest::newRow("Compiler single line warning")
<< QString::fromLatin1("c:\\foo\\main.c:63: warning 123: Some warning")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Warning,
"Some warning",
FilePath::fromUserInput("c:\\foo\\main.c"),
@@ -199,8 +199,8 @@ void SdccParserTest::testSdccOutputParsers_data()
"details #1\n"
" details #2")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Warning,
"Some warning\n"
"details #1\n"
@@ -211,8 +211,8 @@ void SdccParserTest::testSdccOutputParsers_data()
QTest::newRow("Compiler simple single line error")
<< QString::fromLatin1("c:\\foo\\main.c:63: error: Some error")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"Some error",
FilePath::fromUserInput("c:\\foo\\main.c"),
@@ -221,8 +221,8 @@ void SdccParserTest::testSdccOutputParsers_data()
QTest::newRow("Compiler single line error")
<< QString::fromLatin1("c:\\foo\\main.c:63: error 123: Some error")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"Some error",
FilePath::fromUserInput("c:\\foo\\main.c"),
@@ -233,8 +233,8 @@ void SdccParserTest::testSdccOutputParsers_data()
"details #1\n"
" details #2")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"Some error\n"
"details #1\n"
@@ -245,8 +245,8 @@ void SdccParserTest::testSdccOutputParsers_data()
QTest::newRow("Compiler syntax error")
<< QString::fromLatin1("c:\\foo\\main.c:63: syntax error: Some error")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"Some error",
FilePath::fromUserInput("c:\\foo\\main.c"),
@@ -255,32 +255,32 @@ void SdccParserTest::testSdccOutputParsers_data()
QTest::newRow("Compiler bad option error")
<< QString::fromLatin1("at 1: error 123: Some error")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"Some error"));
QTest::newRow("Compiler bad option warning")
<< QString::fromLatin1("at 1: warning 123: Some warning")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Warning,
"Some warning"));
QTest::newRow("Linker warning")
<< QString::fromLatin1("?ASlink-Warning-Couldn't find library 'foo.lib'")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Warning,
"Couldn't find library 'foo.lib'"));
QTest::newRow("Linker error")
<< QString::fromLatin1("?ASlink-Error-<cannot open> : \"foo.rel\"")
<< OutputParserTester::STDERR
<< QString()
<< QString()
<< QStringList()
<< QStringList()
<< (Tasks() << CompileTask(Task::Error,
"<cannot open> : \"foo.rel\""));
}
@@ -292,8 +292,8 @@ void SdccParserTest::testSdccOutputParsers()
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(Tasks, tasks);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
testbench.testParsing(input, inputChannel, tasks, childStdOutLines, childStdErrLines);
}

View File

@@ -116,17 +116,17 @@ void CMakeAutogenParserTest::testCMakeAutogenParser_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks>("tasks");
// negative tests
QTest::newRow("pass-through stdout")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString::fromLatin1("Sometext\n") << QString() << Tasks();
<< QStringList("Sometext") << QStringList() << Tasks();
QTest::newRow("pass-through stderr")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR << QString()
<< QString::fromLatin1("Sometext\n") << Tasks();
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR << QStringList()
<< QStringList("Sometext") << Tasks();
// positive tests
QTest::newRow("AutoMoc error") << R"(AutoMoc error
@@ -136,7 +136,7 @@ contains a "Q_OBJECT" macro, but does not include "main.moc"!
Consider to
- add #include "main.moc"
- enable SKIP_AUTOMOC for this file)"
<< OutputParserTester::STDERR << QString() << QString()
<< OutputParserTester::STDERR << QStringList() << QStringList()
<< (Tasks() << BuildSystemTask(
Task::Error,
R"(AutoMoc error
@@ -155,7 +155,7 @@ into
included by
"BIN:/src/quickcontrols/basic/impl/qtquickcontrols2basicstyleimplplugin_QtQuickControls2BasicStyleImplPlugin.cpp"
Process failed with return value 1)" << OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks() << BuildSystemTask(
Task::Error,
R"(AutoMoc subprocess error
@@ -173,7 +173,7 @@ includes the moc file "device_p.moc" instead of "moc_device_p.cpp". Running
moc on "/home/alex/src/CMake/tests/solid.orig/solid/solid/device_p.h" !
Include "moc_device_p.cpp" for compatibility with strict mode (see
CMAKE_AUTOMOC_RELAXED_MODE).)" << OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks() << BuildSystemTask(
Task::Warning,
R"(AUTOMOC: warning:
@@ -187,7 +187,7 @@ CMAKE_AUTOMOC_RELAXED_MODE).)"));
---------------
"SRC:/src/main.cpp"
includes the moc file "main.moc", but does not contain a Q_OBJECT, Q_GADGET, Q_NAMESPACE, Q_NAMESPACE_EXPORT, Q_GADGET_EXPORT, Q_ENUM_NS, K_PLUGIN_FACTORY, K_PLUGIN_CLASS, K_PLUGIN_FACTORY_WITH_JSON or K_PLUGIN_CLASS_WITH_JSON macro.)"
<< OutputParserTester::STDERR << QString() << QString()
<< OutputParserTester::STDERR << QStringList() << QStringList()
<< (Tasks() << BuildSystemTask(
Task::Warning,
R"(AutoMoc warning
@@ -201,7 +201,7 @@ includes the uic file "ui_global.h",
but the user interface file "global.ui"
could not be found in the following directories
"SRC:/monitor/ui")" << OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks() << BuildSystemTask(
Task::Error,
R"(AutoUic error
@@ -219,8 +219,8 @@ void CMakeAutogenParserTest::testCMakeAutogenParser()
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(Tasks, tasks);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
testbench.testParsing(input, inputChannel, tasks, childStdOutLines, childStdErrLines);
}

View File

@@ -273,18 +273,18 @@ void CMakeOutputParserTest::testCMakeOutputParser_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks>("tasks");
// negative tests
QTest::newRow("pass-through stdout")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString::fromLatin1("Sometext\n") << QString()
<< QStringList("Sometext") << QStringList()
<< Tasks();
QTest::newRow("pass-through stderr")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR
<< QString() << QString::fromLatin1("Sometext\n")
<< QStringList() << QStringList("Sometext")
<< Tasks();
// positive tests
@@ -300,7 +300,7 @@ void CMakeOutputParserTest::testCMakeOutputParser_data()
" Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp\n"
" .hxx .in .txx\n\n")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Error,
"Cannot find source file:\n\n"
@@ -320,7 +320,7 @@ void CMakeOutputParserTest::testCMakeOutputParser_data()
<< QString::fromLatin1("CMake Error at src/1/CMakeLists.txt:8 (add_subdirectory):\n"
" add_subdirectory given source \"app1\" which is not an existing directory.\n\n")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Error,
"add_subdirectory given source \"app1\" which is not an existing directory.",
@@ -330,7 +330,7 @@ void CMakeOutputParserTest::testCMakeOutputParser_data()
<< QString::fromLatin1("CMake Error at src/1/CMakeLists.txt:8 (i_am_wrong_command):\n"
" Unknown CMake command \"i_am_wrong_command\".\n\n")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Error,
"Unknown CMake command \"i_am_wrong_command\".",
@@ -340,7 +340,7 @@ void CMakeOutputParserTest::testCMakeOutputParser_data()
<< QString::fromLatin1("CMake Error at src/1/CMakeLists.txt:8 (message):\n"
" message called with incorrect number of arguments\n\n")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Error,
"message called with incorrect number of arguments",
@@ -352,7 +352,7 @@ void CMakeOutputParserTest::testCMakeOutputParser_data()
"Parse error. Expected \"(\", got newline with text \"\n"
"\".")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Error,
"Parse error. Expected \"(\", got newline with text \"\n\".",
@@ -361,9 +361,9 @@ void CMakeOutputParserTest::testCMakeOutputParser_data()
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")
"CMAKE_MAKE_PROGRAM\n\n") // FIXME: Test does not pass without extra newline
<< OutputParserTester::STDERR
<< QString() << QString("Missing variable is:\nCMAKE_MAKE_PROGRAM\n")
<< QStringList() << QStringList{"Missing variable is:", "CMAKE_MAKE_PROGRAM"}
<< (Tasks()
<< BuildSystemTask(Task::Error,
"Error required internal CMake variable not set, "
@@ -375,7 +375,7 @@ void CMakeOutputParserTest::testCMakeOutputParser_data()
"\n"
" \".\n")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Error,
"Parse error. Expected \"(\", got newline with text \"\n"
@@ -388,7 +388,7 @@ void CMakeOutputParserTest::testCMakeOutputParser_data()
"/test/path/CMakeLists.txt:9:15\n"
"Argument not separated from preceding token by whitespace.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Warning,
"Argument not separated from preceding token by whitespace.",
@@ -398,7 +398,7 @@ void CMakeOutputParserTest::testCMakeOutputParser_data()
<< QString::fromLatin1("CMake Warning at CMakeLists.txt:13 (message):\n"
" this is a warning\n\n")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Warning,
"this is a warning",
@@ -408,7 +408,7 @@ void CMakeOutputParserTest::testCMakeOutputParser_data()
<< QString::fromLatin1("CMake Warning (dev) at CMakeLists.txt:15 (message):\n"
" this is an author warning\n\n")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Warning,
"this is an author warning",
@@ -417,7 +417,7 @@ void CMakeOutputParserTest::testCMakeOutputParser_data()
QTest::newRow("eat normal CMake output")
<< QString::fromLatin1("-- Qt5 install prefix: /usr/lib\n"
" * Plugin componentsplugin, with CONDITION TARGET QmlDesigner")
<< OutputParserTester::STDERR << QString() << QString() << (Tasks());
<< OutputParserTester::STDERR << QStringList() << QStringList() << (Tasks());
QTest::newRow("cmake call-stack")
<< QString::fromLatin1(
@@ -437,7 +437,7 @@ void CMakeOutputParserTest::testCMakeOutputParser_data()
" /Qt/6.5.3/mingw_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:741 "
"(qt6_add_executable)\n"
" /Projects/Test-Project/CMakeLists.txt:13 (qt_add_executable)\n")
<< OutputParserTester::STDERR << QString() << QString()
<< OutputParserTester::STDERR << QStringList() << QStringList()
<< (Tasks() << BuildSystemTask(
Task::Error,
"\n"
@@ -468,8 +468,8 @@ void CMakeOutputParserTest::testCMakeOutputParser()
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(Tasks, tasks);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
testbench.testParsing(input, inputChannel, tasks, childStdOutLines, childStdErrLines);
}

View File

@@ -58,25 +58,25 @@ void NimParserTest::testNimParser_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks >("tasks");
// negative tests
QTest::newRow("pass-through stdout")
<< "Sometext" << OutputParserTester::STDOUT
<< "Sometext\n" << QString()
<< QStringList("Sometext") << QStringList()
<< Tasks();
QTest::newRow("pass-through stderr")
<< "Sometext" << OutputParserTester::STDERR
<< QString() << "Sometext\n"
<< QStringList() << QStringList("Sometext")
<< Tasks();
// positive tests
QTest::newRow("Parse error string")
<< QString::fromLatin1("main.nim(23, 1) Error: undeclared identifier: 'x'")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Error,
"Error: undeclared identifier: 'x'",
FilePath::fromUserInput("main.nim"), 23)});
@@ -84,7 +84,7 @@ void NimParserTest::testNimParser_data()
QTest::newRow("Parse warning string")
<< QString::fromLatin1("lib/pure/parseopt.nim(56, 34) Warning: quoteIfContainsWhite is deprecated [Deprecated]")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Warning,
"Warning: quoteIfContainsWhite is deprecated [Deprecated]",
FilePath::fromUserInput("lib/pure/parseopt.nim"), 56)});
@@ -97,8 +97,8 @@ void NimParserTest::testNimParser()
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(Tasks, tasks);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
testbench.testParsing(input, inputChannel, tasks, childStdOutLines, childStdErrLines);
}

View File

@@ -126,9 +126,9 @@ void ProjectExplorerTest::testClangOutputParser_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<Tasks >("tasks");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks>("tasks");
auto compileTask = [](Task::TaskType type,
const QString &description,
@@ -152,18 +152,18 @@ void ProjectExplorerTest::testClangOutputParser_data()
QTest::newRow("pass-through stdout")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString::fromLatin1("Sometext\n") << QString()
<< QStringList("Sometext") << QStringList()
<< Tasks();
QTest::newRow("pass-through stderr")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR
<< QString() << QString::fromLatin1("Sometext\n")
<< QStringList() << QStringList("Sometext")
<< Tasks();
QTest::newRow("clang++ warning")
<< QString::fromLatin1("clang++: warning: argument unused during compilation: '-mthreads'")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"argument unused during compilation: '-mthreads'"));
@@ -171,7 +171,7 @@ void ProjectExplorerTest::testClangOutputParser_data()
QTest::newRow("clang++ error")
<< QString::fromLatin1("clang++: error: no input files [err_drv_no_input_files]")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"no input files [err_drv_no_input_files]"));
@@ -182,7 +182,7 @@ void ProjectExplorerTest::testClangOutputParser_data()
"class Q_CORE_EXPORT QSysInfo {\n"
" ^")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks{compileTask(
Task::Warning,
"unknown attribute 'dllimport' ignored [-Wunknown-attributes]\n"
@@ -200,7 +200,7 @@ void ProjectExplorerTest::testClangOutputParser_data()
"# define Q_CORE_EXPORT Q_DECL_IMPORT\n"
" ^")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Unknown,
"instantiated from:\n"
@@ -217,7 +217,7 @@ void ProjectExplorerTest::testClangOutputParser_data()
"#include <bits/c++config.h>\n"
" ^")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Error,
"'bits/c++config.h' file not found\n"
@@ -236,7 +236,7 @@ void ProjectExplorerTest::testClangOutputParser_data()
" int x = option->rect.x() + horizontal ? 2 : 6;\n"
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Warning,
"?: has lower precedence than +; + will be evaluated first [-Wparentheses]\n"
@@ -255,7 +255,7 @@ void ProjectExplorerTest::testClangOutputParser_data()
"Code Sign error: No matching provisioning profiles found: No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) were found.\n"
"CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.0'")
<< OutputParserTester::STDERR
<< QString() << QString::fromLatin1("Check dependencies\n")
<< QStringList() << QStringList("Check dependencies")
<< (Tasks()
<< CompileTask(Task::Error,
"No matching provisioning profiles found: No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) were found.")
@@ -270,8 +270,8 @@ void ProjectExplorerTest::testClangOutputParser()
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(Tasks, tasks);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
testbench.testParsing(input, inputChannel, tasks, childStdOutLines, childStdErrLines);
}

View File

@@ -373,10 +373,9 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
QTest::addColumn<int>("warningFileNameCap");
QTest::addColumn<int>("warningLineNumberCap");
QTest::addColumn<int>("warningMessageCap");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<Tasks >("tasks");
QTest::addColumn<QString>("outputLines");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks>("tasks");
const QString simplePattern = "^([a-z]+\\.[a-z]+):(\\d+): error: ([^\\s].+)$";
const FilePath fileName = FilePath::fromUserInput("main.c");
@@ -388,7 +387,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseBothChannels
<< QString() << 1 << 2 << 3
<< QString() << 1 << 2 << 3
<< QString::fromLatin1("Sometext\n") << QString()
<< QStringList("Sometext") << QStringList()
<< Tasks();
QTest::newRow("pass-through stdout")
@@ -398,7 +397,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseBothChannels
<< simplePattern << 1 << 2 << 3
<< QString() << 1 << 2 << 3
<< QString::fromLatin1("Sometext\n") << QString()
<< QStringList("Sometext") << QStringList()
<< Tasks();
QTest::newRow("pass-through stderr")
@@ -408,11 +407,10 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseBothChannels
<< simplePattern << 1 << 2 << 3
<< QString() << 1 << 2 << 3
<< QString() << QString::fromLatin1("Sometext\n")
<< QStringList() << QStringList("Sometext")
<< Tasks();
const QString simpleError = "main.c:9: error: `sfasdf' undeclared (first use this function)";
const QString simpleErrorPassThrough = simpleError + '\n';
const QString message = "`sfasdf' undeclared (first use this function)";
QTest::newRow("simple error")
@@ -422,7 +420,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseBothChannels
<< simplePattern << 1 << 2 << 3
<< QString() << 0 << 0 << 0
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Error, message, fileName, 9)});
const QString pathPattern = "^([a-z\\./]+):(\\d+): error: ([^\\s].+)$";
@@ -436,7 +434,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseBothChannels
<< pathPattern << 1 << 2 << 3
<< QString() << 0 << 0 << 0
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Error, message, expandedFileName, 9)});
expandedFileName = "/home/src/project/subdir/main.c";
@@ -447,7 +445,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseBothChannels
<< pathPattern << 1 << 2 << 3
<< QString() << 0 << 0 << 0
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Error, message, expandedFileName, 9)});
workingDir = "/home/src/build-project";
@@ -458,7 +456,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseBothChannels
<< pathPattern << 1 << 2 << 3
<< QString() << 0 << 0 << 0
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Error, message, expandedFileName, 9)});
QTest::newRow("simple error on wrong channel")
@@ -468,7 +466,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseStdErrChannel << CustomParserExpression::ParseBothChannels
<< simplePattern << 1 << 2 << 3
<< QString() << 0 << 0 << 0
<< simpleErrorPassThrough << QString()
<< QStringList(simpleError) << QStringList()
<< Tasks();
QTest::newRow("simple error on other wrong channel")
@@ -478,7 +476,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseStdOutChannel << CustomParserExpression::ParseBothChannels
<< simplePattern << 1 << 2 << 3
<< QString() << 0 << 0 << 0
<< QString() << simpleErrorPassThrough
<< QStringList() << QStringList(simpleError)
<< Tasks();
const QString simpleError2 = "Error: Line 19 in main.c: `sfasdf' undeclared (first use this function)";
@@ -492,7 +490,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseBothChannels
<< simplePattern2 << 2 << 1 << 3
<< QString() << 1 << 2 << 3
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Error, message, fileName, lineNumber2)});
QTest::newRow("another simple error on stdout")
@@ -502,7 +500,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseBothChannels
<< simplePattern2 << 2 << 1 << 3
<< QString() << 1 << 2 << 3
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Error, message, fileName, lineNumber2)});
const QString simpleWarningPattern = "^([a-z]+\\.[a-z]+):(\\d+): warning: ([^\\s].+)$";
@@ -516,11 +514,10 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseBothChannels
<< QString() << 1 << 2 << 3
<< simpleWarningPattern << 1 << 2 << 3
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Warning, warningMessage, fileName, 1234)});
const QString simpleWarning2 = "Warning: `helloWorld' declared but not used (main.c:19)";
const QString simpleWarningPassThrough2 = simpleWarning2 + '\n';
const QString simpleWarningPattern2 = "^Warning: (.*) \\(([a-z]+\\.[a-z]+):(\\d+)\\)$";
QTest::newRow("another simple warning on stdout")
@@ -530,7 +527,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseStdOutChannel
<< simplePattern2 << 1 << 2 << 3
<< simpleWarningPattern2 << 2 << 3 << 1
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Warning, warningMessage, fileName, lineNumber2)});
QTest::newRow("warning on wrong channel")
@@ -540,7 +537,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseStdErrChannel
<< QString() << 1 << 2 << 3
<< simpleWarningPattern2 << 2 << 3 << 1
<< simpleWarningPassThrough2 << QString()
<< QStringList(simpleWarning2) << QStringList()
<< Tasks();
QTest::newRow("warning on other wrong channel")
@@ -550,7 +547,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseStdOutChannel
<< QString() << 1 << 2 << 3
<< simpleWarningPattern2 << 2 << 3 << 1
<< QString() << simpleWarningPassThrough2
<< QStringList() << QStringList(simpleWarning2)
<< Tasks();
QTest::newRow("error and *warning*")
@@ -560,7 +557,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseBothChannels
<< simplePattern << 1 << 2 << 3
<< simpleWarningPattern << 1 << 2 << 3
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Warning, warningMessage, fileName, 1234)});
QTest::newRow("*error* when equal pattern")
@@ -570,7 +567,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseBothChannels
<< simplePattern << 1 << 2 << 3
<< simplePattern << 1 << 2 << 3
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Error, message, fileName, 9)});
const QString unitTestError = "../LedDriver/LedDriverTest.c:63: FAIL: Expected 0x0080 Was 0xffff";
@@ -586,7 +583,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels << CustomParserExpression::ParseBothChannels
<< unitTestPattern << 1 << 2 << 3
<< QString() << 1 << 2 << 3
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Error, unitTestMessage, unitTestFileName, unitTestLineNumber)});
const QString leadingSpacesPattern = "^ MESSAGE:(.+)";
@@ -600,7 +597,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels
<< leadingSpacesPattern << 2 << 3 << 1
<< QString() << 1 << 2 << 3
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Error, "Error", {}, -1)});
QTest::newRow("leading spaces: no match")
<< noLeadingSpacesMessage
@@ -610,7 +607,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels
<< leadingSpacesPattern << 2 << 3 << 1
<< QString() << 1 << 2 << 3
<< (noLeadingSpacesMessage + '\n') << QString()
<< QStringList(noLeadingSpacesMessage) << QStringList()
<< Tasks();
const QString noLeadingSpacesPattern = "^MESSAGE:(.+)";
QTest::newRow("no leading spaces: match")
@@ -621,7 +618,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels
<< noLeadingSpacesPattern << 2 << 3 << 1
<< QString() << 1 << 2 << 3
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Error, "Error", {}, -1)});
QTest::newRow("no leading spaces: no match")
<< leadingSpacesMessage
@@ -631,7 +628,7 @@ void ProjectExplorerTest::testCustomOutputParsers_data()
<< CustomParserExpression::ParseBothChannels
<< noLeadingSpacesPattern << 3 << 2 << 1
<< QString() << 1 << 2 << 3
<< (leadingSpacesMessage + '\n') << QString()
<< QStringList(leadingSpacesMessage) << QStringList()
<< Tasks();
}
@@ -650,8 +647,8 @@ void ProjectExplorerTest::testCustomOutputParsers()
QFETCH(int, warningFileNameCap);
QFETCH(int, warningLineNumberCap);
QFETCH(int, warningMessageCap);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
QFETCH(Tasks, tasks);
CustomParserSettings settings;

View File

@@ -292,8 +292,8 @@ void ProjectExplorerTest::testGccOutputParsers_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks >("tasks");
auto compileTask = [](Task::TaskType type,
@@ -318,17 +318,17 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("pass-through stdout")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString::fromLatin1("Sometext\n") << QString()
<< QStringList("Sometext") << QStringList()
<< Tasks();
QTest::newRow("pass-through stderr")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR
<< QString() << QString::fromLatin1("Sometext\n")
<< QStringList() << QStringList("Sometext")
<< Tasks();
QTest::newRow("ar output")
<< QString::fromLatin1("../../../../x86/i686-unknown-linux-gnu/bin/i686-unknown-linux-gnu-ar: creating lib/libSkyView.a") << OutputParserTester::STDERR
<< QString() << QString::fromLatin1("../../../../x86/i686-unknown-linux-gnu/bin/i686-unknown-linux-gnu-ar: creating lib/libSkyView.a\n")
<< QStringList() << QStringList("../../../../x86/i686-unknown-linux-gnu/bin/i686-unknown-linux-gnu-ar: creating lib/libSkyView.a")
<< Tasks();
QTest::newRow("GCCE error")
@@ -336,7 +336,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
"/temp/test/untitled8/main.cpp:9: error: `sfasdf' undeclared (first use this function)\n"
"/temp/test/untitled8/main.cpp:9: error: (Each undeclared identifier is reported only once for each function it appears in.)")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Error,
"`sfasdf' undeclared (first use this function)\n"
@@ -358,7 +358,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("GCCE warning")
<< QString::fromLatin1("/src/corelib/global/qglobal.h:1635: warning: inline function `QDebug qDebug()' used but never defined")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"inline function `QDebug qDebug()' used but never defined",
@@ -368,7 +368,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("warning")
<< QString::fromLatin1("main.cpp:7:2: warning: Some warning")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"Some warning",
@@ -378,7 +378,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("GCCE #error")
<< QString::fromLatin1("C:\\temp\\test\\untitled8\\main.cpp:7: #error Symbian error")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"#error Symbian error",
@@ -389,7 +389,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("GCCE #warning1")
<< QString::fromLatin1("C:\\temp\\test\\untitled8\\main.cpp:8: warning: #warning Symbian warning")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"#warning Symbian warning",
@@ -399,7 +399,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("GCCE #warning2")
<< QString::fromLatin1("/temp/test/untitled8/main.cpp:8:2: warning: #warning Symbian warning")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"#warning Symbian warning",
@@ -419,7 +419,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
"C:\\temp\\test\\untitled8/main.cpp:8: undefined reference to `MainWindow::doSomething()'\n"
"collect2: ld returned 1 exit status")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Error,
"undefined reference to `MainWindow::doSomething()'\n"
@@ -443,7 +443,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
"C:\\temp\\test\\untitled8/main.cpp:(.text+0x40): undefined reference to `MainWindow::doSomething()'\n"
"collect2: ld returned 1 exit status")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Error,
"undefined reference to `MainWindow::doSomething()'\n"
@@ -457,7 +457,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("linker: dll format not recognized")
<< QString::fromLatin1("c:\\Qt\\4.6\\lib/QtGuid4.dll: file not recognized: File format not recognized")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"file not recognized: File format not recognized",
@@ -466,7 +466,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("Invalid rpath")
<< QString::fromLatin1("g++: /usr/local/lib: No such file or directory")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"/usr/local/lib: No such file or directory"));
@@ -476,7 +476,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
"../../../../master/src/plugins/debugger/gdb/gdbengine.cpp:2114: warning: unused variable 'index'\n"
"../../../../master/src/plugins/debugger/gdb/gdbengine.cpp:2115: warning: unused variable 'handler'")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Warning,
"unused variable 'index'\n"
@@ -496,7 +496,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
"/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp:264: error: expected primary-expression before ':' token\n"
"/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp:264: error: expected ';' before ':' token")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Error,
"expected primary-expression before ':' token\n"
@@ -519,14 +519,14 @@ void ProjectExplorerTest::testGccOutputParsers_data()
<< 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")
<< 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\n")
<< QStringList() << QStringList{"distcc[73168] (dcc_get_hostlist) Warning: no hostlist is set; can't distribute work",
"distcc[73168] (dcc_build_somewhere) Warning: failed to distribute, running locally instead"}
<< Tasks();
QTest::newRow("ld warning (QTCREATORBUG-905)")
<< QString::fromLatin1("ld: warning: Core::IEditor* QVariant::value<Core::IEditor*>() const has different visibility (hidden) in .obj/debug-shared/openeditorsview.o and (default) in .obj/debug-shared/editormanager.o")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"Core::IEditor* QVariant::value<Core::IEditor*>() const has different visibility (hidden) in .obj/debug-shared/openeditorsview.o and (default) in .obj/debug-shared/editormanager.o"));
@@ -534,7 +534,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("ld fatal")
<< QString::fromLatin1("ld: fatal: Symbol referencing errors. No output written to testproject")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"Symbol referencing errors. No output written to testproject"));
@@ -542,13 +542,13 @@ void ProjectExplorerTest::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...\n")
<< QStringList() << QStringList("TeamBuilder Client:: error: could not find Scheduler, running Job locally...")
<< Tasks();
QTest::newRow("note")
<< QString::fromLatin1("/home/dev/creator/share/qtcreator/debugger/dumper.cpp:1079: note: initialized from here")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Unknown,
"initialized from here",
@@ -559,7 +559,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
<< QString::fromLatin1("/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c: In static member function 'static std::_Rb_tree_node_base* std::_Rb_global<_Dummy>::_Rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*&, std::_Rb_tree_node_base*&, std::_Rb_tree_node_base*&)':\n"
"/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c:194: warning: suggest explicit braces to avoid ambiguous 'else'")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Warning,
"suggest explicit braces to avoid ambiguous 'else'\n"
@@ -577,13 +577,13 @@ void ProjectExplorerTest::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::fromLatin1("rm: cannot remove `release/moc_mainwindow.cpp': No such file or directory\n")
<< QStringList() << QStringList("rm: cannot remove `release/moc_mainwindow.cpp': No such file or directory")
<< Tasks();
QTest::newRow("ld: missing library")
<< QString::fromLatin1("/usr/bin/ld: cannot find -ldoesnotexist")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"cannot find -ldoesnotexist"));
@@ -593,7 +593,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
"../../scriptbug/main.cpp:22: instantiated from here\n"
"../../scriptbug/main.cpp:8: warning: unused variable c")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Unknown,
"In function void foo(i) [with i = double]:\n"
@@ -611,7 +611,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("instantiated from here")
<< QString::fromLatin1("main.cpp:10: instantiated from here ")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Unknown,
"instantiated from here",
@@ -621,7 +621,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("In constructor")
<< QString::fromLatin1("/dev/creator/src/plugins/find/basetextfind.h: In constructor 'Find::BaseTextFind::BaseTextFind(QTextEdit*)':")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Unknown,
"In constructor 'Find::BaseTextFind::BaseTextFind(QTextEdit*)':",
@@ -634,7 +634,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
"../../scriptbug/main.cpp:22: instantiated from here\n"
"../../scriptbug/main.cpp:5: warning: unused parameter v")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Unknown,
"At global scope:\n"
@@ -657,7 +657,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("gcc 4.5 fatal error")
<< QString::fromLatin1("/home/code/test.cpp:54:38: fatal error: test.moc: No such file or directory")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"test.moc: No such file or directory",
@@ -678,7 +678,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
"M:\\Development\\x64\\QtPlot/qplotaxis.cpp:26: undefined reference to `vtable for QPlotAxis'\n"
"collect2: ld returned 1 exit status")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Error,
"undefined reference to `vtable for QPlotAxis'\n"
@@ -701,7 +701,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
"../stl/main.cpp: At global scope:\n"
"../stl/main.cpp:31: warning: unused parameter index")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Unknown,
"In member function typename _Vector_base<_Tp, _Alloc>::_Tp_alloc_type::const_reference Vector<_Tp, _Alloc>::at(int) [with _Tp = Point, _Alloc = Allocator<Point>]:\n"
@@ -743,7 +743,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
"C:/Symbian_SDK/epoc32/include/e32cmn.inl: In member function 'SSecureId::operator const TSecureId&() const':\n"
"C:/Symbian_SDK/epoc32/include/e32cmn.inl:7094: warning: returning reference to temporary")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks{compileTask(Task::Warning,
"returning reference to temporary\n"
"In file included from C:/Symbian_SDK/epoc32/include/e32cmn.h:6792,\n"
@@ -759,7 +759,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
" 28 | memset(this, 0, sizeof(PerfEventAttributes));\n"
" | ^")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks{compileTask(Task::Warning,
"void* memset(void*, int, size_t) clearing an object of non-trivial type class PerfEventAttributes; use assignment or value-initialization instead [-Wclass-memaccess]\n"
"perfattributes.cpp: In constructor PerfEventAttributes::PerfEventAttributes():\n"
@@ -773,7 +773,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("QTCREATORBUG-2206")
<< QString::fromLatin1("../../../src/XmlUg/targetdelete.c: At top level:")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Unknown,
"At top level:",
@@ -784,7 +784,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
" from <command line>:26:\n"
"/Symbian/SDK/epoc32/include/variant/Symbian_OS.hrh:1134:26: warning: no newline at end of file")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks{compileTask(
Task::Warning,
"no newline at end of file\n"
@@ -803,7 +803,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("Linker fail (release build)")
<< QString::fromLatin1("release/main.o:main.cpp:(.text+0x42): undefined reference to `MainWindow::doSomething()'")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"undefined reference to `MainWindow::doSomething()'",
@@ -813,7 +813,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
<< QString::fromLatin1("../../../src/shared/proparser/profileevaluator.cpp: In member function 'ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateConditionalFunction(const ProString&, const ProStringList&)':\n"
"../../../src/shared/proparser/profileevaluator.cpp:2817:9: warning: case value '0' not in enumerated type 'ProFileEvaluator::Private::TestFunc'")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Warning,
"case value '0' not in enumerated type 'ProFileEvaluator::Private::TestFunc'\n"
@@ -828,7 +828,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
<< QString::fromLatin1("In file included from <command-line>:0:0:\n"
"./mw.h:4:0: warning: \"STUPID_DEFINE\" redefined")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks{compileTask(
Task::Warning,
"\"STUPID_DEFINE\" redefined\n"
@@ -844,7 +844,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
"file.cpp:87:10: instantiated from here\n"
"file.h:21:5: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Unknown,
"In function 'void UnitTest::CheckEqual(UnitTest::TestResults&, const Expected&, const Actual&, const UnitTest::TestDetails&) [with Expected = unsigned int, Actual = int]':\n"
@@ -862,7 +862,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("linker error") // QTCREATORBUG-3107
<< QString::fromLatin1("cns5k_ins_parser_tests.cpp:(.text._ZN20CNS5kINSParserEngine21DropBytesUntilStartedEP14CircularBufferIhE[CNS5kINSParserEngine::DropBytesUntilStarted(CircularBuffer<unsigned char>*)]+0x6d): undefined reference to `CNS5kINSPacket::SOH_BYTE'")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"undefined reference to `CNS5kINSPacket::SOH_BYTE'",
@@ -871,7 +871,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("libimf warning")
<< QString::fromLatin1("libimf.so: warning: warning: feupdateenv is not implemented and will always fail")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"warning: feupdateenv is not implemented and will always fail",
@@ -883,7 +883,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
" #include <QtGui/QAction>\n"
" ^")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks{compileTask(
Task::Error,
"QtGui/QAction: No such file or directory\n"
@@ -905,7 +905,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
"/usr/include/qt4/QtCore/qstring.h:597:5: error: 'QString::QString(const char*)' is private\n"
"main.cpp:7:22: error: within this context")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks{compileTask(
Task::Error,
"'QString::QString(const char*)' is private\n"
@@ -931,7 +931,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
"bar.o:/home/user/test/bar.cpp:4: first defined here\n"
"collect2: error: ld returned 1 exit status")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Error,
"multiple definition of `foo()'\n"
@@ -955,7 +955,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
"bar.o:(.data+0x0): first defined here\n"
"collect2: error: ld returned 1 exit status")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"multiple definition of `foo'",
@@ -971,7 +971,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
" \"SvgLayoutTest()\", referenced from:\n"
" _main in main.cpp.o"
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks({CompileTask(Task::Error,
"Undefined symbols for architecture x86_64:\n"
"Undefined symbols for architecture x86_64:\n"
@@ -982,7 +982,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("ld: undefined member function reference")
<< "obj/gtest-clang-printing.o:gtest-clang-printing.cpp:llvm::VerifyDisableABIBreakingChecks: error: undefined reference to 'llvm::DisableABIBreakingChecks'"
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"error: undefined reference to 'llvm::DisableABIBreakingChecks'",
@@ -1003,7 +1003,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
">>> referenced by test.cpp:5\n"
">>> /tmp/ccg8pzRr.o:(main)\n"
"collect2: error: ld returned 1 exit status"
<< OutputParserTester::STDERR << QString() << QString()
<< OutputParserTester::STDERR << QStringList() << QStringList()
<< Tasks({
errorTask("ld.lld: error: undefined symbol: func()"),
unknownTask("referenced by test.cpp:5", "test.cpp", 5),
@@ -1015,8 +1015,8 @@ void ProjectExplorerTest::testGccOutputParsers_data()
">>> referenced by main.cpp:10 (/tmp/untitled4/main.cpp:10)\n"
">>> /tmp/Debug4/untitled4.5abe06ac/3a52ce780950d4d9/main.cpp.o:(main)\n"
"clang-8: error: linker command failed with exit code 1 (use -v to see invocation)"
<< OutputParserTester::STDERR << QString()
<< QString("clang-8: error: linker command failed with exit code 1 (use -v to see invocation)\n")
<< OutputParserTester::STDERR << QStringList()
<< QStringList("clang-8: error: linker command failed with exit code 1 (use -v to see invocation)")
<< Tasks{
errorTask("ld.lld: error: undefined symbol: someFunc()"),
unknownTask("referenced by main.cpp:10 (/tmp/untitled4/main.cpp:10)",
@@ -1029,7 +1029,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
">>> referenced by test.cpp\n"
">>> /tmp/ccvjyJph.o:(main)\n"
"collect2: error: ld returned 1 exit status"
<< OutputParserTester::STDERR << QString() << QString()
<< OutputParserTester::STDERR << QStringList() << QStringList()
<< Tasks{
errorTask("ld.lld: error: undefined symbol: func()"),
unknownTask("referenced by test.cpp", "test.cpp"),
@@ -1041,7 +1041,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
<< "lld-link: error: undefined symbol: __Z4funcv\n"
">>> referenced by C:\\Users\\orgads\\AppData\\Local\\Temp\\cccApKoz.o:(.text)\n"
"collect2.exe: error: ld returned 1 exit status"
<< OutputParserTester::STDERR << QString() << QString()
<< OutputParserTester::STDERR << QStringList() << QStringList()
<< Tasks{
errorTask("lld-link: error: undefined symbol: __Z4funcv"),
unknownTask("referenced by C:\\Users\\orgads\\AppData\\Local\\Temp\\cccApKoz.o:(.text)",
@@ -1056,7 +1056,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
">>> defined at test1.cpp:1\n"
">>> test1.o:(.text+0x0)\n"
"collect2: error: ld returned 1 exit status"
<< OutputParserTester::STDERR << QString() << QString()
<< OutputParserTester::STDERR << QStringList() << QStringList()
<< Tasks{
errorTask("ld.lld: error: duplicate symbol: func()"),
unknownTask("defined at test1.cpp:1", "test1.cpp", 1),
@@ -1072,7 +1072,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
">>> defined at main.cpp:5 (/tmp/untitled3/main.cpp:5)\n"
">>> /tmp/Debug/untitled3.dade828b/3a52ce780950d4d9/main.cpp.o:(.text+0x0)\n"
"collect2: error: ld returned 1 exit status"
<< OutputParserTester::STDERR << QString() << QString()
<< OutputParserTester::STDERR << QStringList() << QStringList()
<< Tasks{
errorTask("ld.lld: error: duplicate symbol: theFunc()"),
unknownTask("defined at file.cpp:1 (/tmp/untitled3/file.cpp:1)",
@@ -1092,7 +1092,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
">>> defined at test1.cpp\n"
">>> test1.o:(.text+0x0)\n"
"collect2: error: ld returned 1 exit status"
<< OutputParserTester::STDERR << QString() << QString()
<< OutputParserTester::STDERR << QStringList() << QStringList()
<< Tasks{
errorTask("ld.lld: error: duplicate symbol: func()"),
unknownTask("defined at test1.cpp", "test1.cpp"),
@@ -1105,7 +1105,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("lld: multiple definitions with mingw")
<< "lld-link: error: duplicate symbol: __Z4funcv in test1.o and in test2.o\n"
"collect2.exe: error: ld returned 1 exit status"
<< OutputParserTester::STDERR << QString() << QString()
<< OutputParserTester::STDERR << QStringList() << QStringList()
<< Tasks{
errorTask("lld-link: error: duplicate symbol: __Z4funcv in test1.o and in test2.o"),
errorTask("collect2.exe: error: ld returned 1 exit status", {})};
@@ -1114,7 +1114,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("Mac: ranlib warning")
<< QString::fromLatin1("ranlib: file: lib/libtest.a(Test0.cpp.o) has no symbols")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"file: lib/libtest.a(Test0.cpp.o) has no symbols"));
@@ -1122,7 +1122,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("Mac: ranlib warning2")
<< QString::fromLatin1("/path/to/XCode/and/ranlib: file: lib/libtest.a(Test0.cpp.o) has no symbols")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"file: lib/libtest.a(Test0.cpp.o) has no symbols"));
@@ -1165,7 +1165,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
" | ~~~~~~~~~~~~^~~"
)
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks{compileTask(Task::Warning,
"implicitly-declared constexpr QVariant::Private& QVariant::Private::operator=(const QVariant::Private&) is deprecated [-Wdeprecated-copy]\n"
"In file included from /usr/include/qt/QtCore/qlocale.h:43,\n"
@@ -1251,7 +1251,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
" 465 | at(newSize) = 0;\n"
" | ~~~~~~~~~~~~^~~")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks{compileTask(Task::Warning,
"writing 1 byte into a region of size 0 [-Wstringop-overflow=]\n"
"In file included from smallstringvector.h:30,\n"
@@ -1288,7 +1288,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
" 110 | T value;\n"
" | ^~~~~")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks{compileTask(Task::Error,
"QMapNode<Key, T>::value has incomplete type\n"
"In file included from qmap.h:1,\n"
@@ -1327,7 +1327,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
" ^\n"
"1 warning generated.")
<< OutputParserTester::STDERR
<< QString() << QString("1 warning generated.\n")
<< QStringList() << QStringList("1 warning generated.")
<< Tasks{compileTask(Task::Warning,
"comparison of integers of different signs: 'const unsigned long long' and 'const int' [-Wsign-compare]\n"
"In file included from tst_addresscache.cpp:21:\n"
@@ -1359,7 +1359,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
" 365 | default:\n"
" | ^~~~~~~")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks{compileTask(Task::Warning,
"this statement may fall through [-Wimplicit-fallthrough=]\n"
"In file included from qmlprofilerstatisticsmodel.h:31,\n"
@@ -1384,7 +1384,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
"cc1plus: warning: -Wformat-security ignored without -Wformat [-Wformat-security]\n"
"compilation terminated.")
<< OutputParserTester::STDERR
<< QString() << QString("compilation terminated.\n")
<< QStringList() << QStringList("compilation terminated.")
<< Tasks{
CompileTask(Task::Error, "one or more PCH files were found, but they were invalid"),
CompileTask(Task::Error, "use -Winvalid-pch for more information"),
@@ -1394,7 +1394,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
QTest::newRow("clean path")
<< QString("/home/tim/path/to/sources/./and/more.h:15:22: error: blubb")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks{CompileTask(Task::Error, "blubb", "/home/tim/path/to/sources/and/more.h",
15, 22)};
@@ -1406,7 +1406,7 @@ void ProjectExplorerTest::testGccOutputParsers_data()
" 79 | apply = [p](XInterface *x) { doit_nest(x, p); };\n"
" | ~~~~~~~~^~~~~")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks{compileTask(
Task::Error,
"use of deleted function Utils::BaseAspect::BaseAspect(const Utils::BaseAspect&)\n"
@@ -1436,8 +1436,8 @@ void ProjectExplorerTest::testGccOutputParsers()
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(Tasks, tasks);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
testbench.testParsing(input, inputChannel, tasks, childStdOutLines, childStdErrLines);
}

View File

@@ -158,21 +158,21 @@ void ProjectExplorerTest::testGnuMakeParserParsing_data()
QTest::addColumn<QStringList>("extraSearchDirs");
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<Tasks >("tasks");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks>("tasks");
QTest::addColumn<QStringList>("additionalSearchDirs");
QTest::newRow("pass-through stdout")
<< QStringList()
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString::fromLatin1("Sometext\n") << QString()
<< QStringList("Sometext") << QStringList()
<< Tasks()
<< QStringList();
QTest::newRow("pass-through stderr")
<< QStringList()
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR
<< QString() << QString::fromLatin1("Sometext\n")
<< QStringList() << QStringList("Sometext")
<< Tasks()
<< QStringList();
QTest::newRow("pass-through gcc infos")
@@ -183,12 +183,12 @@ void ProjectExplorerTest::testGnuMakeParserParsing_data()
"../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]\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"
"../../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")
<< QStringList()
<< QStringList{"/temp/test/untitled8/main.cpp: In function `int main(int, char**)':",
"../../scriptbug/main.cpp: At global scope:",
"../../scriptbug/main.cpp: In instantiation of void bar(i) [with i = double]:",
"../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]",
"../../scriptbug/main.cpp:22: instantiated from here"}
<< Tasks()
<< QStringList();
@@ -198,7 +198,7 @@ void ProjectExplorerTest::testGnuMakeParserParsing_data()
<< 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'")
<< OutputParserTester::STDOUT
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks()
<< QStringList({"/home/code/build/qt/examples/opengl/grabber",
"/home/code/build/qt/examples/opengl/grabber", "/test/dir"});
@@ -206,7 +206,7 @@ void ProjectExplorerTest::testGnuMakeParserParsing_data()
<< QStringList({"/home/code/build/qt/examples/opengl/grabber", "/test/dir"})
<< QString::fromLatin1("make[4]: Leaving directory `/home/code/build/qt/examples/opengl/grabber'")
<< OutputParserTester::STDOUT
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks()
<< QStringList("/test/dir");
@@ -214,7 +214,7 @@ void ProjectExplorerTest::testGnuMakeParserParsing_data()
<< QStringList()
<< QString::fromLatin1("make: *** No rule to make target `hello.c', needed by `hello.o'. Stop.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Error,
"No rule to make target `hello.c', needed by `hello.o'. Stop."))
@@ -226,7 +226,7 @@ void ProjectExplorerTest::testGnuMakeParserParsing_data()
"make[3]: *** Waiting for unfinished jobs....\n"
"make[2]: *** [sub-projectexplorer-make_default] Error 2")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Error,
"[.obj/debug-shared/gnumakeparser.o] Error 1"))
@@ -236,7 +236,7 @@ void ProjectExplorerTest::testGnuMakeParserParsing_data()
<< QStringList()
<< QString::fromLatin1("Makefile:360: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Error,
"missing separator (did you mean TAB instead of 8 spaces?). Stop.",
@@ -248,7 +248,7 @@ void ProjectExplorerTest::testGnuMakeParserParsing_data()
<< QString::fromLatin1("mingw32-make[1]: *** [debug/qplotaxis.o] Error 1\n"
"mingw32-make: *** [debug] Error 2")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Error,
"[debug/qplotaxis.o] Error 1"))
@@ -258,7 +258,7 @@ void ProjectExplorerTest::testGnuMakeParserParsing_data()
<< QStringList()
<< QString::fromLatin1("mingw64-make.exe[1]: *** [dynlib.inst] Error -1073741819")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Error,
"[dynlib.inst] Error -1073741819"))
@@ -268,17 +268,17 @@ void ProjectExplorerTest::testGnuMakeParserParsing_data()
<< QStringList()
<< QString::fromLatin1("make[2]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Warning,
"jobserver unavailable: using -j1. Add `+' to parent make rule."))
<< QStringList();
QTest::newRow("pass-trough note")
QTest::newRow("pass-through note")
<< QStringList()
<< QString::fromLatin1("/home/dev/creator/share/qtcreator/debugger/dumper.cpp:1079: note: initialized from here")
<< OutputParserTester::STDERR
<< QString() << QString::fromLatin1("/home/dev/creator/share/qtcreator/debugger/dumper.cpp:1079: note: initialized from here\n")
<< QStringList() << QStringList("/home/dev/creator/share/qtcreator/debugger/dumper.cpp:1079: note: initialized from here")
<< Tasks()
<< QStringList();
@@ -286,7 +286,7 @@ void ProjectExplorerTest::testGnuMakeParserParsing_data()
<< QStringList()
<< QString::fromLatin1("C:\\Qt\\4.6.2-Symbian\\s60sdk\\epoc32\\tools\\make.exe: *** [sis] Error 2")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Error,
"[sis] Error 2"))
@@ -296,7 +296,7 @@ void ProjectExplorerTest::testGnuMakeParserParsing_data()
<< QStringList()
<< QString::fromLatin1("make: g++: Command not found")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Error,
"g++: Command not found"))
@@ -306,7 +306,7 @@ void ProjectExplorerTest::testGnuMakeParserParsing_data()
<< QStringList()
<< QString::fromLatin1("Makefile:794: warning: overriding commands for target `xxxx.app/Contents/Info.plist'")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Warning,
"overriding commands for target `xxxx.app/Contents/Info.plist'",
@@ -327,8 +327,8 @@ void ProjectExplorerTest::testGnuMakeParserParsing()
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(Tasks, tasks);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
QFETCH(QStringList, additionalSearchDirs);
FilePaths searchDirs = childParser->searchDirectories();
@@ -374,7 +374,7 @@ void ProjectExplorerTest::testGnuMakeParserTaskMangling()
{BuildSystemTask(Task::Error,
"missing separator (did you mean TAB instead of 8 spaces?). Stop.",
FilePath::fromString(theMakeFile.fileName()), 360)},
QString(), QString());
{}, {});
}
} // ProjectExplorer::Internal

View File

@@ -105,23 +105,23 @@ void ProjectExplorerTest::testLinuxIccOutputParsers_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks >("tasks");
QTest::newRow("pass-through stdout")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString::fromLatin1("Sometext\n") << QString()
<< QStringList("Sometext") << QStringList()
<< Tasks();
QTest::newRow("pass-through stderr")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR
<< QString() << QString::fromLatin1("Sometext\n")
<< QStringList() << QStringList("Sometext")
<< Tasks();
QTest::newRow("pch creation")
<< QString::fromLatin1("\".pch/Qt5Core.pchi.cpp\": creating precompiled header file \".pch/Qt5Core.pchi\"")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks();
QTest::newRow("undeclared function")
@@ -130,7 +130,7 @@ void ProjectExplorerTest::testLinuxIccOutputParsers_data()
" ^\n"
"\n")
<< OutputParserTester::STDERR
<< QString() << QString::fromLatin1("\n")
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"identifier \"f\" is undefined\n"
@@ -146,7 +146,7 @@ void ProjectExplorerTest::testLinuxIccOutputParsers_data()
" ^\n"
"\n")
<< OutputParserTester::STDERR
<< QString() << QString::fromLatin1("\n")
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"identifier \"f\" is undefined\n"
@@ -161,7 +161,7 @@ void ProjectExplorerTest::testLinuxIccOutputParsers_data()
" ^\n"
"\n")
<< OutputParserTester::STDERR
<< QString() << QString::fromLatin1("\n")
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"function \"AClass::privatefunc\" (declared at line 4 of \"main.h\") is inaccessible\n"
@@ -175,7 +175,7 @@ void ProjectExplorerTest::testLinuxIccOutputParsers_data()
" ^\n"
"\n")
<< OutputParserTester::STDERR
<< QString() << QString::fromLatin1("\n")
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"use of \"=\" where \"==\" may have been intended\n"
@@ -191,8 +191,8 @@ void ProjectExplorerTest::testLinuxIccOutputParsers()
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(Tasks, tasks);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
testbench.testParsing(input, inputChannel, tasks, childStdOutLines, childStdErrLines);
}

View File

@@ -260,8 +260,8 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks >("tasks");
auto compileTask = [](Task::TaskType type,
@@ -285,17 +285,17 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
QTest::newRow("pass-through stdout")
<< "Sometext" << OutputParserTester::STDOUT
<< "Sometext\n" << ""
<< QStringList("Sometext") << QStringList()
<< Tasks();
QTest::newRow("pass-through stderr")
<< "Sometext" << OutputParserTester::STDERR
<< "" << "Sometext\n"
<< QStringList() << QStringList("Sometext")
<< Tasks();
QTest::newRow("labeled error")
<< "qmlstandalone\\main.cpp(54) : error C4716: 'findUnresolvedModule' : must return a value"
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"C4716: 'findUnresolvedModule' : must return a value",
@@ -304,7 +304,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
QTest::newRow("labeled error-2015")
<< "qmlstandalone\\main.cpp(54): error C4716: 'findUnresolvedModule' : must return a value"
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"C4716: 'findUnresolvedModule' : must return a value",
@@ -313,7 +313,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
QTest::newRow("labeled error with number prefix")
<< "1>qmlstandalone\\main.cpp(54) : error C4716: 'findUnresolvedModule' : must return a value"
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"C4716: 'findUnresolvedModule' : must return a value",
@@ -322,7 +322,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
QTest::newRow("labeled warning")
<< "x:\\src\\plugins\\projectexplorer\\msvcparser.cpp(69) : warning C4100: 'something' : unreferenced formal parameter"
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"C4100: 'something' : unreferenced formal parameter",
@@ -331,7 +331,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
QTest::newRow("labeled warning with number prefix")
<< "1>x:\\src\\plugins\\projectexplorer\\msvcparser.cpp(69) : warning C4100: 'something' : unreferenced formal parameter"
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"C4100: 'something' : unreferenced formal parameter",
@@ -345,7 +345,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
"header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and "
"std::codecvt_utf8_utf16) are deprecated in C++17. more blabla"
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"STL4017: std::wbuffer_convert, std::wstring_convert, and the "
@@ -358,7 +358,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
<< "x:\\src\\plugins\\texteditor\\icompletioncollector.h(50) : warning C4099: 'TextEditor::CompletionItem' : type name first seen using 'struct' now seen using 'class'\n"
" x:\\src\\plugins\\texteditor\\completionsupport.h(39) : see declaration of 'TextEditor::CompletionItem'"
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"C4099: 'TextEditor::CompletionItem' : type name first seen using 'struct' now seen using 'class'",
@@ -371,7 +371,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
<< "2>x:\\src\\plugins\\texteditor\\icompletioncollector.h(50) : warning C4099: 'TextEditor::CompletionItem' : type name first seen using 'struct' now seen using 'class'\n"
" x:\\src\\plugins\\texteditor\\completionsupport.h(39) : see declaration of 'TextEditor::CompletionItem'"
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"C4099: 'TextEditor::CompletionItem' : type name first seen using 'struct' now seen using 'class'",
@@ -383,7 +383,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
QTest::newRow("fatal linker error")
<< "LINK : fatal error LNK1146: no argument specified with option '/LIBPATH:'"
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"LNK1146: no argument specified with option '/LIBPATH:'"));
@@ -392,7 +392,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
QTest::newRow("command line warning")
<< "cl : Command line warning D9002 : ignoring unknown option '-fopenmp'"
<< OutputParserTester::STDERR
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"D9002 : ignoring unknown option '-fopenmp'"));
@@ -405,7 +405,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
" ]\n"
" No constructor could take the source type, or constructor overload resolution was ambiguous"
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< compileTask(Task::Error,
"C2440: 'initializing' : cannot convert from 'int' to 'std::_Tree<_Traits>::iterator'\n"
@@ -423,7 +423,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
QTest::newRow("Linker error 1")
<< "main.obj : error LNK2019: unresolved external symbol \"public: void __thiscall Data::doit(void)\" (?doit@Data@@QAEXXZ) referenced in function _main"
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"LNK2019: unresolved external symbol \"public: void __thiscall Data::doit(void)\" (?doit@Data@@QAEXXZ) referenced in function _main",
@@ -432,7 +432,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
QTest::newRow("Linker error 2")
<< "debug\\Experimentation.exe : fatal error LNK1120: 1 unresolved externals"
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"LNK1120: 1 unresolved externals",
@@ -441,7 +441,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
QTest::newRow("nmake error")
<< "Error: dependent '..\\..\\..\\..\\creator-2.5\\src\\plugins\\coreplugin\\ifile.h' does not exist."
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"dependent '..\\..\\..\\..\\creator-2.5\\src\\plugins\\coreplugin\\ifile.h' does not exist."));
@@ -449,7 +449,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
QTest::newRow("jom error")
<< "Error: dependent 'main.cpp' does not exist."
<< OutputParserTester::STDERR
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"dependent 'main.cpp' does not exist."));
@@ -464,7 +464,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
" _InIt=const unsigned char *\n"
" ]"
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'",
@@ -490,7 +490,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
" could be 'C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include\\basetsd.h(83) : unsigned __int64 UINT64'\n"
" or 'D:\\Project\\types.h(71) : Types::UINT64'"
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error,
"C2872: 'UINT64' : ambiguous symbol",
@@ -505,14 +505,14 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
QTest::newRow("ignore moc note")
<< "/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated."
<< OutputParserTester::STDERR
<< "" << "/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.\n"
<< QStringList() << QStringList("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.")
<< (Tasks());
QTest::newRow("error with note")
<< "main.cpp(7): error C2733: 'func': second C linkage of overloaded function not allowed\n"
"main.cpp(6): note: see declaration of 'func'"
<< OutputParserTester::STDOUT
<< "" << ""
<< QStringList() << QStringList()
<< Tasks{compileTask(Task::Error,
"C2733: 'func': second C linkage of overloaded function not allowed\n"
"main.cpp(7): error C2733: 'func': second C linkage of overloaded function not allowed\n"
@@ -525,7 +525,7 @@ void ProjectExplorerTest::testMsvcOutputParsers_data()
QTest::newRow("cyrillic warning") // QTCREATORBUG-20297
<< QString::fromUtf8("cl: командная строка warning D9025: переопределение \"/MDd\" на \"/MTd\"")
<< OutputParserTester::STDERR
<< "" << ""
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
QString::fromUtf8("D9025: переопределение \"/MDd\" на \"/MTd\"")));
@@ -538,8 +538,8 @@ void ProjectExplorerTest::testMsvcOutputParsers()
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(Tasks, tasks);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
testbench.testParsing(input, inputChannel, tasks, childStdOutLines, childStdErrLines);
}
@@ -548,8 +548,8 @@ void ProjectExplorerTest::testClangClOutputParsers_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks >("tasks");
const QString clangClCompilerLog =
@@ -577,12 +577,12 @@ void ProjectExplorerTest::testClangClOutputParsers_data()
"Stop.";
const QString input = clangClCompilerLog + ignoredStderr;
const QString expectedStderr = ignoredStderr + '\n';
const QStringList expectedStderr = ignoredStderr.split('\n');
QTest::newRow("error")
<< input
<< OutputParserTester::STDERR
<< "" << expectedStderr
<< QStringList() << expectedStderr
<< (Tasks()
<< CompileTask(Task::Warning,
"private field 'm_version' is not used [-Wunused-private-field]\n"
@@ -620,12 +620,11 @@ void ProjectExplorerTest::testClangClOutputParsers_data()
" ^\r\n"
" ;"
<< OutputParserTester::STDERR
<< ""
<< "C:\\Program Files\\LLVM\\bin\\clang-cl.exe /nologo /c /EHsc /Od -m64 /Zi /MDd "
<< QStringList()
<< QStringList{"C:\\Program Files\\LLVM\\bin\\clang-cl.exe /nologo /c /EHsc /Od -m64 /Zi /MDd "
"/DUNICODE /D_UNICODE /DWIN32 /FdTestForError.cl.pdb "
"/FoC:\\MyData\\Project_home\\cpp\build-TestForError-msvc_2017_clang-Debug\\Debug_msvc_201_47eca974c876c8b3\\TestForError.b6dd39ae\\3a52ce780950d4d9\\main.cpp.obj "
"C:\\MyData\\Project_home\\cpp\\TestForError\\main.cpp /TP\n"
" ;\n"
"C:\\MyData\\Project_home\\cpp\\TestForError\\main.cpp /TP", " ;"}
<< Tasks{CompileTask(Task::Error,
"expected ';' after return statement\n"
"C:\\MyData\\Project_home\\cpp\\TestForError\\main.cpp(3,10): error: expected ';' after return statement\n"
@@ -640,8 +639,8 @@ void ProjectExplorerTest::testClangClOutputParsers()
testbench.addLineParser(new ClangClParser);
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
QFETCH(Tasks, tasks);
testbench.testParsing(input, inputChannel, tasks, childStdOutLines, childStdErrLines);

View File

@@ -28,9 +28,9 @@ private:
Result handleLine(const QString &line, Utils::OutputFormat type) final
{
if (type == Utils::StdOutFormat)
m_tester->m_receivedStdOutChildLine.append(line + '\n');
m_tester->m_receivedStdOutChildLines << line;
else
m_tester->m_receivedStdErrChildLine.append(line + '\n');
m_tester->m_receivedStdErrChildLines << line;
return Status::Done;
}
@@ -56,11 +56,11 @@ OutputParserTester::~OutputParserTester()
taskHub().disconnect(this);
}
void OutputParserTester::testParsing(const QString &lines,
void OutputParserTester::testParsing(const QString &input,
Channel inputChannel,
Tasks tasks,
const QString &childStdOutLines,
const QString &childStdErrLines)
const QStringList &childStdOutLines,
const QStringList &childStdErrLines)
{
for (Utils::OutputLineParser * const parser : lineParsers())
parser->skipFileExistsCheck();
@@ -70,18 +70,15 @@ void OutputParserTester::testParsing(const QString &lines,
addLineParser(terminator);
reset();
if (inputChannel == STDOUT)
appendMessage(lines + '\n', Utils::StdOutFormat);
else
appendMessage(lines + '\n', Utils::StdErrFormat);
appendMessage(input, inputChannel == STDOUT ? Utils::StdOutFormat : Utils::StdErrFormat);
flush();
// delete the parser(s) to test
emit aboutToDeleteParser();
setLineParsers({});
QCOMPARE(m_receivedStdErrChildLine, childStdErrLines);
QCOMPARE(m_receivedStdOutChildLine, childStdOutLines);
QCOMPARE(m_receivedStdErrChildLines, childStdErrLines);
QCOMPARE(m_receivedStdOutChildLines, childStdOutLines);
QCOMPARE(m_receivedTasks.size(), tasks.size());
if (m_receivedTasks.size() == tasks.size()) {
for (int i = 0; i < tasks.size(); ++i) {
@@ -116,8 +113,8 @@ void OutputParserTester::setDebugEnabled(bool debug)
void OutputParserTester::reset()
{
m_receivedStdErrChildLine.clear();
m_receivedStdOutChildLine.clear();
m_receivedStdErrChildLines.clear();
m_receivedStdOutChildLines.clear();
m_receivedTasks.clear();
}
@@ -134,44 +131,44 @@ void OutputParserTest::testAnsiFilterOutputParser_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::newRow("pass-through stdout")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString::fromLatin1("Sometext\n") << QString();
<< QStringList("Sometext") << QStringList();
QTest::newRow("pass-through stderr")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR
<< QString() << QString::fromLatin1("Sometext\n");
<< QStringList() << QStringList("Sometext");
QString input = QString::fromLatin1("te") + QChar(27) + QString::fromLatin1("Nst");
QTest::newRow("ANSI: ESC-N")
<< input << OutputParserTester::STDOUT
<< QString::fromLatin1("test\n") << QString();
<< QStringList("test") << QStringList();
input = QString::fromLatin1("te") + QChar(27) + QLatin1String("^ignored") + QChar(27) + QLatin1String("\\st");
QTest::newRow("ANSI: ESC-^ignoredESC-\\")
<< input << OutputParserTester::STDOUT
<< QString::fromLatin1("test\n") << QString();
<< QStringList("test") << QStringList();
input = QString::fromLatin1("te") + QChar(27) + QLatin1String("]0;ignored") + QChar(7) + QLatin1String("st");
QTest::newRow("ANSI: window title change")
<< input << OutputParserTester::STDOUT
<< QString::fromLatin1("test\n") << QString();
<< QStringList("test") << QStringList();
input = QString::fromLatin1("te") + QChar(27) + QLatin1String("[Ast");
QTest::newRow("ANSI: cursor up")
<< input << OutputParserTester::STDOUT
<< QString::fromLatin1("test\n") << QString();
<< QStringList("test") << QStringList();
input = QString::fromLatin1("te") + QChar(27) + QLatin1String("[2Ast");
QTest::newRow("ANSI: cursor up (with int parameter)")
<< input << OutputParserTester::STDOUT
<< QString::fromLatin1("test\n") << QString();
<< QStringList("test") << QStringList();
input = QString::fromLatin1("te") + QChar(27) + QLatin1String("[2;3Hst");
QTest::newRow("ANSI: position cursor")
<< input << OutputParserTester::STDOUT
<< QString::fromLatin1("test\n") << QString();
<< QStringList("test") << QStringList();
input = QString::fromLatin1("te") + QChar(27) + QLatin1String("[31;1mst");
QTest::newRow("ANSI: bold red")
<< input << OutputParserTester::STDOUT
<< QString::fromLatin1("test\n") << QString();
<< QStringList("test") << QStringList();
}
void OutputParserTest::testAnsiFilterOutputParser()
@@ -179,8 +176,8 @@ void OutputParserTest::testAnsiFilterOutputParser()
OutputParserTester testbench;
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
testbench.testParsing(input, inputChannel, Tasks(), childStdOutLines, childStdErrLines);
}

View File

@@ -29,10 +29,10 @@ public:
~OutputParserTester();
// test functions:
void testParsing(const QString &lines, Channel inputChannel,
void testParsing(const QString &input, Channel inputChannel,
Tasks tasks,
const QString &childStdOutLines,
const QString &childStdErrLines);
const QStringList &childStdOutLines,
const QStringList &childStdErrLines);
void setDebugEnabled(bool);
@@ -44,8 +44,8 @@ private:
bool m_debug = false;
QString m_receivedStdErrChildLine;
QString m_receivedStdOutChildLine;
QStringList m_receivedStdErrChildLines;
QStringList m_receivedStdOutChildLines;
Tasks m_receivedTasks;
friend class TestTerminator;

View File

@@ -167,8 +167,8 @@ private slots:
void testParser_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<Tasks >("tasks");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<Tasks>("tasks");
QTest::addColumn<QStringList>("childStdErrLines");
const QString odrInput = R"(=================================================================
==3792966==ERROR: AddressSanitizer: odr-violation (0x55f0cfaeddc0):
@@ -216,7 +216,7 @@ SUMMARY: AddressSanitizer: odr-violation: global 'lre_id_continue_table_ascii' a
QTest::newRow("odr violation")
<< odrInput
<< QList<Task>{odrTask}
<< (odrNonMatchedLines.join('\n') + "\n");
<< odrNonMatchedLines;
const QString leakInput = R"(
==61167==ERROR: LeakSanitizer: detected memory leaks
@@ -230,7 +230,7 @@ Direct leak of 19 byte(s) in 1 object(s) allocated from:
#5 0x7eff1ea1c041 in __libc_start_main ../csu/libc-start.c:308
SUMMARY: AddressSanitizer: 19 byte(s) leaked in 1 allocation(s).)";
const QString leakNonMatchedLines = "\n";
const QStringList leakNonMatchedLines{QString()};
const Task leakTask(Task::Error,
QString("AddressSanitizer: 19 byte(s) leaked in 1 allocation(s).") + leakInput,
{}, -1, Constants::TASK_CATEGORY_SANITIZER);
@@ -243,7 +243,7 @@ SUMMARY: AddressSanitizer: 19 byte(s) leaked in 1 allocation(s).)";
testbench.setLineParsers({new SanitizerParser});
QFETCH(QString, input);
QFETCH(Tasks, tasks);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdErrLines);
testbench.testParsing(input, OutputParserTester::STDERR, tasks, {}, childStdErrLines);
}
};

View File

@@ -118,45 +118,45 @@ void ProjectExplorerTest::testXcodebuildParserParsing_data()
QTest::addColumn<ProjectExplorer::XcodebuildParser::XcodebuildStatus>("initialStatus");
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<Tasks >("tasks");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks>("tasks");
QTest::addColumn<ProjectExplorer::XcodebuildParser::XcodebuildStatus>("finalStatus");
QTest::newRow("outside pass-through stdout")
<< XcodebuildParser::OutsideXcodebuild
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString::fromLatin1("Sometext\n") << QString()
<< QString("Sometext") << OutputParserTester::STDOUT
<< QStringList("Sometext") << QStringList()
<< Tasks()
<< XcodebuildParser::OutsideXcodebuild;
QTest::newRow("outside pass-through stderr")
<< XcodebuildParser::OutsideXcodebuild
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR
<< QString() << QString::fromLatin1("Sometext\n")
<< QStringList() << QStringList("Sometext")
<< Tasks()
<< XcodebuildParser::OutsideXcodebuild;
QTest::newRow("inside pass stdout to stderr")
<< XcodebuildParser::InXcodebuild
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString() << QString::fromLatin1("Sometext\n")
<< QStringList() << QStringList("Sometext")
<< Tasks()
<< XcodebuildParser::InXcodebuild;
QTest::newRow("inside ignore stderr")
<< XcodebuildParser::InXcodebuild
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks()
<< XcodebuildParser::InXcodebuild;
QTest::newRow("unknown pass stdout to stderr")
<< XcodebuildParser::UnknownXcodebuildState
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString() << QString::fromLatin1("Sometext\n")
<< QStringList() << QStringList("Sometext")
<< Tasks()
<< XcodebuildParser::UnknownXcodebuildState;
QTest::newRow("unknown ignore stderr (change?)")
<< XcodebuildParser::UnknownXcodebuildState
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< Tasks()
<< XcodebuildParser::UnknownXcodebuildState;
QTest::newRow("switch outside->in->outside")
@@ -169,7 +169,7 @@ void ProjectExplorerTest::testXcodebuildParserParsing_data()
"** BUILD SUCCEEDED **\n"
"outside2")
<< OutputParserTester::STDOUT
<< QString::fromLatin1("outside\noutside2\n") << QString::fromLatin1("in xcodebuild\nin xcodebuild2\n")
<< QStringList{"outside","outside2"} << QStringList{"in xcodebuild", "in xcodebuild2"}
<< Tasks()
<< XcodebuildParser::OutsideXcodebuild;
QTest::newRow("switch outside->in->outside (new)")
@@ -181,7 +181,7 @@ void ProjectExplorerTest::testXcodebuildParserParsing_data()
"** BUILD SUCCEEDED **\n"
"outside2")
<< OutputParserTester::STDOUT
<< QString::fromLatin1("outside\noutside2\n") << QString::fromLatin1("in xcodebuild\nin xcodebuild2\n")
<< QStringList{"outside", "outside2"} << QStringList{"in xcodebuild", "in xcodebuild2"}
<< Tasks()
<< XcodebuildParser::OutsideXcodebuild;
QTest::newRow("switch Unknown->in->outside")
@@ -192,7 +192,7 @@ void ProjectExplorerTest::testXcodebuildParserParsing_data()
"** BUILD SUCCEEDED **\n"
"outside")
<< OutputParserTester::STDOUT
<< QString::fromLatin1("outside\n") << QString::fromLatin1("unknown\nin xcodebuild\n")
<< QStringList("outside") << QStringList{"unknown", "in xcodebuild"}
<< Tasks()
<< XcodebuildParser::OutsideXcodebuild;
@@ -202,7 +202,7 @@ void ProjectExplorerTest::testXcodebuildParserParsing_data()
"** BUILD FAILED **\n"
"unknownErr")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Error, Tr::tr("Xcodebuild failed.")))
<< XcodebuildParser::UnknownXcodebuildState;
@@ -213,7 +213,7 @@ void ProjectExplorerTest::testXcodebuildParserParsing_data()
"** BUILD FAILED **\n"
"unknownErr")
<< OutputParserTester::STDERR
<< QString() << QString::fromLatin1("outErr\n")
<< QStringList() << QStringList("outErr")
<< (Tasks()
<< CompileTask(Task::Error, Tr::tr("Xcodebuild failed.")))
<< XcodebuildParser::UnknownXcodebuildState;
@@ -221,7 +221,7 @@ void ProjectExplorerTest::testXcodebuildParserParsing_data()
QTest::newRow("inside catch codesign replace signature")
<< XcodebuildParser::InXcodebuild
<< QString::fromLatin1("/somepath/somefile.app: replacing existing signature") << OutputParserTester::STDOUT
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
Tr::tr("Replacing signature"), "/somepath/somefile.app"))
@@ -230,7 +230,7 @@ void ProjectExplorerTest::testXcodebuildParserParsing_data()
QTest::newRow("outside forward codesign replace signature")
<< XcodebuildParser::OutsideXcodebuild
<< QString::fromLatin1("/somepath/somefile.app: replacing existing signature") << OutputParserTester::STDOUT
<< QString::fromLatin1("/somepath/somefile.app: replacing existing signature\n") << QString()
<< QStringList("/somepath/somefile.app: replacing existing signature") << QStringList()
<< Tasks()
<< XcodebuildParser::OutsideXcodebuild;
}
@@ -248,8 +248,8 @@ void ProjectExplorerTest::testXcodebuildParserParsing()
QFETCH(ProjectExplorer::XcodebuildParser::XcodebuildStatus, initialStatus);
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
QFETCH(Tasks, tasks);
QFETCH(ProjectExplorer::XcodebuildParser::XcodebuildStatus, finalStatus);

View File

@@ -91,23 +91,23 @@ void QmakeOutputParserTest::testQmakeOutputParsers_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks >("tasks");
QTest::newRow("pass-through stdout")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString::fromLatin1("Sometext\n") << QString()
<< QStringList("Sometext") << QStringList()
<< Tasks();
QTest::newRow("pass-through stderr")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR
<< QString() << QString::fromLatin1("Sometext\n")
<< QStringList() << QStringList("Sometext")
<< Tasks();
QTest::newRow("qMake error")
<< QString::fromLatin1("Project ERROR: undefined file")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Error,
"undefined file"));
@@ -115,7 +115,7 @@ void QmakeOutputParserTest::testQmakeOutputParsers_data()
QTest::newRow("qMake Parse Error")
<< QString::fromLatin1("e:\\project.pro:14: Parse Error ('sth odd')")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Error,
"Parse Error ('sth odd')",
@@ -125,7 +125,7 @@ void QmakeOutputParserTest::testQmakeOutputParsers_data()
QTest::newRow("qMake warning")
<< QString::fromLatin1("Project WARNING: bearer module might require ReadUserData capability")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Warning,
"bearer module might require ReadUserData capability"));
@@ -133,7 +133,7 @@ void QmakeOutputParserTest::testQmakeOutputParsers_data()
QTest::newRow("qMake warning 2")
<< QString::fromLatin1("WARNING: Failure to find: blackberrycreatepackagestepconfigwidget.cpp")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Warning,
"Failure to find: blackberrycreatepackagestepconfigwidget.cpp"));
@@ -141,7 +141,7 @@ void QmakeOutputParserTest::testQmakeOutputParsers_data()
QTest::newRow("qMake warning with location")
<< QString::fromLatin1("WARNING: e:\\QtSDK\\Simulator\\Qt\\msvc2008\\lib\\qtmaind.prl:1: Unescaped backslashes are deprecated.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Warning,
"Unescaped backslashes are deprecated.",
@@ -150,7 +150,7 @@ void QmakeOutputParserTest::testQmakeOutputParsers_data()
QTest::newRow("moc note")
<< QString::fromLatin1("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< BuildSystemTask(Task::Unknown,
"Note: No relevant classes found. No output generated.",
@@ -164,8 +164,8 @@ void QmakeOutputParserTest::testQmakeOutputParsers()
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(Tasks, tasks);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
testbench.testParsing(input, inputChannel, tasks, childStdOutLines, childStdErrLines);
}

View File

@@ -129,17 +129,17 @@ void QtOutputParserTest::testQtOutputParser_data()
{
QTest::addColumn<QString>("input");
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
QTest::addColumn<QString>("childStdOutLines");
QTest::addColumn<QString>("childStdErrLines");
QTest::addColumn<Tasks >("tasks");
QTest::addColumn<QStringList>("childStdOutLines");
QTest::addColumn<QStringList>("childStdErrLines");
QTest::addColumn<Tasks>("tasks");
QTest::newRow("pass-through stdout")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDOUT
<< QString::fromLatin1("Sometext\n") << QString()
<< QStringList("Sometext\n") << QStringList()
<< Tasks();
QTest::newRow("pass-through stderr")
<< QString::fromLatin1("Sometext") << OutputParserTester::STDERR
<< QString() << QString::fromLatin1("Sometext\n")
<< QStringList() << QStringList("Sometext\n")
<< Tasks();
QTest::newRow("pass-through gcc infos")
<< QString::fromLatin1("/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n"
@@ -148,66 +148,66 @@ void QtOutputParserTest::testQtOutputParser_data()
"../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]\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"
"../../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")
<< QStringList()
<< QStringList{"/temp/test/untitled8/main.cpp: In function `int main(int, char**)':",
"../../scriptbug/main.cpp: At global scope:",
"../../scriptbug/main.cpp: In instantiation of void bar(i) [with i = double]:",
"../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]",
"../../scriptbug/main.cpp:22: instantiated from here\n"}
<< Tasks();
QTest::newRow("qdoc warning")
<< QString::fromLatin1("/home/user/dev/qt5/qtscript/src/script/api/qscriptengine.cpp:295: warning: Can't create link to 'Object Trees & Ownership'")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks() << CompileTask(Task::Warning,
QLatin1String("Can't create link to 'Object Trees & Ownership'"),
Utils::FilePath::fromUserInput(QLatin1String("/home/user/dev/qt5/qtscript/src/script/api/qscriptengine.cpp")), 295));
QTest::newRow("moc warning")
<< QString::fromLatin1("..\\untitled\\errorfile.h:0: Warning: No relevant classes found. No output generated.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks() << CompileTask(Task::Warning,
QLatin1String("No relevant classes found. No output generated."),
Utils::FilePath::fromUserInput(QLatin1String("..\\untitled\\errorfile.h")), -1));
QTest::newRow("moc warning 2")
<< QString::fromLatin1("c:\\code\\test.h(96): Warning: Property declaration ) has no READ accessor function. The property will be invalid.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks() << CompileTask(Task::Warning,
QLatin1String("Property declaration ) has no READ accessor function. The property will be invalid."),
Utils::FilePath::fromUserInput(QLatin1String("c:\\code\\test.h")), 96));
QTest::newRow("moc warning (Qt 6/Windows)")
<< QString::fromLatin1(R"(C:/Users/alportal/dev/qt-creator-qt6/src/plugins/qmlprofiler/qmlprofilerplugin.h(38:1): error: Plugin Metadata file "QmlProfiler.json" does not exist. Declaration will be ignored)")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks() << CompileTask(Task::Error,
R"(Plugin Metadata file "QmlProfiler.json" does not exist. Declaration will be ignored)",
Utils::FilePath::fromUserInput("C:/Users/alportal/dev/qt-creator-qt6/src/plugins/qmlprofiler/qmlprofilerplugin.h"), 38, 1));
QTest::newRow("moc warning (Qt 6/Unix)")
<< QString::fromLatin1(R"(/Users/alportal/dev/qt-creator-qt6/src/plugins/qmlprofiler/qmlprofilerplugin.h:38:1: error: Plugin Metadata file "QmlProfiler.json" does not exist. Declaration will be ignored)")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks() << CompileTask(Task::Error,
R"(Plugin Metadata file "QmlProfiler.json" does not exist. Declaration will be ignored)",
Utils::FilePath::fromUserInput("/Users/alportal/dev/qt-creator-qt6/src/plugins/qmlprofiler/qmlprofilerplugin.h"), 38, 1));
QTest::newRow("moc note")
<< QString::fromLatin1("/home/qtwebkithelpviewer.h:0: Note: No relevant classes found. No output generated.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks() << CompileTask(Task::Unknown,
QLatin1String("No relevant classes found. No output generated."),
Utils::FilePath::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), -1));
QTest::newRow("ninja with moc")
<< QString::fromLatin1("E:/sandbox/creator/loaden/src/libs/utils/iwelcomepage.h(54): Error: Undefined interface")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks() << CompileTask(Task::Error,
QLatin1String("Undefined interface"),
Utils::FilePath::fromUserInput(QLatin1String("E:/sandbox/creator/loaden/src/libs/utils/iwelcomepage.h")), 54));
QTest::newRow("uic warning")
<< QString::fromLatin1("mainwindow.ui: Warning: The name 'pushButton' (QPushButton) is already in use, defaulting to 'pushButton1'.")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks()
<< CompileTask(Task::Warning,
"The name 'pushButton' (QPushButton) is already in use, defaulting to 'pushButton1'.",
@@ -215,7 +215,7 @@ void QtOutputParserTest::testQtOutputParser_data()
QTest::newRow("translation")
<< QString::fromLatin1("Warning: dropping duplicate messages in '/some/place/qtcreator_fr.qm'")
<< OutputParserTester::STDERR
<< QString() << QString()
<< QStringList() << QStringList()
<< (Tasks() << CompileTask(Task::Warning,
QLatin1String("dropping duplicate messages"),
Utils::FilePath::fromUserInput(QLatin1String("/some/place/qtcreator_fr.qm")), -1));
@@ -229,7 +229,7 @@ void QtOutputParserTest::testQtOutputParser_data()
QTest::newRow("qmlsc/qmllint error") // QTCREATORBUG-28720
<< QString::fromLatin1("Error: E:/foo/PerfProfilerFlameGraphView.qml:10:5: "
"Could not compile binding for model: Cannot resolve property type for binding on model")
<< OutputParserTester::STDERR << QString() << QString()
<< OutputParserTester::STDERR << QStringList() << QStringList()
<< (Tasks() << CompileTask(Task::Error,
"Could not compile binding for model: Cannot resolve property type for binding on model",
Utils::FilePath::fromUserInput("E:/foo/PerfProfilerFlameGraphView.qml"), 10, 5));
@@ -242,8 +242,8 @@ void QtOutputParserTest::testQtOutputParser()
QFETCH(QString, input);
QFETCH(OutputParserTester::Channel, inputChannel);
QFETCH(Tasks, tasks);
QFETCH(QString, childStdOutLines);
QFETCH(QString, childStdErrLines);
QFETCH(QStringList, childStdOutLines);
QFETCH(QStringList, childStdErrLines);
testbench.testParsing(input, inputChannel, tasks, childStdOutLines, childStdErrLines);
}

View File

@@ -105,11 +105,11 @@ void QtTestParserTest::testQtTestOutputParser()
#endif
"XPASS: irrelevant\n"
"PASS : MyTest::anotherTest()";
const QString expectedChildOutput =
"random output\n"
"PASS : MyTest::someTest()\n"
"XPASS: irrelevant\n"
"PASS : MyTest::anotherTest()\n";
const QStringList expectedChildOutput{
"random output",
"PASS : MyTest::someTest()",
"XPASS: irrelevant",
"PASS : MyTest::anotherTest()\n"};
const FilePath theFile = FilePath::fromString(HostOsInfo::isWindowsHost()
? QString("C:/dev/tests/tst_mytest.cpp") : QString("/home/me/tests/tst_mytest.cpp"));
const Tasks expectedTasks{
@@ -121,7 +121,7 @@ void QtTestParserTest::testQtTestOutputParser()
" Expected (true) : 1",
theFile, 220, Constants::TASK_CATEGORY_AUTOTEST)};
testbench.testParsing(input, OutputParserTester::STDOUT, expectedTasks, expectedChildOutput,
QString());
QStringList());
}
QObject *createQtTestParserTest()