From 20883d9f5fe062c460d323c2edfb74a07e4ef4e5 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 25 Sep 2020 13:08:30 +0200 Subject: 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 --- src/plugins/projectexplorer/outputparser_test.cpp | 7 ++++++- src/plugins/projectexplorer/outputparser_test.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/outputparser_test.cpp b/src/plugins/projectexplorer/outputparser_test.cpp index e599e30686..d1d25a3c67 100644 --- a/src/plugins/projectexplorer/outputparser_test.cpp +++ b/src/plugins/projectexplorer/outputparser_test.cpp @@ -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) { diff --git a/src/plugins/projectexplorer/outputparser_test.h b/src/plugins/projectexplorer/outputparser_test.h index b41b9a1f87..bab34325c3 100644 --- a/src/plugins/projectexplorer/outputparser_test.h +++ b/src/plugins/projectexplorer/outputparser_test.h @@ -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; -- cgit v1.2.3