tst_QLocalSocket: Fix not showing error output in processConnection

The stdout of the processes used in the test was dumped if there was an error,
but the processes write their error messages to stderr.

Use MergedChannels process channel mode to dump both output streams.

Change-Id: I1645fd31c394da0871ee6ae36d37ca9a04d86052
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
bb10
Kari Oikarinen 2018-02-26 15:17:39 +02:00
parent cb2a6f6a9f
commit 1875db1849
1 changed files with 2 additions and 0 deletions

View File

@ -969,12 +969,14 @@ void tst_QLocalSocket::processConnection()
QProcess producer;
ProcessOutputDumper producerOutputDumper(&producer);
QList<QProcess*> consumers;
producer.setProcessChannelMode(QProcess::MergedChannels);
producer.start(socketProcess, serverArguments);
QVERIFY2(producer.waitForStarted(-1), qPrintable(producer.errorString()));
for (int i = 0; i < processes; ++i) {
QStringList arguments = QStringList() << "--client";
QProcess *p = new QProcess;
consumers.append(p);
p->setProcessChannelMode(QProcess::MergedChannels);
p->start(socketProcess, arguments);
}