summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2020-01-09 17:03:49 +0100
committerLeander Beernaert <leander.beernaert@qt.io>2020-01-10 10:20:31 +0000
commitf4a630588f9c2947e28f65f07b9f4beb69330602 (patch)
treef963f837f97f1ebc3a81b01a1cc53e35b62db81b /tests/auto/corelib/global/qlogging/tst_qlogging.cpp
parent87622512f1c3fa7fb1ae885bd92b270cb4aabe1a (diff)
Fix tst_qlogging
Pass in the QT_CMAKE_BUILD define to change the expected executable name in the tests. Add special cases for missing compile flags that cause the collection of backtraces to fail otherwise. Change-Id: I53c44f7e4c6d597f941e4dd8173b3a39a615339c Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/corelib/global/qlogging/tst_qlogging.cpp')
-rw-r--r--tests/auto/corelib/global/qlogging/tst_qlogging.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
index 84e5ccce49..6c0470c8fe 100644
--- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
+++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
@@ -792,10 +792,17 @@ void tst_qmessagehandler::qMessagePattern_data()
#define QT_NAMESPACE_STR ""
#endif
+
+#ifdef QT_CMAKE_BUILD
+#define BACKTRACE_HELPER_NAME "qlogging_helper"
+#else
+#define BACKTRACE_HELPER_NAME "helper"
+#endif
+
#ifndef QT_NO_DEBUG
QTest::newRow("backtrace") << "[%{backtrace}] %{message}" << true << (QList<QByteArray>()
// MyClass::qt_static_metacall is explicitly marked as hidden in the Q_OBJECT macro
- << "[MyClass::myFunction|MyClass::mySlot1|?helper?|" QT_NAMESPACE_STR "QMetaMethod::invoke|" QT_NAMESPACE_STR "QMetaObject::invokeMethod] from_a_function 34");
+ << "[MyClass::myFunction|MyClass::mySlot1|?" BACKTRACE_HELPER_NAME "?|" QT_NAMESPACE_STR "QMetaMethod::invoke|" QT_NAMESPACE_STR "QMetaObject::invokeMethod] from_a_function 34");
#endif
QTest::newRow("backtrace depth,separator") << "[%{backtrace depth=2 separator=\"\n\"}] %{message}" << true << (QList<QByteArray>()
@@ -822,7 +829,7 @@ void tst_qmessagehandler::qMessagePattern()
#ifndef Q_OS_ANDROID
const QString appExe(QLatin1String(HELPER_BINARY));
#else
- const QString appExe(QCoreApplication::applicationDirPath() + QLatin1String("/libhelper.so"));
+ const QString appExe(QCoreApplication::applicationDirPath() + QLatin1String("/lib" BACKTRACE_HELPER_NAME ".so"));
#endif
//