summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-05-09 01:00:49 +0200
committerLiang Qi <liang.qi@qt.io>2019-05-09 13:06:11 +0000
commite56d3b03ed92743f33eb7ca1a5aa61dbdedaf19b (patch)
treec29a80a940cca1281014732aff4237c915f32dc4 /tests/auto/testlib
parent2a79af6b5c67eba6f967c7443bf73bbe11206a62 (diff)
parent9444416a46ee0e6bb0d9d9be9a4883b388644c59 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: src/corelib/tools/qlocale_data_p.h (Regenerated by running the scripts in util/local_database/) src/gui/opengl/qopengltextureuploader.cpp Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
Diffstat (limited to 'tests/auto/testlib')
-rw-r--r--tests/auto/testlib/selftests/expected_sleep.lightxml4
-rw-r--r--tests/auto/testlib/selftests/expected_sleep.tap9
-rw-r--r--tests/auto/testlib/selftests/expected_sleep.teamcity2
-rw-r--r--tests/auto/testlib/selftests/expected_sleep.txt3
-rw-r--r--tests/auto/testlib/selftests/expected_sleep.xml4
-rw-r--r--tests/auto/testlib/selftests/expected_sleep.xunitxml3
-rw-r--r--tests/auto/testlib/selftests/sleep/tst_sleep.cpp19
7 files changed, 38 insertions, 6 deletions
diff --git a/tests/auto/testlib/selftests/expected_sleep.lightxml b/tests/auto/testlib/selftests/expected_sleep.lightxml
index 97b65d1259..78e1c44cf2 100644
--- a/tests/auto/testlib/selftests/expected_sleep.lightxml
+++ b/tests/auto/testlib/selftests/expected_sleep.lightxml
@@ -11,6 +11,10 @@
<Incident type="pass" file="" line="0" />
<Duration msecs="0"/>
</TestFunction>
+<TestFunction name="wait">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_sleep.tap b/tests/auto/testlib/selftests/expected_sleep.tap
index 7caef214d2..65edefb9ba 100644
--- a/tests/auto/testlib/selftests/expected_sleep.tap
+++ b/tests/auto/testlib/selftests/expected_sleep.tap
@@ -2,8 +2,9 @@ TAP version 13
# tst_Sleep
ok 1 - initTestCase()
ok 2 - sleep()
-ok 3 - cleanupTestCase()
-1..3
-# tests 3
-# pass 3
+ok 3 - wait()
+ok 4 - cleanupTestCase()
+1..4
+# tests 4
+# pass 4
# fail 0
diff --git a/tests/auto/testlib/selftests/expected_sleep.teamcity b/tests/auto/testlib/selftests/expected_sleep.teamcity
index 36b2445ccc..45a503bb54 100644
--- a/tests/auto/testlib/selftests/expected_sleep.teamcity
+++ b/tests/auto/testlib/selftests/expected_sleep.teamcity
@@ -3,6 +3,8 @@
##teamcity[testFinished name='initTestCase()' flowId='tst_Sleep']
##teamcity[testStarted name='sleep()' flowId='tst_Sleep']
##teamcity[testFinished name='sleep()' flowId='tst_Sleep']
+##teamcity[testStarted name='wait()' flowId='tst_Sleep']
+##teamcity[testFinished name='wait()' flowId='tst_Sleep']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_Sleep']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_Sleep']
##teamcity[testSuiteFinished name='tst_Sleep' flowId='tst_Sleep']
diff --git a/tests/auto/testlib/selftests/expected_sleep.txt b/tests/auto/testlib/selftests/expected_sleep.txt
index d18c3212bb..d1701d2bed 100644
--- a/tests/auto/testlib/selftests/expected_sleep.txt
+++ b/tests/auto/testlib/selftests/expected_sleep.txt
@@ -2,6 +2,7 @@
Config: Using QtTest library
PASS : tst_Sleep::initTestCase()
PASS : tst_Sleep::sleep()
+PASS : tst_Sleep::wait()
PASS : tst_Sleep::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+Totals: 4 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Sleep *********
diff --git a/tests/auto/testlib/selftests/expected_sleep.xml b/tests/auto/testlib/selftests/expected_sleep.xml
index 5729c0ac9d..94bb25ba8d 100644
--- a/tests/auto/testlib/selftests/expected_sleep.xml
+++ b/tests/auto/testlib/selftests/expected_sleep.xml
@@ -13,6 +13,10 @@
<Incident type="pass" file="" line="0" />
<Duration msecs="0"/>
</TestFunction>
+<TestFunction name="wait">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_sleep.xunitxml b/tests/auto/testlib/selftests/expected_sleep.xunitxml
index 138486fc02..e4ed66bcb8 100644
--- a/tests/auto/testlib/selftests/expected_sleep.xunitxml
+++ b/tests/auto/testlib/selftests/expected_sleep.xunitxml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<testsuite errors="0" failures="0" tests="3" name="tst_Sleep">
+<testsuite errors="0" failures="0" tests="4" name="tst_Sleep">
<properties>
<property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
<property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
@@ -7,6 +7,7 @@
</properties>
<testcase result="pass" name="initTestCase"/>
<testcase result="pass" name="sleep"/>
+ <testcase result="pass" name="wait"/>
<testcase result="pass" name="cleanupTestCase"/>
<system-err/>
</testsuite>
diff --git a/tests/auto/testlib/selftests/sleep/tst_sleep.cpp b/tests/auto/testlib/selftests/sleep/tst_sleep.cpp
index afe6e22120..b7b141afd0 100644
--- a/tests/auto/testlib/selftests/sleep/tst_sleep.cpp
+++ b/tests/auto/testlib/selftests/sleep/tst_sleep.cpp
@@ -36,6 +36,7 @@ class tst_Sleep: public QObject
private slots:
void sleep();
+ void wait();
};
void tst_Sleep::sleep()
@@ -53,6 +54,24 @@ void tst_Sleep::sleep()
QVERIFY(t.elapsed() > 1000 * 10);
}
+void tst_Sleep::wait()
+{
+ QElapsedTimer t;
+ t.start();
+
+ QTest::qWait(1);
+ QVERIFY(t.elapsed() >= 1);
+
+ QTest::qWait(10);
+ QVERIFY(t.elapsed() >= 11);
+
+ QTest::qWait(100);
+ QVERIFY(t.elapsed() >= 111);
+
+ QTest::qWait(1000);
+ QVERIFY(t.elapsed() >= 1111);
+}
+
QTEST_MAIN(tst_Sleep)
#include "tst_sleep.moc"