summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/outputparser_test.h
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@digia.com>2013-05-03 16:02:53 +0200
committerTobias Hunger <tobias.hunger@digia.com>2013-05-06 10:04:23 +0200
commit14763118a58bf526f873b6750c3785f8752e4d7e (patch)
tree7312632b55035129adf70fc87ebcb1b8d2583f04 /src/plugins/projectexplorer/outputparser_test.h
parentfa9d57fb689fc76416eaa4f1dadd89a83acdaa48 (diff)
downloadqt-creator-14763118a58bf526f873b6750c3785f8752e4d7e.tar.gz
Make test bench for IOutputParser tests more stable
Change-Id: I39a08912efdcf34ef680d508c41c4df9034125dc Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Diffstat (limited to 'src/plugins/projectexplorer/outputparser_test.h')
-rw-r--r--src/plugins/projectexplorer/outputparser_test.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/plugins/projectexplorer/outputparser_test.h b/src/plugins/projectexplorer/outputparser_test.h
index fdb5d0a46b..d56c5492d2 100644
--- a/src/plugins/projectexplorer/outputparser_test.h
+++ b/src/plugins/projectexplorer/outputparser_test.h
@@ -33,11 +33,15 @@
#if defined(WITH_TESTS)
#include "projectexplorer_export.h"
-#include "metatypedeclarations.h"
+
#include "ioutputparser.h"
+#include "metatypedeclarations.h"
+#include "task.h"
namespace ProjectExplorer {
+class TestTerminator;
+
class PROJECTEXPLORER_EXPORT OutputParserTester : public IOutputParser
{
Q_OBJECT
@@ -49,7 +53,6 @@ public:
};
OutputParserTester();
- ~OutputParserTester();
// test methods:
void testParsing(const QString &lines, Channel inputChannel,
@@ -64,10 +67,6 @@ public:
void setDebugEnabled(bool);
- // IOutputParser interface:
- void stdOutput(const QString &line);
- void stdError(const QString &line);
-
void appendOutputParser(IOutputParser *parser);
signals:
@@ -86,6 +85,22 @@ private:
QString m_receivedStdOutChildLine;
QList<Task> m_receivedTasks;
QString m_receivedOutput;
+
+ friend class TestTerminator;
+};
+
+class TestTerminator : public IOutputParser
+{
+ Q_OBJECT
+
+public:
+ TestTerminator(OutputParserTester *t);
+
+ void stdOutput(const QString &line);
+ void stdError(const QString &line);
+
+private:
+ OutputParserTester *m_tester;
};
} // namespace ProjectExplorer