aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quicktest/quicktest.pro
Commit message (Collapse)AuthorAgeFilesLines
* Add QQuickTest::qWaitForItemPolished()Mitch Curtis2018-10-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Verifying that an item was polished is quite common in Qt's auto tests: - The Qt Quick auto tests have a util function for it in visualtestutil.h (line 103). - "git grep polishScheduled -- tests/auto | wc -l" says that there are 269 usages of polishScheduled in Qt Quick auto tests, almost all of which look like this: QTRY_COMPARE(QQuickItemPrivate::get(item)->polishScheduled, false); - QQuickTableView's auto tests have their own function: #define WAIT_UNTIL_POLISHED \ QVERIFY(tableViewPrivate->polishScheduled); \ QTRY_VERIFY(!tableViewPrivate->polishScheduled) - More recently, QQuickMenu started requiring it (see menuutil.h). QQuickItem::polish() and QQuickItem::updatePolish() are both public functions, so the notion of polishing in Qt Quick is not new or hidden. This means that any user applications that have custom items that make use of the polish() => updatePolish() system will benefit from having a reliable method of testing their behavior. In addition, anyone wanting to simulate interaction with items in e.g. QQuickMenu will need this API if they don't want to use unreliable qWait() calls. With this in mind, this and the previous patch aim to standardise/ simplify the various private API checks and utility functions, and provide public API for users so that they can benefit from more reliable tests. When used together, the code will look like this: QVERIFY(QQuickTest::qIsPolishScheduled(item)); QVERIFY(QQuickTest::qWaitForItemPolished(item)); [ChangeLog][QtQuickTest][QQuickTest] Added QQuickTest::qWaitForItemPolished() for verifying that updatePolish() was called on an item. Fixes: QTBUG-71224 Change-Id: I8841910212e7f1a431ba845cae8a1ba7b4f4da67 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Exit test executable with failure if specified test functions are not foundKari Oikarinen2018-06-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | If QtQuickTest test executable was given filters that didn't match in any of the qml files run, it exited successfully. In combination with a Coin bug when the test function name contains a space, this allowed failing tests to pass the CI. If the test function fails, the repeat attempts would pass two arguments to the executable. Neither of those hit, but that wasn't considered a problem. Check that all of the test functions named on the command line are actually executed during the whole run and otherwise exit with a non-zero exit code. I assume there's no duplicates in the whole names of test functions scoped with testcase names. Task-number: QTBUG-68197 Change-Id: Icf7fe263945403f02920522dfd187aeb76b7cb3c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kalle Viironen <kalle.viironen@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Add QUICK_TEST_MAIN_WITH_SETUP to allow executing C++ before a QML testMitch Curtis2018-02-021-1/+2
| | | | | | | | | | | | | | | | | | | This macro is the same as QUICK_TEST_MAIN, but takes the user's QObject subclass as an argument, and calls pre-defined slots/invokable functions on it, similar to how e.g. init() is called for C++ tests. This allows e.g. context properties to be set for the QML tests. By basing the API on invokable functions, we give ourselves the freedom to easily add more functions in the future. [ChangeLog][QtQuickTest] Added QUICK_TEST_MAIN_WITH_SETUP macro to allow executing C++ before a QML test (such as registering context properties). Task-number: QTBUG-50064 Change-Id: Id566e388553811c220871248403d32545f8ae1eb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Revert "Make QtQuickTest::mouseEvent use QTest::mouseX"Jani Heikkinen2017-09-041-2/+1
| | | | | | | | | | | | | It seems this is causing QTBUG-62925 and QTBUG-62926 so revert is the best option at this point to proceed This reverts commit 4c46dce8fd9c9dddddd1d07f56396b3eabb2efc4. Change-Id: Ia8ea85c1ac1ada1752b29c9fbd8439f5963d46d2 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Make QtQuickTest::mouseEvent use QTest::mouseXAlbert Astals Cid2017-08-301-1/+2
| | | | | | | | | | | | Fixes QQuickItem::isUnderMouse returning wrong information when moving the mouse cursor with QtQuickTest::mouseX Also changes TestCase.mouseDrag to actually resemble more what real life does, i.e. send mouse moves with the same localPos if the item has already moved and update tst_drag.qml accordingly Change-Id: I80e4ab097da90d21ba987466c1b82467755a6b56 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix SignalSpy with QQmlPropertyMap signalsAlbert Astals Cid2016-11-301-0/+3
2e7d4ecdc59942b484159ca827f5d5dbc8787a1b caused the regression. To fix the regression I try accessing the signal name first and if it is not a function try accessing the handler name. Comes with a unit test to test both cases. Change-Id: I3897f344df9c6219636c70259eed503d9b76f09e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>