From f1bf7eb34a72cc5c58b3ee4e4ebf384e2539c202 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 21 Mar 2018 10:16:59 +0100 Subject: qtestlib/Unix: Output function time and total time in case of a crash This helps to distinguish timeouts from real crashes in COIN. This is already done for Windows. Change-Id: I4daeafa36f50482d20cea4bd1106647081ff7abe Reviewed-by: Mitch Curtis --- src/testlib/qtestcase.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/testlib') diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index d53530dadd..d03eb4c2c0 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -208,8 +208,13 @@ static void stackTrace() if (debuggerPresent()) return; +#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS) + 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 - fprintf(stderr, "\n========= Received signal, dumping stack ==============\n"); char cmd[512]; qsnprintf(cmd, 512, "gdb --pid %d 2>/dev/null </dev/null <