summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/testlib/doc/src/qttestlib-manual.qdoc14
-rw-r--r--src/testlib/qtestcase.cpp4
2 files changed, 16 insertions, 2 deletions
diff --git a/src/testlib/doc/src/qttestlib-manual.qdoc b/src/testlib/doc/src/qttestlib-manual.qdoc
index 87ac565278..73c010888f 100644
--- a/src/testlib/doc/src/qttestlib-manual.qdoc
+++ b/src/testlib/doc/src/qttestlib-manual.qdoc
@@ -362,6 +362,20 @@
Outputs the possible command line arguments and gives some useful help.
\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
To create a benchmark, follow the instructions for creating a test and then add a
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 7bca8de1b6..3227a66c05 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -190,7 +190,7 @@ static void disableCoreDump()
{
bool ok = false;
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)
struct rlimit limit;
limit.rlim_cur = 0;
@@ -206,7 +206,7 @@ static void stackTrace()
{
bool ok = false;
const int disableStackDump = qEnvironmentVariableIntValue("QTEST_DISABLE_STACK_DUMP", &ok);
- if (ok && disableStackDump == 1)
+ if (ok && disableStackDump)
return;
if (debuggerPresent() || hasSystemCrashReporter())