diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-04-17 11:11:58 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-04-21 16:19:09 +0000 |
commit | d3d10cf23d61f4a011f1a7e9abdee1a92717e80f (patch) | |
tree | e52ef89d702abcd0a4f688c5c0aa7931038ed721 /tests/auto/testlib/selftests/tst_selftests.cpp | |
parent | 05d16937935ff830c3266c4a8566feed7fe33dbf (diff) |
Improve error handling in qtestlib
Dump a stack trace on Linux if the process crashes. This will give us
much better log output in the new CI system. In addition, create a
watch dog thread, that kills the test if the test function times
out (ie. hangs)
Implementations of the stack trace dumping for Mac and Windows
are still pending.
Change-Id: I65426c5afe290a0a2019b881436a0c278f1cafaf
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'tests/auto/testlib/selftests/tst_selftests.cpp')
-rw-r--r-- | tests/auto/testlib/selftests/tst_selftests.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 488b65c657..a5840d16d2 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -566,7 +566,9 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge #endif QProcess proc; - static const QProcessEnvironment environment = processEnvironment(); + QProcessEnvironment environment = processEnvironment(); + if (crashes) + environment.insert("QTEST_DISABLE_STACK_DUMP", "1"); proc.setProcessEnvironment(environment); const QString path = subdir + QLatin1Char('/') + subdir; proc.start(path, arguments); |