summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/eventloop
Commit message (Collapse)AuthorAgeFilesLines
* Add copyright and licensing to build system files missing itLucie Gérard2024-05-211-0/+2
| | | | | | | Task-number: QTBUG-124453 Change-Id: Ibb6a0ab839a16ceef3c68861bac2f508ddb3d1ae Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change license for tests filesLucie Gérard2024-02-041-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* QTest: add opt-in changing QCOMPARE etc to exit with throw, not returnMarc Mutz2024-01-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add exception classes and use them to change the control flow for QTEST_{FAIL,SKIP}_ACTION from return'ing from just the immediate function to the full way to the QTestLib infrastructure, here we filter them out. There are three modes: - If QT_NO_EXCEPTION, then we return - If QTEST_THROW_ON_... is also defined, #error out - Otherwise, if QTEST_THROW_ON_... is defined, always throw - Otherwise, the decision is made at runtime (with defaults read from QTEST_THROW_ON_... environment variables). Three selftests depend on the old behavior, as they explicitly check that multiple FAIL SKIP etc emerge, which the new framework, of course, prevents. Locally disable throwing at the test function level. Add initial docs and enable exceptions in all of the selftest subprograms to facilitate switching between the two runtime-selectable modes. [ChangeLog][QtTest] Added QTEST_THROW_ON_FAIL and QTEST_THROW_ON_SKIP C++ macros and environment variables that, when defined, change how QCOMPARE/QVERIFY/QSKIP etc exit the test function on failure. Instead of a return, exiting only the immediately-surrounding function, they throw a special exception instead, thereby exiting from subfunctions of the test function, all the way to QtTestLib. Fixes: QTBUG-66320 Change-Id: I96c38d2a1dcdd9de84942cf448a8bbf3ab6d3679 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QTestEventLoop: add enterLoop(std::chrono::milliseconds) overloadAhmad Samir2023-03-031-4/+6
| | | | | | | Task-number: QTBUG-110059 Change-Id: Ibf1d76afd313e390103be4a22e44af7fb41ace1b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix cmake warnings from using deprecated PUBLIC_LIBRARIESVolker Hilsheimer2022-09-051-1/+1
| | | | | | Pick-to: 6.4 Change-Id: I8d4f0d9e98edc4e06dda9f58e62197572b4cbdbc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix DeferredFlag implementation for QTestEventLoopEdward Welbourne2022-08-121-4/+12
| | | | | | | | | | | As discovered in the expanded testing of QTRY_COMPARE() using the same class, the timer needs a context object and a slot to call. This amends commit 35ad157d88c7bfcb9b90b01111b0f43dd2e012d9 Pick-to: 6.4 6.3 Task-number: QTBUG-104441 Change-Id: I41fc23de84ce8c7d6608db0005276a2071974494 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Add some testing of QTestEventLoopEdward Welbourne2022-08-082-0/+112
Fairly minimal for now, just enough to verify a bug and serve as the sign of success when it's fixed. Tests fail in ways they shouldn't, for now; see expected_eventloop.* for details, notably "Earlier test failed to clean up" messages. Pick-to: 6.4 6.3 Task-number: QTBUG-104441 Change-Id: I59be4aa5f21fed23b19a0593a8c2f6c9956507df Reviewed-by: Jason McDonald <macadder1@gmail.com>