diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2020-04-07 13:49:34 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2020-04-07 15:20:22 +0000 |
commit | 7745eacc7afae4acf3e07325ab01cf6e6821037c (patch) | |
tree | 2a125e0c7530d3ae252a740b42db4cd1d34f805a /src/plugins/projectexplorer/outputparser_test.cpp | |
parent | b22bb5a9a7aa22fe13e1282c5db851688ec4d83f (diff) |
Output parsers: Generalize the search directory concept
All parsers can now have search directories, not just the GnuMakeParser.
This allows us to get rid of the "task mangling", removing another
instance where the order of parsers in the chain mattered.
Task-number: QTCREATORBUG-22665
Change-Id: Id0d55522ae6800afd9f50ff36546224b0d8bb382
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/outputparser_test.cpp')
-rw-r--r-- | src/plugins/projectexplorer/outputparser_test.cpp | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/src/plugins/projectexplorer/outputparser_test.cpp b/src/plugins/projectexplorer/outputparser_test.cpp index ea7b9be7ce..9dfa5e4826 100644 --- a/src/plugins/projectexplorer/outputparser_test.cpp +++ b/src/plugins/projectexplorer/outputparser_test.cpp @@ -39,6 +39,13 @@ static inline QByteArray msgFileComparisonFail(const Utils::FilePath &f1, const } // test functions: +OutputParserTester::OutputParserTester() +{ + connect(this, &IOutputParser::addTask, this, [this](const Task &t) { + m_receivedTasks.append(t); + }); +} + void OutputParserTester::testParsing(const QString &lines, Channel inputChannel, Tasks tasks, @@ -79,38 +86,11 @@ void OutputParserTester::testParsing(const QString &lines, } } -void OutputParserTester::testTaskMangling(const Task &input, - const Task &output) -{ - reset(); - childParser()->taskAdded(input); - - QVERIFY(m_receivedOutput.isNull()); - QVERIFY(m_receivedStdErrChildLine.isNull()); - QVERIFY(m_receivedStdOutChildLine.isNull()); - QVERIFY(m_receivedTasks.size() == 1); - if (m_receivedTasks.size() == 1) { - QCOMPARE(m_receivedTasks.at(0).category, output.category); - QCOMPARE(m_receivedTasks.at(0).description, output.description); - QVERIFY2(m_receivedTasks.at(0).file == output.file, - msgFileComparisonFail(m_receivedTasks.at(0).file, output.file)); - QCOMPARE(m_receivedTasks.at(0).line, output.line); - QCOMPARE(m_receivedTasks.at(0).type, output.type); - } -} - void OutputParserTester::setDebugEnabled(bool debug) { m_debug = debug; } -void OutputParserTester::taskAdded(const Task &task, int linkedLines, int skipLines) -{ - Q_UNUSED(linkedLines) - Q_UNUSED(skipLines) - m_receivedTasks.append(task); -} - void OutputParserTester::reset() { m_receivedStdErrChildLine.clear(); |