diff options
Diffstat (limited to 'tests/auto/corelib/global/qlogging/tst_qlogging.cpp')
-rw-r--r-- | tests/auto/corelib/global/qlogging/tst_qlogging.cpp | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp index e7a3748c30..d3ed1a6d0d 100644 --- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp @@ -64,7 +64,6 @@ private slots: void formatLogMessage(); private: - QString m_appDir; QStringList m_baseEnvironment; }; @@ -101,14 +100,6 @@ tst_qmessagehandler::tst_qmessagehandler() void tst_qmessagehandler::initTestCase() { #if QT_CONFIG(process) -# ifdef Q_OS_ANDROID - m_appDir = QCoreApplication::applicationDirPath(); -# else // !android - m_appDir = QFINDTESTDATA("app"); -# endif - QVERIFY2(!m_appDir.isEmpty(), qPrintable( - QString::fromLatin1("Couldn't find helper app dir starting from %1.").arg(QDir::currentPath()))); - m_baseEnvironment = QProcess::systemEnvironment(); for (int i = 0; i < m_baseEnvironment.count(); ++i) { if (m_baseEnvironment.at(i).startsWith("QT_MESSAGE_PATTERN=")) { @@ -806,7 +797,7 @@ void tst_qmessagehandler::qMessagePattern_data() #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|?app?|" QT_NAMESPACE_STR "QMetaMethod::invoke|" QT_NAMESPACE_STR "QMetaObject::invokeMethod] from_a_function 34"); + << "[MyClass::myFunction|MyClass::mySlot1|?helper?|" 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>() @@ -830,10 +821,10 @@ void tst_qmessagehandler::qMessagePattern() QFETCH(QList<QByteArray>, expected); QProcess process; -#ifdef Q_OS_ANDROID - const QString appExe = m_appDir + "/libapp.so"; -#else // !android - const QString appExe = m_appDir + "/app"; +#ifndef Q_OS_ANDROID + const QString appExe(QLatin1String("helper")); +#else + const QString appExe(QCoreApplication::applicationDirPath() + QLatin1String("/libhelper.so")); #endif // @@ -880,10 +871,10 @@ void tst_qmessagehandler::setMessagePattern() // QProcess process; -#ifdef Q_OS_ANDROID - const QString appExe = m_appDir + "/libapp.so"; -#else // !android - const QString appExe = m_appDir + "/app"; +#ifndef Q_OS_ANDROID + const QString appExe(QLatin1String("helper")); +#else + const QString appExe(QCoreApplication::applicationDirPath() + QLatin1String("/libhelper.so")); #endif // make sure there is no QT_MESSAGE_PATTERN in the environment |