aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/pressandhold/pressandhold.pro
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-11-05 21:57:28 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-11-12 07:33:30 +0000
commitaad982d60fc6944813b350d7a312a1f1a0f3e1be (patch)
treec2d4d0fd624b3aec9f464403ec7f95999afed38b /tests/auto/pressandhold/pressandhold.pro
parent42bb18482c76b5bb862b65c77db691248c4573d4 (diff)
Refactor press and hold tests
We can't rely on timers in auto tests. They are not fired accurately under heavy CPU load => random CI failures. This change make the press and hold tests independent of timeouts. The idea in a nutshell: the test creates two control instances, and sends press events to both of them. Both controls run their timers and emit pressAndHold() - unless canceled. The test waits as long as it takes for the second control to emit pressAndHold(). At that point we can reliably assume that the first control would have already emitted the signal, if it was not canceled as appropriate. Change-Id: I96aaf4d204db368171209271a4a0fa2ff15cc323 Task-number: QTBUG-47963 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/pressandhold/pressandhold.pro')
-rw-r--r--tests/auto/pressandhold/pressandhold.pro9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/pressandhold/pressandhold.pro b/tests/auto/pressandhold/pressandhold.pro
new file mode 100644
index 00000000..ca76b74a
--- /dev/null
+++ b/tests/auto/pressandhold/pressandhold.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+TARGET = tst_pressandhold
+
+QT += quick testlib
+CONFIG += testcase
+osx:CONFIG -= app_bundle
+
+SOURCES += \
+ $$PWD/tst_pressandhold.cpp