diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-11-27 13:08:24 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-12-03 17:46:23 (GMT) |
commit | c7739f7dd55a5a88e0efb00895f63d512cb16fe5 (patch) | |
tree | e0206958aed1918882738b0d6d4cefad72ec858c | |
parent | 7e80ffdf19946280fede44e39a9a740202d4e8e6 (diff) | |
download | Qt-c7739f7dd55a5a88e0efb00895f63d512cb16fe5.zip Qt-c7739f7dd55a5a88e0efb00895f63d512cb16fe5.tar.gz Qt-c7739f7dd55a5a88e0efb00895f63d512cb16fe5.tar.bz2 |
Don't force a crash handler in QtTest.
In some cases, it's best to just let the crash happen straight away.
Reviewed-by: Harald Fernengel
-rw-r--r-- | src/testlib/qtestcase.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 9dea6dc..7ab7201 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -846,6 +846,9 @@ namespace QTest static int mouseDelay = -1; static int eventDelay = -1; static int keyVerbose = -1; +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) + static bool noCrashHandler = false; +#endif void filter_unprintable(char *str) { @@ -976,6 +979,9 @@ static void qParseArgs(int argc, char *argv[]) " -keyevent-verbose : Turn on verbose messages for keyboard simulation\n" " -maxwarnings n : Sets the maximum amount of messages to output.\n" " 0 means unlimited, default: 2000\n" +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) + " -nocrashhandler : Disables the crash handler\n" +#endif "\n" " Benchmark related options:\n" #ifdef QTESTLIB_USE_VALGRIND @@ -1056,6 +1062,10 @@ static void qParseArgs(int argc, char *argv[]) } else { QTestLog::setMaxWarnings(qToInt(argv[++i])); } +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) + } else if (strcmp(argv[i], "-nocrashhandler") == 0) { + QTest::noCrashHandler = true; +#endif } else if (strcmp(argv[i], "-keyevent-verbose") == 0) { QTest::keyVerbose = 1; #ifdef QTESTLIB_USE_VALGRIND @@ -1661,7 +1671,8 @@ int QTest::qExec(QObject *testObject, int argc, char **argv) #endif { #if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) - FatalSignalHandler handler; + if (!noCrashHandler) + FatalSignalHandler handler; #endif qInvokeTestMethods(testObject); } |