forked from qt-creator/qt-creator
AutoTest: Refactor output handling
Handle getting output from application's process inside base class and just process output inside the sub classes. Additionally this is a preparation for being able to process output for debugging tests as well. Change-Id: I8a2289dc7faab25afe08530b5021a0318f3ba6a6 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -38,14 +38,20 @@ TestOutputReader::TestOutputReader(const QFutureInterface<TestResultPtr> &future
|
||||
, m_testApplication(testApplication)
|
||||
, m_buildDir(buildDirectory)
|
||||
{
|
||||
connect(m_testApplication, &QProcess::readyRead, this, &TestOutputReader::processOutput);
|
||||
connect(m_testApplication, &QProcess::readyRead,
|
||||
this, [this] () {
|
||||
while (m_testApplication->canReadLine())
|
||||
processOutput(m_testApplication->readLine());
|
||||
});
|
||||
connect(m_testApplication, &QProcess::readyReadStandardError,
|
||||
this, &TestOutputReader::processStdError);
|
||||
this, [this] () {
|
||||
processStdError(m_testApplication->readAllStandardError());
|
||||
});
|
||||
}
|
||||
|
||||
void TestOutputReader::processStdError()
|
||||
void TestOutputReader::processStdError(const QByteArray &output)
|
||||
{
|
||||
qWarning() << "AutoTest.Run: Ignored plain output:" << m_testApplication->readAllStandardError();
|
||||
qWarning() << "AutoTest.Run: Ignored plain output:" << output;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user