summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-07-19 14:32:40 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-07-19 21:17:35 +0200
commit0f32703aa5aee46bb2c0bfe9c8e54f05b82cf0f3 (patch)
tree2aec6b9c7fd2611e88e9541b8d2c1adf9fdd2c19 /src/testlib
parent7a4bf7bd05b34056ce2c583b441ede74d17e2640 (diff)
testlib: Disable automatic backtrace when test crashes on macOS on ARM
Take two. f20edffcc8089fe573e03bd5e092dafc9b0ce568 only disabled the backtrace preamble. Pick-to: 6.2 Change-Id: I972d007af59d13ec6eb11da44fc2b5e25c36e46e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtestcase.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index e42c776353..8d43815cc8 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -213,12 +213,13 @@ static void stackTrace()
return;
#if defined(Q_OS_LINUX) || (defined(Q_OS_MACOS) && !defined(Q_PROCESSOR_ARM_64))
+
const int msecsFunctionTime = qRound(QTestLog::msecsFunctionTime());
const int msecsTotalTime = qRound(QTestLog::msecsTotalTime());
fprintf(stderr, "\n=== Received signal at function time: %dms, total time: %dms, dumping stack ===\n",
msecsFunctionTime, msecsTotalTime);
-#endif
-#ifdef Q_OS_LINUX
+
+# ifdef Q_OS_LINUX
char cmd[512];
qsnprintf(cmd, 512, "gdb --pid %d 1>&2 2>/dev/null <<EOF\n"
"set prompt\n"
@@ -231,7 +232,7 @@ static void stackTrace()
if (system(cmd) == -1)
fprintf(stderr, "calling gdb failed\n");
fprintf(stderr, "=== End of stack trace ===\n");
-#elif defined(Q_OS_MACOS)
+# elif defined(Q_OS_MACOS)
char cmd[512];
qsnprintf(cmd, 512, "lldb -p %d 1>&2 2>/dev/null <<EOF\n"
"bt all\n"
@@ -241,6 +242,8 @@ static void stackTrace()
if (system(cmd) == -1)
fprintf(stderr, "calling lldb failed\n");
fprintf(stderr, "=== End of stack trace ===\n");
+# endif
+
#endif
}
#endif // !Q_OS_WASM