qt5base-lts/tests
Jarek Kobus db3d5a3097 Fix flaky QTimer::remainingTime() test
Before, we used not so accurate QTest::qWait(50)
to measure the accuracy of more precise timer's interval.
In addition, the checked range for remainingTime (50, 200)
was probably wrong, since by definition it couldn't be more than 150,
as we started the timer with interval of 200 and waited at least 50.

In this fix we have additional "tester" timer to measure remainingTime
of "tested" timer. The "tester" is a singleShot timer with interval of
50, and is started together with "tested" timer. Whenever the "tested"
timer timeouts, it restarts the "tester" timer - this is done desired
number of times (2 by default, like in the original test).

The test itself lies now inside tester's lambda. We fix the tested
range (at least 1, no more than 150). The minimum value could in
theory be greater, but it's enough to test that it's not overdue.

Finally, we wait for expected number of test runs. We give it twice
as much time as is in theory needed.

Task-number: QTBUG-83419
Task-number: QTBUG-58519
Change-Id: I43836d787d804f22bb66515ebb215d040189c4f3
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-09-10 02:49:59 +02:00
..
auto Fix flaky QTimer::remainingTime() test 2020-09-10 02:49:59 +02:00
baselineserver Use QList instead of QVector in benchmarks tests 2020-06-25 10:13:31 +02:00
benchmarks QStyleOptionGraphicsItem: remove deprecated member matrix/levelOfDetail 2020-09-06 18:31:43 +02:00
global tst_bic: Add linux-gcc-ia32 bic data for QtXml 2013-01-16 08:25:28 +01:00
libfuzzer Add ; to Q_UNUSED 2020-07-07 11:51:48 +02:00
manual Deliver Quit event when calling QCoreApplication::quit() 2020-09-07 14:41:16 +02:00
shared Use C++17 [[maybe_unused]] 2020-09-06 18:31:43 +02:00
testserver Fix perl script warning 2020-03-19 14:15:04 +00:00
.prev_CMakeLists.txt Make standalone tests build via top level repo project 2019-11-08 15:42:32 +00:00
CMakeLists.txt CMake: Properly handle CONFIG += thread aka Threads::Threads 2020-08-06 19:15:39 +02:00
README Doc: Fix references to Qt Test 2013-01-30 01:35:06 +01:00
tests.pro Build examples and tests only if their requirements are met 2017-03-22 15:55:55 +00:00

This directory contains autotests and benchmarks based on Qt Test. In order
to run the autotests reliably, you need to configure a desktop to match the
test environment that these tests are written for.

Linux X11:

   * The user must be logged in to an active desktop; you can't run the
     autotests without a valid DISPLAY that allows X11 connections.

   * The tests are run against a KDE3 or KDE4 desktop.

   * Window manager uses "click to focus", and not "focus follows mouse". Many
     tests move the mouse cursor around and expect this to not affect focus
     and activation.

   * Disable "click to activate", i.e., when a window is opened, the window
     manager should automatically activate it (give it input focus) and not
     wait for the user to click the window.