summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/corelib/global/qlogging/app/app.pro11
-rw-r--r--tests/auto/corelib/global/qlogging/test/test.pro16
-rw-r--r--tests/auto/corelib/global/qlogging/tst_qlogging.cpp11
3 files changed, 26 insertions, 12 deletions
diff --git a/tests/auto/corelib/global/qlogging/app/app.pro b/tests/auto/corelib/global/qlogging/app/app.pro
index 30751d89ec..b90b685749 100644
--- a/tests/auto/corelib/global/qlogging/app/app.pro
+++ b/tests/auto/corelib/global/qlogging/app/app.pro
@@ -1,6 +1,15 @@
TEMPLATE = app
-TARGET = app
+debug_and_release {
+ CONFIG(debug, debug|release) {
+ TARGET = ../debug/helper
+ } else {
+ TARGET = ../release/helper
+ }
+} else {
+ TARGET = ../helper
+}
+
QT = core
DESTDIR = ./
diff --git a/tests/auto/corelib/global/qlogging/test/test.pro b/tests/auto/corelib/global/qlogging/test/test.pro
index 7c46ae9d16..8dafc4509c 100644
--- a/tests/auto/corelib/global/qlogging/test/test.pro
+++ b/tests/auto/corelib/global/qlogging/test/test.pro
@@ -1,11 +1,21 @@
CONFIG += testcase
-CONFIG -= debug_and_release_target
qtConfig(c++11): CONFIG += c++11
qtConfig(c++14): CONFIG += c++14
-TARGET = ../tst_qlogging
+debug_and_release {
+ CONFIG(debug, debug|release) {
+ TARGET = ../../debug/tst_qlogging
+ !winrt: TEST_HELPER_INSTALLS = ../debug/helper
+ } else {
+ TARGET = ../../release/tst_qlogging
+ !winrt: TEST_HELPER_INSTALLS = ../release/helper
+ }
+} else {
+ TARGET = ../tst_qlogging
+ !winrt: TEST_HELPER_INSTALLS = ../helper
+}
+
QT = core testlib
SOURCES = ../tst_qlogging.cpp
DEFINES += QT_MESSAGELOGCONTEXT
-!winrt: TEST_HELPER_INSTALLS = ../app/app
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
index 3465385ba7..863582f498 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,10 +100,6 @@ tst_qmessagehandler::tst_qmessagehandler()
void tst_qmessagehandler::initTestCase()
{
#if QT_CONFIG(process)
- m_appDir = QFINDTESTDATA("app");
- 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=")) {
@@ -802,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>()
@@ -823,7 +818,7 @@ void tst_qmessagehandler::qMessagePattern()
QFETCH(QList<QByteArray>, expected);
QProcess process;
- const QString appExe = m_appDir + "/app";
+ const QString appExe(QLatin1String("helper"));
//
// test QT_MESSAGE_PATTERN
@@ -866,7 +861,7 @@ void tst_qmessagehandler::setMessagePattern()
//
QProcess process;
- const QString appExe = m_appDir + "/app";
+ const QString appExe(QLatin1String("helper"));
// make sure there is no QT_MESSAGE_PATTERN in the environment
QStringList environment = m_baseEnvironment;