summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/tst_selftests.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2018-10-15 17:47:42 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2018-12-06 18:29:47 +0000
commit7c7e007794fb6dc34c7c816732d2ba0a911e488c (patch)
tree9b4e8ece4b814ca4a975aed2db6ced30ee1531f1 /tests/auto/testlib/selftests/tst_selftests.cpp
parentc3e6551d4d6712668e5fc8e307b3425db80af96d (diff)
Add a testlib selftest for the watchdog
Verify that it does cut in after the specified time has elapsed. Task-number: QTPM-1385 Change-Id: Ib18e8d6af28339f79cca4d62b869287ce07b8cc1 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Diffstat (limited to 'tests/auto/testlib/selftests/tst_selftests.cpp')
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp
index 5c97ad01d1..a5094c8b9e 100644
--- a/tests/auto/testlib/selftests/tst_selftests.cpp
+++ b/tests/auto/testlib/selftests/tst_selftests.cpp
@@ -505,6 +505,7 @@ void tst_Selftests::runSubTest_data()
<< "verifyexceptionthrown"
#endif //!QT_NO_EXCEPTIONS
<< "warnings"
+ << "watchdog"
<< "xunit"
;
@@ -621,7 +622,7 @@ void tst_Selftests::runSubTest_data()
|| subtest == QLatin1String("fetchbogus") || subtest == QLatin1String("crashedterminate")
|| subtest == QLatin1String("faildatatype") || subtest == QLatin1String("failfetchtype")
|| subtest == QLatin1String("crashes") || subtest == QLatin1String("silent")
- || subtest == QLatin1String("blacklisted");
+ || subtest == QLatin1String("blacklisted") || subtest == QLatin1String("watchdog");
QTest::newRow(qPrintable(QString("%1 %2").arg(subtest).arg(loggerSet.name)))
<< subtest
<< loggers
@@ -700,6 +701,8 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge
if (crashes) {
environment.insert("QTEST_DISABLE_CORE_DUMP", "1");
environment.insert("QTEST_DISABLE_STACK_DUMP", "1");
+ if (subdir == QLatin1String("watchdog"))
+ environment.insert("QTEST_FUNCTION_TIMEOUT", "100");
}
proc.setProcessEnvironment(environment);
const QString path = subdir + QLatin1Char('/') + subdir;
@@ -742,6 +745,7 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge
if (subdir != QLatin1String("exceptionthrow")
&& subdir != QLatin1String("cmptest") // QImage comparison requires QGuiApplication
&& subdir != QLatin1String("fetchbogus")
+ && subdir != QLatin1String("watchdog")
&& subdir != QLatin1String("xunit")
#ifdef Q_CC_MINGW
&& subdir != QLatin1String("blacklisted") // calls qFatal()