Commit Graph

144 Commits

Author SHA1 Message Date
Jari Helaakoski 4949768067 Fix test compilation issues with QtLite configuration
Now developer build tests compile, but some are not working.
Functional fix will come later via separate tasks.

Task-number: QTBUG-122999
Change-Id: I0a0dfcf7affb73f928b8be62b3576a6a51658488
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-04-30 09:00:03 +00:00
Sami Shalayel 9d3126b2ee dom: use only one DomCreationOptions per DomEnvironment
Currently, a DomEnvironment could load QML files with different
DomCreationOptions. This makes things more complicated when loading
dependencies, for example the implicit directory import might load a
qmldir file that imports another module that contains a certain QML
file, and then one has to remember which file triggered all of this
dependency loading and what DomCreationOptions it had.
In addition, there is currently no use case for something that
complicated.

Instead of that, move the DomCreationOptions to the DomEnvironment
itself. When a DomEnvironment is used to load a file and its
dependencies, it will use the DomCreationOptions set on this
DomEnvironment.
This ensures that all dependencies are loaded with the correct
DomCreationOptions, and avoids weird bugs in qmlls features due to
wrong DomCreationOptions used for dependencies.

Remove the DomCreationOptions from the FileToLoad struct, adapt the
DomEnvironment constructor and static factory method to expect a
DomCreationOptions parameter, and change all DomUniverse::load()
methods to have an extra DomCreationOptions parameter.

This commit will break the formatting tests so QSKIP them, at least
until the lazy-loading is done. The reason for the breakage is that the
Dom eagerly loads all QML files from imports, and that takes too much
time or crashes because it loads them now with the correct
DomCreationOptions instead of DomCreationOption::None.

For example, the formatting tests will implicitly load
nestedFunctions.qml via the implicit directory import with the
DomCreationOption::WithScriptExpressions and that will crash because
of the nested functions, see also QTBUG-122707.
Therefore QSKIP the formatting tests.

Also adapt the timeout for a test that imports QtQuick.Controls.Basic,
as the Dom also eagerly loads all the QML files from an imported module,
which takes much more time with the
DomCreationOption::WithScriptExpressions.

Task-number: QTBUG-122645
Change-Id: Icb7eb6d17df15fc6ea133e014c00153df5cd1492
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-14 11:41:58 +01:00
Lucie Gérard 9c5fc88388 Correct license for test files
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

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I26d72e8de04d4c7c57b3b7838af5d033265de5ba
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-02-27 10:32:21 +01:00
Dmitrii Akshintsev 37ef144704 DOM refactoring. Remove LoadOptions
Only defaultLoad is being used, hence it doesn't make sense to have them
at all at the current stage

Task-number: QTBUG-119550
Change-Id: I761e7c55d6aaafa29d234ace4b4b65bcc46a9855
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-01-30 17:14:09 +01:00
Ulf Hermann 7d2eecea4f QtQml: Add a benchmark that runs the DeltaBlue constraint solver
Change-Id: I4d9456dc910ade06febddb29d06e922c564bf015
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-01-30 17:14:09 +01:00
Dmitrii Akshintsev 3805424abc DOM refactoring. Move loadPendingDependencies to DomEnvironment
One of the goals of this refactoring is to move DomTop specific
functionality from DomItem API to the corresponding DomEnvironment
and DomUniverse.

This commit moves loading of the dependencies (which are added to
the pending load queue implicitly as part of the callbacks of the
loadFile when DomEnv is created without the flag "NoDependencies") to
the DomEnvironment interface

Moreover, once work with dependencies is happening through the
DomEnvironment explicitly, it allows us to get rid of "self"
parameter.

Task-number: QTBUG-119550
Change-Id: Ib3deb97eabe091ffded8c8c782ee08f8024468f2
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2024-01-18 18:46:18 +01:00
Dmitrii Akshintsev bb4391a93e DOM refactoring. Remove DomItem::loadItem. enable_shared_from_this for DomEnv*
As it was mentioned in the previous commits in the chain one of the
goals of the refactoring is to introduce clearer separation of
concerns.
Only DomTop types are allowed to load files, hence it's arguable
should be reflected in the interfaces explicitly.
With the help of previous commits the relevant pieces of this
function were moved to the corresponding DomEnvironment and DomUniverse
types.
This commit finally removes loadFile from the DomItem API.

*It's also worth noting that in order to minimaze refactoring
efforts and to keep the public API simple (not requiring
DomItem &self argument on the top level), this commit also makes
DomEnvironment a child of the std::enable_shared_from_this.
This somewhat "breaks" the initial design approach inscribed
in the DOM API allowing DomEnvironemt to get a shared_ptr to itself
bypassing corresponding DomItem.ownerAs<> API.
However, in the tradeoff of preserving consistency of the previous
design and the explicitness of the interface, I would value the latter,
hence I find this change acceptable.

Change-Id: Ic2ce3fc80876be6bdbec93e4d273e4c6b7a2b218
Task-number: QTBUG-119550
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-01-18 11:12:30 +01:00
Ulf Hermann 1f5b7d843d QmlDom: Add const-correctness
We almost never want non-const DomItems anywhere. There is exactly one
exception: From a MutableDomItem we need to poke into the internals of
the respective DomItem and const_cast them. However, MutableDomItem is
to be handled with care anyway.

Change-Id: I826f0669c049462beec9ad71dccb39c5191a1d3f
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2023-09-15 09:01:59 +02:00
Semih Yavuz aba25f94a3 Move dom construction time test into Benchmarks
It takes considerable time to finish as auto test, slowing down the
development speed. It should live in benchmarks.

Change-Id: I4cb6f7712774a6d36e000dec713db67019d84f6e
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2023-06-26 16:23:24 +02:00
Amir Masoud Abdol c2d37f9646 Retire the qt_parse_all_arguments
Task-number: QTBUG-99238
Change-Id: Ia11c9cbd7c06347319ab3674ec0cd8da0214747e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-20 16:40:42 +01:00
Mitch Curtis 955705d91c tst_qqmlchangeset: fix target name typo and de-duplicate tests
There was a typo in the auto test's target name, but fixing it also
requires renaming the benchmark which has the same name.

Pick-to: 6.2 6.4
Change-Id: I8e7b6de472ed84df0917584592f28d7015618331
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-11-01 17:11:17 +08:00
Marc Mutz 5eb52b7255 Port from container::count() and length() to size() - V5
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to
handle typedefs and accesses through pointers, too:

    const std::string o = "object";

    auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); };

    auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) {
        auto exprOfDeclaredType = [&](auto decl) {
            return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o);
        };
        return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))));
    };

    auto renameMethod = [&] (ArrayRef<StringRef> classes,
                            StringRef from, StringRef to) {
        return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)),
                            callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))),
                        changeTo(cat(access(o, cat(to)), "()")),
                        cat("use '", to, "' instead of '", from, "'"));
    };

    renameMethod(<classes>, "count", "size");
    renameMethod(<classes>, "length", "size");

except that on() was replaced with a matcher that doesn't ignoreParens().

a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'.

Change-Id: I58e1b41b91c34d2e860dbb5847b3752edbfc6fc9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-10-13 00:18:35 +02:00
Marc Mutz 958cd3ee10 Port from container::count() and length() to size()
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:

  auto QtContainerClass = anyOf(
      expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
      expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o));
  makeRule(cxxMemberCallExpr(on(QtContainerClass),
                             callee(cxxMethodDecl(hasAnyName({"count", "length"),
                                                  parameterCountIs(0))))),
           changeTo(cat(access(o, cat("size"), "()"))),
           cat("use 'size()' instead of 'count()/length()'"))

a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.

Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-07 23:38:48 +02:00
Lucie Gérard 1b9808737a Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: Id89ed14990804a5024183e75382cc539d4293da1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-07 17:01:30 +02:00
Ivan Solovev a83f4bc19d Tests: do not use QT_DISABLE_DEPRECATED_BEFORE
For several reasons:
* It was renamed to QT_DISABLE_DEPRECATED_UP_TO
* Its value will be propagated from the general Qt build

Task-number: QTBUG-104858
Change-Id: I90c92dc05b884f6408467c573181c00f8e00e6b3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-26 12:49:40 +02:00
Alexandru Croitor a8431a4067 CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers
Change-Id: I1cd769f85d5f82c43639d6787d98e536619249e6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-28 14:58:42 +02:00
Lucie Gérard 5a7b716474 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: I72c89a98c42bbc9234d8495e9e503bec81d11037
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-08 10:41:06 +02:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
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>
2022-06-11 08:05:15 +02:00
Sona Kurazyan 2c9c1590e6 Replace uses of deprecated _qs with _s/QStringLiteral
Task-number: QTBUG-101408
Change-Id: Ic925751b73f52d8fa5add5cacc52d6dd6ea2dc27
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-04-29 09:47:43 +02:00
Volker Hilsheimer aee6b231d0 Fix warnings in tests after QQmlListReference change
The engine parameter is no longer used.

Pick-to: 6.3
Change-Id: Ifc630eb4803a015d41df50210bd86947f6a5a472
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-03-21 12:45:58 +01:00
Edward Welbourne 4f59a2aeb0 Add a benchmark of Date.getTimeZoneOffset()
Test at many moments from spring 1967 (before the epoch) to summer
2046 (after 32-bit time_t's sign-wrap).

Change-Id: I3932cc1553a868b8815fda9a8dfc7644e4485704
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-11-23 18:12:38 +01:00
Edward Welbourne 9fd8c28bb3 Clean up tst_javascript
Inline the trivial constructor.
Get rid of the pointless destructor.
Use QDirIterator instead of QDir, to save collecting a bunch of
strings, only to iterate them, when we could simply iterate them.
Use QDirIterator::filePath() instead of adding fragments ourselves.
Use u"*.qml"_qs instead of constructing QString from ASCII.
Use QString::chopped(4) rather than left(size() - 4).
Use QScopedPointer to ensure tidy-up of allocated object.
Don't use 0 as a null pointer value.
Waste less vertical space.

Change-Id: I44f62f4e41f63de860f47114b2f47dddbf9746bc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-11-23 18:12:30 +01:00
Allan Sandfeld Jensen 72c3befaa2 Replace 0 pointer constants with nullptr
Replaced in most common patterns.

Change-Id: Idcaff1f2e915f29922702d3600a2e5f1e2418a7a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-10-18 12:39:28 +02:00
Craig Scott b6cb1e4877 Fix compiler warnings in test code
Change-Id: I201dcc375a5601c5655567b4c3dce3361c852b79
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-07-07 17:41:04 +10:00
Craig Scott 63a601dc29 CMake: Remove unneeded *.pro and .prev_CMakeLists.txt files
The .pro files corresponding to the .prev_CMakeLists.txt files
have already been removed.

Change-Id: I254eafe4c7de1a516e33bd9cb3d9879e73fa83b4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-19 10:46:06 +10:00
Maximilian Goldstein c603d30887 Add additional binding benchmarks
Change-Id: I82b2a099553e28ac004f0425d1544fbcb10c28c6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-24 09:29:30 +01:00
Maximilian Goldstein 5164b36501 Import property benchmarks from private repo
Change-Id: If45bf9bfcfee127263a2c0e49cfa55e12f9a6d0f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-02-04 09:29:59 +01:00
Fabian Kosmale 78ab4b8d8b Remove the qmake project files
Remove all qmake project files, except for examples which are used to
test that qmake continues to work.

Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-15 15:34:22 +01:00
Alexandru Croitor 08adbefa13 CMake: Regenerate projects to use new qt_internal_ API
Modify special case locations to use the new API as well.

Task-number: QTBUG-86815
Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-06 13:19:37 +02:00
Fabian Kosmale 22234c8a46 Remove deprecated QQmlListProperty constructor
[ChangeLog][QML][QQmlListProperty] Removed deprecated QQmlListProperty
constructor taking a reference. Use the overload taking a pointer
instead.

Change-Id: I8942026d1bb1c88065659d96d648a4b256d7d427
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-08-31 12:42:27 +02:00
Lars Schmertmann e79281533d Add ; to Q_UNUSED and UNUSED_PARAM
This is required to remove the ; from the macro with Qt 6.

Task-number: QTBUG-82978
Change-Id: Iead53d18fd790fb2d870d80ef2db79666f0d2392
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-26 19:18:03 +02:00
Lars Knoll cc6c5ae70b Port the remaining tests from QRegExp to QRegularExpression
Change-Id: If258701759c5da206948407feccd94e323af6b36
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-04-03 21:01:53 +02:00
Alexandru Croitor 971968fb92 CMake: Fix painting benchmark dependency on OpenGLWidgets
Change-Id: Ic7ed89c51e9a3cabda60ec99702b3aacd2cf5e97
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-16 14:04:20 +01:00
Alexandru Croitor 510af90b9f CMake: Fix duplicate target name for qquickwindow benchmark
Change-Id: I517d52e1ac35ae5d27d3e9ed676ebebdfe980db5
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-16 14:04:17 +01:00
Alexandru Croitor 14492ecee2 CMake: Regenerate and adapt to merge from dev
Change-Id: If8daa6152a563d4309d7342414780ef75b9f5589
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2020-03-12 14:05:23 +00:00
Alexandru Croitor 26c5243491 Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
	dependencies.yaml
	src/qml/qml/qqmlengine.cpp

Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
2020-03-12 15:03:03 +01:00
Fabian Kosmale 8e67e31a3b painting benchmark: adapt to openglwidgets split
Change-Id: I603635dfaaa455a5a66d7a791a36008f9fb9b770
Reviewed-by: Johan Helsing <johanhelsing@gmail.com>
2020-03-09 10:54:45 +01:00
Alexandru Croitor 1d4fa26a70 Regenerate qtdeclarative
Change-Id: I48d7fd306f3d1b161a8e73029282ee591b1ef612
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-02-12 17:30:34 +00:00
Ulf Hermann 789929f939 Use QTypeRevision for all versions and revisions
In many places we carry major and minor versions or revisions that are
loosely coupled to minor versions. As the Qt minor version resets now,
we need to handle these things more systematically. In particular, we
need to add a "major" part to revisions.

QTypeRevision can express the current major/minor pairs more efficiently
and can also be used to add a major version to revisions. This change
does not change the semantics, yet, but only replaces the types.

Change-Id: Ie58ba8114d7e4c6427f0f28716deee71995c0d24
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-02-03 15:22:12 +01:00
Alexandru Croitor b134476cdb Post-merge fixes
Change-Id: I2350df5368ee34d6c7072d456806e518ce533839
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-30 20:45:49 +00:00
Alexandru Croitor b684ba2194 Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
        dependencies.yaml

Change-Id: Ie3e9dc62031a85e5e81cbdf04694b95159d49fca
2020-01-29 16:52:58 +01:00
Qt Forward Merge Bot 649e6b762d Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-01-20 15:39:09 +00:00
Ulf Hermann a0872e077f Explicitly link paintbenchmark against widgets
Change-Id: Ife5ef02c77e2770bc67c28952830fbafba5f5cd1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-20 16:39:09 +01:00
Qt Forward Merge Bot b9519d9630 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/qml/qml/qqmlvaluetype.cpp
	tests/auto/qml/qml.pro

Change-Id: I78f992f83212bb9fd5e09b64163f15f046185224
2020-01-20 07:04:47 +00:00
Jarek Kobus e5f7c5f271 Don't use deprecated QMatrix class anymore
Task-number: QTBUG-46653
Change-Id: I3570c84014788b7b66d9cb54b77f9964ae15af6d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-01-17 11:35:38 +01:00
Leander Beernaert 1d333d3375 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
2020-01-16 16:25:06 +01:00
Ulf Hermann 1d964d5485 Port paintbenchmark to QOpenGLWidget
QGLWidget is gone.

Change-Id: Ief5d1edeff96afa739b58acbb3d83779f78d7838
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-01-09 10:08:09 +01:00
Alexandru Croitor ba494aaa24 Regenerate all projects with new CMake API version
Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-15 12:24:51 +00:00
Alexandru Croitor 91e32f86b5 Regenerate remaining tests to be in sync
Change-Id: I200c8f58ad13bc1bc78409a3ce49348584ba5b51
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-15 12:24:38 +00:00
Alexandru Croitor 6a0bb9a7d6 Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I4a91928610f79c8e21a05781953ffa41508c828a
2019-10-11 16:21:42 +02:00