diff options
author | Janne Juntunen <janne.juntunen@qt.io> | 2022-01-14 10:01:20 +0200 |
---|---|---|
committer | Janne Juntunen <janne.juntunen@qt.io> | 2022-02-03 14:24:21 +0200 |
commit | 5170574532c8f739f8218748cc09bd1b3dc71afa (patch) | |
tree | 0b327d6360db97ba4906d33c0e37db348bfd4dde /tests/auto/corelib | |
parent | 06942138d6fc274777c57b4d30b34fa64ca8f1e4 (diff) |
tst_qlogging: use correct qlogging_helper path on webOS
Switched to use runtime path instead of compile time path for the
helper executable. Some tests cases were failing on webOS because of
wrong path.
Fixes: QTBUG-99846
Pick-to: 6.3
Change-Id: I566bc04bdb96ac6e7dd0a875eadb50685aef8282
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r-- | tests/auto/corelib/global/qlogging/tst_qlogging.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp index af4a5989d8..a6a2c1d139 100644 --- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Copyright (C) 2014 Olivier Goffart <ogoffart@woboq.com> ** Contact: https://www.qt.io/licensing/ ** @@ -62,6 +62,7 @@ private slots: void formatLogMessage(); private: + QString backtraceHelperPath(); QStringList m_baseEnvironment; }; @@ -777,11 +778,7 @@ void tst_qmessagehandler::qMessagePattern() QFETCH(QList<QByteArray>, expected); QProcess process; -#ifndef Q_OS_ANDROID - const QString appExe(QLatin1String(HELPER_BINARY)); -#else - const QString appExe(QCoreApplication::applicationDirPath() + QLatin1String("/lib" BACKTRACE_HELPER_NAME ".so")); -#endif + const QString appExe(backtraceHelperPath()); // // test QT_MESSAGE_PATTERN @@ -827,11 +824,7 @@ void tst_qmessagehandler::setMessagePattern() // QProcess process; -#ifndef Q_OS_ANDROID - const QString appExe(QLatin1String(HELPER_BINARY)); -#else - const QString appExe(QCoreApplication::applicationDirPath() + QLatin1String("/libhelper.so")); -#endif + const QString appExe(backtraceHelperPath()); // make sure there is no QT_MESSAGE_PATTERN in the environment QStringList environment; @@ -928,6 +921,19 @@ void tst_qmessagehandler::formatLogMessage() QCOMPARE(r, result); } +QString tst_qmessagehandler::backtraceHelperPath() +{ +#ifdef Q_OS_ANDROID + QString appExe(QCoreApplication::applicationDirPath() + + QLatin1String("/lib" BACKTRACE_HELPER_NAME ".so")); +#elif defined(Q_OS_WEBOS) + QString appExe(QCoreApplication::applicationDirPath() + + QLatin1String("/" BACKTRACE_HELPER_NAME)); +#else + QString appExe(QLatin1String(HELPER_BINARY)); +#endif + return appExe; +} QTEST_MAIN(tst_qmessagehandler) #include "tst_qlogging.moc" |