From 0a06e1baf9e6da5308582b9dc928f4d9fea508d0 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 29 Dec 2016 17:11:24 +0100 Subject: Modernize the "thread" feature Add it to configure.json and replace all occurrences of QT_NO_THREAD with QT_CONFIG(thread). Add conditions for other features that depend on thread support. Remove conditions where we can use the QMutex and QThreadStorage stubs. Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/testlib/qtestcase.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/testlib') diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index d9fbfcffa8..32facaf12b 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -346,7 +346,9 @@ namespace QTest static int keyDelay = -1; static int mouseDelay = -1; static int eventDelay = -1; +#if QT_CONFIG(thread) static int timeout = -1; +#endif static bool noCrashHandler = false; /*! \internal @@ -397,7 +399,7 @@ int Q_TESTLIB_EXPORT defaultKeyDelay() } return keyDelay; } - +#if QT_CONFIG(thread) static int defaultTimeout() { if (timeout == -1) { @@ -409,6 +411,7 @@ static int defaultTimeout() } return timeout; } +#endif Q_TESTLIB_EXPORT bool printAvailableFunctions = false; Q_TESTLIB_EXPORT QStringList testFunctions; @@ -975,6 +978,8 @@ void TestMethods::invokeTestOnData(int index) const } } +#if QT_CONFIG(thread) + class WatchDog : public QThread { public: @@ -1026,6 +1031,17 @@ private: QWaitCondition waitCondition; }; +#else // !QT_CONFIG(thread) + +class WatchDog : public QObject +{ +public: + void beginTest() {}; + void testFinished() {}; +}; + +#endif + /*! \internal -- cgit v1.2.3