summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-03-28 09:23:03 +0200
committerLiang Qi <liang.qi@qt.io>2017-03-28 09:28:31 +0200
commitb48a13fd6843e12b5725aa3ff0d010007e7c43b4 (patch)
tree316cfe36fc67906efcd92ff806c7c0da56ed4f8e /src/testlib
parent3398d9d40cb0dae2dc2a1a4f7dc3b4b9cceae903 (diff)
parent15fe60cfdada84ea519f08e905d59cc3fb6d20cd (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: examples/examples.pro tests/auto/corelib/tools/qchar/tst_qchar.cpp tests/auto/other/qaccessibility/accessiblewidgets.h Change-Id: I426696c40ab57d14dc295b8103152cede79f244c
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtestblacklist.cpp9
-rw-r--r--src/testlib/qtestcase.cpp2
-rw-r--r--src/testlib/qtestsystem.h6
3 files changed, 12 insertions, 5 deletions
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<QByteArray> activeConditions()
}
}
+ if (qEnvironmentVariableIsSet("QTEST_ENVIRONMENT")) {
+ for (const QByteArray &k : qgetenv("QTEST_ENVIRONMENT").split(' '))
+ result.insert(k);
+ }
+
return result;
}
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 2a6cad698f..8b0820b941 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -2327,7 +2327,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
}
diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h
index 4c611aab6b..f38a156936 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->window()->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->window()->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);
}