ProjectExplorer: Fix setting up test terminator

When setting up the test terminator the used line parser
has been setup already.
Ensure the test terminator has the same search directories
set up to avoid an assert.

Change-Id: Ic881533f7735f769dd49d22860141c9213e77e09
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Christian Stenger
2020-09-25 13:08:30 +02:00
parent 1e8f19e274
commit 20883d9f5f
2 changed files with 7 additions and 2 deletions

View File

@@ -111,7 +111,12 @@ void OutputParserTester::reset()
TestTerminator::TestTerminator(OutputParserTester *t) :
m_tester(t)
{ }
{
if (!t->lineParsers().isEmpty()) {
for (const Utils::FilePath &searchDir : t->lineParsers().first()->searchDirectories())
addSearchDir(searchDir);
}
}
Utils::OutputLineParser::Result TestTerminator::handleLine(const QString &line, Utils::OutputFormat type)
{

View File

@@ -79,7 +79,7 @@ class TestTerminator : public OutputTaskParser
Q_OBJECT
public:
TestTerminator(OutputParserTester *t);
explicit TestTerminator(OutputParserTester *t);
private:
Result handleLine(const QString &line, Utils::OutputFormat type) override;