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
aec85a53df 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>
This commit is contained in:
Thiago Macieira 2022-05-03 18:23:17 -07:00
parent cfd5485d41
commit dface58142

View File

@ -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)