QTestLib: allow for non-zero values in env variables
The usual behavior for env variables is that any nonzero value means "enable", so do the same for a couple of QTestLib env vars. While at it: document them. Change-Id: I854285df5d7af5be771f9d6532ddec5d8a6f8987 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 89def082c6db80e877e2a6a33db41b67f94cdf46) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f3d1d963c7
commit
ba291add45
@ -362,6 +362,20 @@
|
|||||||
Outputs the possible command line arguments and gives some useful help.
|
Outputs the possible command line arguments and gives some useful help.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
|
\section1 Qt Test Environment Variables
|
||||||
|
|
||||||
|
You can set certain environment variables in order to affect
|
||||||
|
the execution of an autotest:
|
||||||
|
|
||||||
|
\list
|
||||||
|
\li \c QTEST_DISABLE_CORE_DUMP \br
|
||||||
|
Setting this variable to a non-zero value will disable the generation
|
||||||
|
of a core dump file.
|
||||||
|
\li \c QTEST_DISABLE_STACK_DUMP \br
|
||||||
|
Setting this variable to a non-zero value will prevent Qt Test from
|
||||||
|
printing a stacktrace in case an autotest times out or crashes.
|
||||||
|
\endlist
|
||||||
|
|
||||||
\section1 Creating a Benchmark
|
\section1 Creating a Benchmark
|
||||||
|
|
||||||
To create a benchmark, follow the instructions for creating a test and then add a
|
To create a benchmark, follow the instructions for creating a test and then add a
|
||||||
|
@ -190,7 +190,7 @@ static void disableCoreDump()
|
|||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
const int disableCoreDump = qEnvironmentVariableIntValue("QTEST_DISABLE_CORE_DUMP", &ok);
|
const int disableCoreDump = qEnvironmentVariableIntValue("QTEST_DISABLE_CORE_DUMP", &ok);
|
||||||
if (ok && disableCoreDump == 1) {
|
if (ok && disableCoreDump) {
|
||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_INTEGRITY)
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_INTEGRITY)
|
||||||
struct rlimit limit;
|
struct rlimit limit;
|
||||||
limit.rlim_cur = 0;
|
limit.rlim_cur = 0;
|
||||||
@ -206,7 +206,7 @@ static void stackTrace()
|
|||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
const int disableStackDump = qEnvironmentVariableIntValue("QTEST_DISABLE_STACK_DUMP", &ok);
|
const int disableStackDump = qEnvironmentVariableIntValue("QTEST_DISABLE_STACK_DUMP", &ok);
|
||||||
if (ok && disableStackDump == 1)
|
if (ok && disableStackDump)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (debuggerPresent() || hasSystemCrashReporter())
|
if (debuggerPresent() || hasSystemCrashReporter())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user