Commit 90fe72ca authored by David Schulz's avatar David Schulz Committed by Christian Stenger

ProjectExplorer: fix Xcodebuild parser test.

Change-Id: Ic33d771c00c5e3afe53d217316a1fe91387ac989
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent eebd4579
......@@ -122,6 +122,11 @@ XcodebuildParserTester::XcodebuildParserTester(XcodebuildParser *p, QObject *par
parser(p)
{ }
void XcodebuildParserTester::onAboutToDeleteParser()
{
QCOMPARE(parser->m_xcodeBuildParserState, expectedFinalState);
}
void ProjectExplorerPlugin::testXcodebuildParserParsing_data()
{
QTest::addColumn<ProjectExplorer::XcodebuildParser::XcodebuildStatus>("initialStatus");
......@@ -243,6 +248,8 @@ void ProjectExplorerPlugin::testXcodebuildParserParsing()
XcodebuildParser *childParser = new XcodebuildParser;
XcodebuildParserTester *tester = new XcodebuildParserTester(childParser);
connect(&testbench, SIGNAL(aboutToDeleteParser()), tester, SLOT(onAboutToDeleteParser()));
testbench.appendOutputParser(childParser);
QFETCH(ProjectExplorer::XcodebuildParser::XcodebuildStatus, initialStatus);
QFETCH(QString, input);
......@@ -253,11 +260,11 @@ void ProjectExplorerPlugin::testXcodebuildParserParsing()
QFETCH(QString, outputLines);
QFETCH(ProjectExplorer::XcodebuildParser::XcodebuildStatus, finalStatus);
tester->expectedFinalState = finalStatus;
childParser->m_xcodeBuildParserState = initialStatus;
testbench.testParsing(input, inputChannel,
tasks, childStdOutLines, childStdErrLines,
outputLines);
QCOMPARE(childParser->m_xcodeBuildParserState, finalStatus);
delete tester;
}
......
......@@ -62,6 +62,7 @@ private:
QString m_lastTarget;
QString m_lastProject;
#if defined WITH_TESTS
friend class XcodebuildParserTester;
friend class ProjectExplorerPlugin;
#endif
};
......@@ -74,6 +75,10 @@ public:
explicit XcodebuildParserTester(XcodebuildParser *parser, QObject *parent = 0);
XcodebuildParser *parser;
XcodebuildParser::XcodebuildStatus expectedFinalState;
public slots:
void onAboutToDeleteParser();
};
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment