aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2020-09-25 13:08:30 +0200
committerChristian Stenger <christian.stenger@qt.io>2020-09-28 04:27:01 +0000
commit20883d9f5fe062c460d323c2edfb74a07e4ef4e5 (patch)
tree4b0dd0d7eab92dc1e2fabf1bd42be55252abd94d
parent1e8f19e2741ff43878054f6a2036e841cfabf494 (diff)
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>
-rw-r--r--src/plugins/projectexplorer/outputparser_test.cpp7
-rw-r--r--src/plugins/projectexplorer/outputparser_test.h2
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;