aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktestutils/qml/qmlutils.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QQmlDataTest: drop default try timeout from 5 seconds to 1Mitch Curtis2025-08-071-0/+2
| | | | | | | | | | | | Make debugging of failing tests less painful. The tests that had to be changed as a result are listed in the comments of the linked task. Fixes: QTBUG-138662 Task-number: QTBUG-81979 Change-Id: Iee50f2d4f2160e3e9bc2c7985925583fad810811 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QtQml: Move ExecutionEngine in to QJSEnginePrivateUlf Hermann2025-06-241-4/+2
| | | | | | | | | | | | | | The ExecutionEngine can live without a QQmlEngine or a QJSEngine, but not vice versa. Therefore, the ExecutionEngine has to outlive QQmlEngine and QJSEngine on shutdown. Since the ExecutionEngine lives longer now, we also need to postpone the pruning of the type registry. The engine might still hold on to types after all. Task-number: QTBUG-137848 Change-Id: Ib574cac84b5f2d974cbc24ed79550a58b69a7a1c Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Correct license for test filesLucie Gérard2024-04-111-1/+1
| | | | | | | | | | | | | According to QUIP-18 [1], all test files should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Task-number: QTBUG-121787 Pick-to: 6.7 Change-Id: Ib1dea3bf095aeb06e33a64db61a8c01219d12345 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Long live incremental garbage collection in QML!Fabian Kosmale2023-12-201-3/+3
| | | | | | | | | | | | | | | | | The design of the garbage collector is described in src/qml/memory/design.md. The gc and gcdone test helpers are adjusted to drive the gc to completion, even when in incremental mode. Parts of tst_qv4mm and tst_qqmlqt need to run with the incremental gc disabled, as they call gc inside QML and assumes that the GC finishes before returning. Initial-patch-by: Rafal Chomentowski <rafal.chomentowski@ge.com> Task-number: QTBUG-119274 Change-Id: I1d94f41bc7a434fad67de0fd46454b6db285f2eb Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Prepare tests for upcoming incremental gcFabian Kosmale2023-11-221-0/+29
| | | | | | | | | | | | | | | | | | | | | | This commit: - Introduces helper functions gcDone and gc. gcDone simply returns true as the gc is currently not incremental. gc is a helper method which has been copied into various tests already, which runs the garbage collections and sends events to clean up objects scheduled for deletion. The new helpers are placed in qmlutils.cpp. - It adds a flag to gc which allows not sending the posted events. That allows using gc in more places, while highlighting the fact that we don't want to process events at this point. This will also help upcoming changes to the incremental gc, which by default will use the event loop to drive the gc processing - It moves some gc calls from QML to C++ – this again will help later to ensure that the gc actually has completed As a driveby, the logging rules early in tst_qv4mm are reset earlier. Task-number: QTBUG-119274 Change-Id: I75d6ffcb3aa459b020e8257155faa91c39653d43 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QuickTestUtils: Make 'data' subdir configurableUlf Hermann2022-09-071-11/+14
| | | | | | | | tst_ecmascripttests wants to call it "test262". Task-number: QTBUG-100242 Change-Id: I978171a85fe6ade1cc40129db42ef9a5177fe90f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add convenience API for making QQmlDataTest-based tests fail on warningsMitch Curtis2022-07-051-2/+9
| | | | | | | | | | | | | | | | | | | | After this patch, if a QQmlDataTest-derived class passes FailOnWarningsPolicy::FailOnWarnings to the base constructor, any non-empty warning encountered by that test will result in a test failure. This avoids the need to duplicate the catch-all regex in tests that want to fail on warnings. The goal is to gradually enable failure-on-warnings over time. Leave comments and explicitly pass DoNotFailOnWarnings for tests that should never fail on warnings. Task-number: QTBUG-98718 Pick-to: 6.2 6.3 6.4 Change-Id: I4b647d93a0f28ac891c4bdb19ef74569f2918e8f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-111-27/+2
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQmlDataTest: fix dataDirectoryUrl generation for paths in qrcIvan Solovev2022-04-291-1/+1
| | | | | | | | | | | | | | | When the data directory is located in qrc (like on Android), the data directory url was generated incorrectly, missing the last '/'. As a result QQmlDataTest::dataDirectoryUrl().resolved("something") call was providing incorrect results. This patch fixes it, which allows to unblacklist tst_qqmlqt::resolvedUrl() for Android. Task-number: QTBUG-100014 Pick-to: 6.3 6.2 Change-Id: Id336a698b493edaa6e2ab7d36efbbef1f5acd1d6 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QuickTestUtilsPrivate: includemocsMarc Mutz2022-04-291-0/+2
| | | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-102948 Change-Id: I3c9d74e94b0fbbf1e5e9d59522f400485c959cb5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QQmlDataTest: Use custom cache directory and clean it upFabian Kosmale2021-11-261-0/+6
| | | | | | | | | | This should help with tests failing due to stale cachegen files. Task-number: QTBUG-98404 Change-Id: I9f9846f30e1c0e9335fc15fbfe8689c9a4f5d60b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Replace 0 pointer constants with nullptrAllan Sandfeld Jensen2021-10-181-4/+4
| | | | | | | Replaced in most common patterns. Change-Id: Idcaff1f2e915f29922702d3600a2e5f1e2418a7a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Consolidate test helpers into private librariesMitch Curtis2021-09-131-0/+121
Previously each test would include and build sources from the shared folder. Now we make those sources a library, build it once, then have each test link to it instead. We also take the opportunity to move some helpers that qtquickcontrols2 had added into the quicktestutils library where it makes sense, and for the helpers that don't make sense to be there, move them into quickcontrolstestutils. We add the libraries to src/ so that they are internal modules built as part of Qt, rather than tests. That way we can use them in a standalone test outside of qtdeclarative. Task-number: QTBUG-95621 Pick-to: 6.2 Change-Id: I0a2ab3976fdbff2e4414df7bdc0808f16453b80a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>