summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/global/qlogging/app
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2014-07-13 13:07:40 +0200
committerOlivier Goffart <ogoffart@woboq.com>2014-07-28 09:03:47 +0200
commit9f598d5ee9819971613c27705bce39e505705903 (patch)
tree3d93919c84b5681509e5dcebdb2749279443fd62 /tests/auto/corelib/global/qlogging/app
parent04b92bfa1a0654f939dea0c0c13072089139149b (diff)
Logging: support %{backtrace} in QT_MESSAGE_PATTERN
On supported platform, allow to show a backtrace by using %{backtrace} or %{backtrace depth=N separator="|"} [ChangeLog][QtCore][Logging] QT_MESSAGE_PATTERN can include a backtrace using %{backtrace} Change-Id: Ib00418c070d3bd6fe846dc04bf69fa91ba64f9cd Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'tests/auto/corelib/global/qlogging/app')
-rw-r--r--tests/auto/corelib/global/qlogging/app/app.pro3
-rw-r--r--tests/auto/corelib/global/qlogging/app/main.cpp31
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/auto/corelib/global/qlogging/app/app.pro b/tests/auto/corelib/global/qlogging/app/app.pro
index 24ac571bac..b11e792a4c 100644
--- a/tests/auto/corelib/global/qlogging/app/app.pro
+++ b/tests/auto/corelib/global/qlogging/app/app.pro
@@ -10,3 +10,6 @@ CONFIG += console
SOURCES += main.cpp
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+gcc:!mingw: QMAKE_LFLAGS += -rdynamic
+
diff --git a/tests/auto/corelib/global/qlogging/app/main.cpp b/tests/auto/corelib/global/qlogging/app/main.cpp
index 621059caad..e190a48873 100644
--- a/tests/auto/corelib/global/qlogging/app/main.cpp
+++ b/tests/auto/corelib/global/qlogging/app/main.cpp
@@ -42,11 +42,37 @@
#include <QCoreApplication>
#include <QLoggingCategory>
+#ifdef Q_CC_GNU
+#define NEVER_INLINE __attribute__((__noinline__))
+#else
+#define NEVER_INLINE
+#endif
+
struct T {
T() { qDebug("static constructor"); }
~T() { qDebug("static destructor"); }
} t;
+class MyClass : public QObject
+{
+ Q_OBJECT
+public slots:
+ virtual NEVER_INLINE QString mySlot1();
+private:
+ virtual NEVER_INLINE void myFunction(int a);
+};
+
+QString MyClass::mySlot1()
+{
+ myFunction(34);
+ return QString();
+}
+
+void MyClass::myFunction(int a)
+{
+ qDebug() << "from_a_function" << a;
+}
+
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
@@ -65,5 +91,10 @@ int main(int argc, char **argv)
qDebug("qDebug2");
+ MyClass cl;
+ QMetaObject::invokeMethod(&cl, "mySlot1");
+
return 0;
}
+
+#include "main.moc"