From 9e7d76946270216d46c8cf0d02427ca3c2109de3 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 1 Mar 2017 14:41:14 +0100 Subject: Use the same timeout value for all QTest::qWaitForWindow*() functions Some were 5s, others 1s. Pick one (the higher). Change-Id: I81929d4f49c2e41b4d4b75c3e2bf8ff75af868ad Reviewed-by: Friedemann Kleint --- src/testlib/qtestsystem.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/testlib') diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h index 08e240e25a..9c509690e4 100644 --- a/src/testlib/qtestsystem.h +++ b/src/testlib/qtestsystem.h @@ -114,14 +114,14 @@ namespace QTest #endif #ifdef QT_WIDGETS_LIB - inline static bool qWaitForWindowActive(QWidget *widget, int timeout = 1000) + inline static bool qWaitForWindowActive(QWidget *widget, int timeout = 5000) { if (QWindow *window = widget->windowHandle()) return qWaitForWindowActive(window, timeout); return false; } - inline static bool qWaitForWindowExposed(QWidget *widget, int timeout = 1000) + inline static bool qWaitForWindowExposed(QWidget *widget, int timeout = 5000) { if (QWindow *window = widget->windowHandle()) return qWaitForWindowExposed(window, timeout); @@ -131,7 +131,7 @@ namespace QTest #if QT_DEPRECATED_SINCE(5, 0) # ifdef QT_WIDGETS_LIB - QT_DEPRECATED inline static bool qWaitForWindowShown(QWidget *widget, int timeout = 1000) + QT_DEPRECATED inline static bool qWaitForWindowShown(QWidget *widget, int timeout = 5000) { return qWaitForWindowExposed(widget, timeout); } -- cgit v1.2.3 From 6d49311a5da483190136209dc902969d1ef4a217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 17 Mar 2017 14:13:59 +0100 Subject: Teach QTestLib to read QTEST_ENVIRONMENT to expand blacklist keywords Can be used by CI system to set QTEST_ENVIRONMENT="ci", allowing test to be blacklisted only for the CI. Task-number: QTBUG-59564 Change-Id: I7088abb888c179bafc621f11191efbc45c37b179 Reviewed-by: Friedemann Kleint Reviewed-by: Paul Olav Tvete --- src/testlib/qtestblacklist.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/testlib') diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp index 587930ca73..0ebc800fe1 100644 --- a/src/testlib/qtestblacklist.cpp +++ b/src/testlib/qtestblacklist.cpp @@ -82,7 +82,9 @@ QT_BEGIN_NAMESPACE msvc-2010 Keys are lower-case. Distribution name and version are supported if - QSysInfo's productType() and productVersion() return them. + QSysInfo's productType() and productVersion() return them. Keys can be + added via the space-separated QTEST_ENVIRONMENT environment variable. + The other known keys are listed below: */ @@ -184,6 +186,11 @@ static QSet activeConditions() } } + if (qEnvironmentVariableIsSet("QTEST_ENVIRONMENT")) { + for (const QByteArray &k : qgetenv("QTEST_ENVIRONMENT").split(' ')) + result.insert(k); + } + return result; } -- cgit v1.2.3 From e19fda916aa92f8890199dc4b9d56884c55d0cd8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 23 Mar 2017 15:18:00 -0700 Subject: Fix some warnings found by QNX's compiler -Werror is now disabled for that compiler, but it doesn't hurt to fix. io/qstandardpaths_unix.cpp:149:32: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] qtestcase.cpp:2330:31: error: narrowing conversion of '(ms / 1000)' from 'int' to '_Timet {aka unsigned int}' inside { } [-Werror=narrowing] Change-Id: Id92f4a61915b49ddaee6fffd14aea2c1e686e8f2 Reviewed-by: Samuli Piippo --- src/testlib/qtestcase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/testlib') diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index d0f4f76fe5..ac71954a55 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -2246,7 +2246,7 @@ void QTest::qSleep(int ms) #elif defined(Q_OS_WIN) Sleep(uint(ms)); #else - struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 }; + struct timespec ts = { time_t(ms / 1000), (ms % 1000) * 1000 * 1000 }; nanosleep(&ts, NULL); #endif } -- cgit v1.2.3