Commit Graph

136 Commits

Author SHA1 Message Date
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
Liang Qi 729addd82e Support standalone tests building
Also fix some build issues regarding tests.

Change-Id: Ie9ba8a0b7932ae2b542614b6c824c4071ad0b548
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-09-02 11:23:38 +00:00
Sona Kurazyan 4268258b8d Remove the last usages of deprecated APIs
- Replaced the usages of deprecated APIs by corresponding
  alternatives.

- Fixed building the tests with disabled deprecated APIs.

Task-number: QTBUG-76491
Change-Id: Ie8c5deb22c2074d39a64346c20e5384a7b2ad99b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-20 11:20:47 +02:00
Leander Beernaert 4e14f6e70a Add QtDeclarative Test Coverage
All tests compile and run on a developer build.

These tests are failing:
tst_qqmlsqldatabase Fails due to missing sql driver
tst_qqmlsqldatabase Fails in wip/qt6
tst_ququicklayouts Fails in wip/qt6
tst_flickableinterop Fails in wip/qt6
tst_qquickpinchandler Fails in wip/qt6
tst_qquickflickable Fails in wip/qt6
tst_qquickgridview Fails in wip/qt6
tst_qquickimage Fails due to missing jpeg plugin
tst_qquicklistview Fails in wip/qt6
tst_qquicktext Fails in wip/qt6
tst_qquickcanvasitem Fails in wip/qt6
tst_scenegraph Fails due to missing jpeg plugin
tst_TestFiltering Fails in wip/qt6

Change-Id: I4b9d69c118e23c095cb72ad5a67653fc30943bb1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-14 14:01:58 +00:00
Sona Kurazyan 76880675d0 Remove usages of deprecated qSort
Task-number: QTBUG-76491
Change-Id: If8dbbc129a07bedc5970b82c6698cfcfad755b49
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-06-20 22:02:49 +02:00
Chris Adams b4ee855eb1 Fix tst_librarymetrics_performance benchmark
Revert "tst_librarymetrics_performance: Use QBENCHMARK macro instead of rolling our own"
This reverts commit 7377e8f950.

By using QBENCHMARK in the way 7377e8f950 did, engine construction
and other unwanted side effects were included in each benchmark run.

This commit also adds more comments to document the reasons behind
using a custom benchmark harness rather than QBENCHMARK, and also to
document more precisely the purpose of each individual benchmark to
ensure that future maintainers don't accidentally introduce
side-effects into the benchmarked code sections which could
contaminate the benchmark results.

Task-number: QTBUG-43096
Change-Id: Ib917bfd5a5ac59690d2e237080f995cb646d724a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-02-27 01:54:20 +00:00
Liang Qi 2570b801c7 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	.qmake.conf
	src/qml/compiler/qv4codegen.cpp
	src/qml/compiler/qv4compileddata_p.h
	src/qml/debugger/qqmlprofiler_p.h
	src/qml/jsruntime/qv4engine.cpp
	src/qml/memory/qv4mm.cpp
	src/qml/qml/qqmlcomponent.cpp
	src/qml/qml/qqmlobjectcreator.cpp
	src/qml/qml/qqmlobjectcreator_p.h
	src/qml/types/qqmldelegatemodel.cpp
	src/quick/items/qquickitem_p.h
	src/quick/items/qquickwindow.cpp
	tests/auto/quick/touchmouse/BLACKLIST
	tests/benchmarks/qml/holistic/tst_holistic.cpp

Change-Id: I520f349ab4b048dd337d9647113564fc257865c2
2018-01-24 09:34:11 +01:00
Allan Sandfeld Jensen 1b96186d14 Create new engine for each benchmark run
Otherwise we end up with too many mmap'ed blocks as they appear not to
be deallocated until the engine is destroyed.

Change-Id: I88b8dd6d570423a492ddc6c7f105d0db97caa72d
Task-number: QTBUG-60590
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-01-17 16:20:09 +00:00
Erik Verbruggen 0dbdfaa78d Fix holistic benchmark
Each test now uses its own QQmlEngine, instead of using a single
instance across all benchmarks. The effect is that peak heap usage
(on macos) is now about 77MB, where it previously peaked at 770MB. This
benchmark would actually crash on some platforms due to excessive
malloc/mmap usage.

Change-Id: I214f7b9b3d8c5565c0578b82c9c144ec87ed0f2b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-02 09:52:04 +00:00