summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2022-05-03 18:23:17 -0700
committerThiago Macieira <thiago.macieira@intel.com>2022-06-01 22:12:17 -0700
commitdface5814256769f02776b06705c33c0dd13a3e1 (patch)
treed553315223966998da316eed7a5228dc1f886316 /src/testlib/qtestcase.cpp
parentcfd5485d41b2bf519d5b3c5162726cce195782ac (diff)
QtTest: move the disabling of core dumps from load-time to qInit()
There's no reason it has to be done THAT early. It was added in commit aec85a53df3dbe3047c6db0f6eb39cb161cd3e6b to have the selftests (which do crash) not leave lots of core files around. I could replace it with a QProcess::setChildProcessModifier() function, but the variable is now documented in the QtTest manual, so it would be no gain. Function renamed to reflect its implementation. Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16ebc25df97a98e3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r--src/testlib/qtestcase.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index a6c1502bd1..7760ab8f8c 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -259,7 +259,7 @@ static bool hasSystemCrashReporter()
#endif
}
-static void disableCoreDump()
+static void maybeDisableCoreDump()
{
#ifdef RLIMIT_CORE
bool ok = false;
@@ -273,7 +273,6 @@ static void disableCoreDump()
}
#endif
}
-Q_CONSTRUCTOR_FUNCTION(disableCoreDump);
static DebuggerProgram debugger = None;
static void prepareStackTrace()
@@ -2143,6 +2142,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
void QTest::qInit(QObject *testObject, int argc, char **argv)
{
initEnvironment();
+ maybeDisableCoreDump();
QBenchmarkGlobalData::current = new QBenchmarkGlobalData;
#if defined(Q_OS_MACOS)