QNX: Force logging to stderr

Sub-process output is by default going to slog2 in
QNX so we need to force output to stderr instead.

1: FAIL!  : tst_qqmlapplicationengine::application(delayed quit) 'QString(testStdErr).endsWith(QString(expectedStdErr))' returned FALSE. (
1: Expected ending:
1: qml: Start: delayedQuit.qml
1: qml: End
1:
1: Actual output:

Pick-to: 6.2 6.3
Task-number: QTBUG-76546
Change-Id: I4a7b6c25b079f7dcc479fc2bcbd3b079bd7bc519
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Pasi Petäjäjärvi 2022-01-26 11:04:32 +02:00 committed by Fabian Kosmale
parent 7fcc9c7f58
commit 5bc77e9b9c
1 changed files with 5 additions and 0 deletions

View File

@ -162,6 +162,11 @@ void tst_qqmlapplicationengine::application()
#if QT_CONFIG(process)
QDir::setCurrent(buildDir);
QProcess *testProcess = new QProcess(this);
#ifdef Q_OS_QNX
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("QT_FORCE_STDERR_LOGGING", "1"); // QTBUG-76546
testProcess->setProcessEnvironment(env);
#endif
QStringList args;
args << qmlFile; // QML file passed as an argument is going to be run by testapp.
testProcess->start(QLatin1String("testapp/testapp"), args);