Commit Graph

318 Commits

Author SHA1 Message Date
Alexandru Croitor 0de113d379 CMake: Don't cross-compile qjtest
Previously it was only excluded on ANDROID, but cross-compiled for
other platforms.

The executable should only be built when the target Qt is meant
to be used as a development SDK, to be executed on some host machine.

Because at the moment we lack a proper abstraction for that, as a work
around, we exclude building it when cross-compiling.

The executable is not called automatically by any test, it is only run
manually by a developer.

In the future, the qt_internal_add_tool call should likely be replaced
by a customized qt_internal_add_app call, installing the executable
into $prefix/libexec rather than $prefix/bin.

Amends 5a55e52638

Pick-to: 6.2 6.3
Task-number: QTBUG-92591
Task-number: QTBUG-100040
Task-number: QTBUG-100047
Change-Id: If20e73fe378acd51fe41d181078d273a7842fc81
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-01-20 19:33:01 +01:00
Ulf Hermann 3027d8ed74 V4: Fix naming of array data classes
Provide convenience wrappers for access to const/mutable data, properly
discern between the "buffer" object and the actual data, especially
regarding shared/detached state.

Change-Id: I48f1f1eb8c204c29277746e5dee63892cbf3ac89
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-01-20 19:33:01 +01:00
Assam Boudjelthia 5a55e52638 Android: Disable qjstest and qml ecmascripttests tests
qjstest and ecmascripttests fail to be configured on Android,
and require CMake API changes to fix that. They could be disabled
in the meantime to allow CI builds to proceed when building tests for
other modules that depend on qtdeclarative.

Task-number: QTBUG-92591
Task-number: QTBUG-88846
Pick-to: 6.2
Change-Id: I58e17166efc844efd089cce44d81dba027e9198c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-10-13 12:03:41 +00:00
Joerg Bornemann 0d6d3c7bc5 Skip unnecessary commands when cross-building tools
Call qt_internal_return_unless_building_tools() directly after
qt_internal_add_tool() to avoid having to special-case code for when
this function only creates imported targets in cross-builds.

Task-number: QTBUG-85084
Change-Id: I5c8f2ecdf4936cfd15cb530e896bc4e5b5531620
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-10-08 10:37:35 +02:00
Ulf Hermann b3fe31a0ff Fix scoping of JavaScript function names
Function declarations add their name to the outer scope, but not the
inner scope. Function expressions add their name to the inner scope,
unless the name is actually picked from the outer scope rather than
given after the function token.

We don't add the name to any scope in the case of functions declared in
QML elements because the QML element will receive the function as
appropriately named, and typed, property. It is always better to use
that one than to use a JavaScript local.

This causes some additional ecmascript tests to pass.

Pick-to: 6.2
Fixes: QTBUG-96625
Change-Id: I0b8ee98917d102a99fb6b9bd918037c71867a4a5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-09-29 13:39:41 +02:00
Maximilian Goldstein 5f7ecce233 Implement optional chaining
This change implements optional chaining (https://github.com/tc39/proposal-optional-chaining) by adding a new type of optional lookup with an offset to the end of a chain.
If `undefined` or `null` is encountered during an access marked as optional, we jump to that end offset.

Features:
- Full support for all kinds of optional chain
- With some codegen overhead but zero overhead during normal non-optional FieldMemberExpression resolution
- Properly retains this contexts and does not need to resolve anything twice (this has been an issue previously)
- No extra AST structures, just flags for existing ones

[ChangeLog][QtQml] Added support for optional chaining (https://github.com/tc39/proposal-optional-chaining)

Fixes: QTBUG-77926
Change-Id: I9a41cdc4ca272066c79c72b9b22206498a546843
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-13 19:19:56 +02:00
Ulf Hermann ed66d06355 ecmascripttests: Increase timeout to 15 minutes
Apparently our CI is too slow to run the test in 8:20 minutes.

Also, remove cruft from the CMakeLists.txt file.

Change-Id: I4778dbc3cd95e04f6cf71dbd363b366d73e6dbb3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-18 21:49:09 +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
Ulf Hermann d5ac54da62 ecmascript tests: Also raise timeout when built with cmake
pro2cmake did not convert the QTEST_FUNCTION_TIMEOUT environment
variable. As a result, when the test runs for more than 300s, it gets
killed by the watchdog.

Pick-to: 6.0
Change-Id: I370d2c1b7a129c41d690d41e84f0a51810d37160
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-12-18 14:32:03 +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 4b2eb2c5b9 test252runner.cpp: Add override
Change-Id: I9d1bc607015f47c327f5d721e809b22a79225815
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-07-28 19:20:52 +02:00
Alexandru Croitor 0f19f571ee CMake: Regenerate projects
We need the qt_add_tool changes to successfully configure qemu builds.
The rest of the changes are just to be in sync with the .pro files.

Change-Id: I7bcc08ac58f57a5761aedef09761428c55235289
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-07-09 15:51:40 +02:00
Ulf Hermann 8603a0177a Revert accidental downgrade of test262
Change-Id: I93a1ae4309ba01e92e43a4ba2d3b0ece4a5104f9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-06-11 18:09:24 +02:00
Eirik Aavitsland b62500a008 Remove remaining OpenGL dependency in QSGDefaultInternalImageNode
As a driveby, remove an unused opengl #include from
qsgdefaultspritenode.cpp

Task-number: QTBUG-84623
Change-Id: I6e901a0ac0a23a2d21029b5337c204835e29026a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-11 11:18:21 +02:00
Alexandru Croitor 350a2f48c1 CMake: Regenerate qtdeclarative/tests
Includes:
 - new api calls
 - some new dependencies
 - some TARGET_DESCRIPTION
 - some additional tool directory exclusion when cross-compiling
   (qmlplugindump)
 - some missing add_subdirectory calls

Change-Id: Iea43e45b94f37367ffc1d8dd6ce0ff1021a31b1a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-29 10:01:25 +02:00
Edward Welbourne 22d5156d99 Update test-suite with latest local changes
Change-Id: If8e9f503f2fac1bef8ce81d6343a2ec62cdf49e4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-05-25 17:50:31 +02: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
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
Simon Hausmann 44f24c43ad Prospective workaround for accidental c++11 build with 10.14
When switching to macOS 10.14 and the xcode we install there,
mysteriously qtbase switches from c++17 to c++11 when compiling the
tests, which breaks this particular test as it includes
qv4arraydata_p.h, which in turn requires C++14's std::aligned_storage_t.

Once we enforce C++17 in qtbase this should not be needed anymore, but
we can only enforce that once we've switched to macOS 10.14.

Change-Id: Iaa2b55dfd2bfd23f908a211ca90255ef522bc6ff
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-01-31 20:33:42 +01: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 a4fe2d9209 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp

Change-Id: I133bfd4bd9dd6f704252c956c90f05e8a8a40d6a
2020-01-29 13:31:19 +00:00
Ulf Hermann 31d05c6734 ArrayPrototype::method_filter: Check for exception after callback
If there was an exception we cannot assume the returned value holds
anything sensible. Also, we should immediately return.

Fixes: QTBUG-81581
Change-Id: I822c204c476e05d6de78124b66ab2f939ca38ffd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-23 12:45:07 +01:00
Qt Forward Merge Bot bbea1b8a3a Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I88e94fe3398a59f10c5a8b142204db5f3ccb2657
2020-01-23 01:00:44 +01:00
Morten Johan Sørvig 6597d99014 Blacklist two failing ecmascripttests on macOS
Task-number: QTBUG-81581
Change-Id: I1c117383776bc498f0c8a6a94322259df79f4e8f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-01-22 15:05:34 +00:00
Leander Beernaert 1d333d3375 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
2020-01-16 16:25:06 +01:00
Ville Voutilainen 867209bbb3 Implement TypedArray.from
Task-number: QTBUG-80030
Change-Id: I2d4c30257f543d9d7013aaf394a2a0874eacb266
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-09 10:55:59 +02:00
Maximilian Goldstein 8fadf5d374 qml/parser: Implement nullish coalescing
Implements the '??' operator as specified in https://github.com/tc39/proposal-nullish-coalescing.

Also adds a few tests.

Task-number: QTBUG-77926
Change-Id: I3993450c192d11bf1ade0662d945c1553b4c6976
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2019-12-05 14:28:47 +01:00
Ulf Hermann 41dd68344c QQuickTableView: Clear items before deleting the model
Fixes: QTBUG-71374
Change-Id: I534b7612268bb9407844961267865f490d7ff7b2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-12-04 14:08:47 +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 387f360b3b Regenerate tests
Change-Id: I67a6c8f1659e7b471a4fcb92a2699292cf4eea81
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-14 10:22:34 +00:00
Shawn Rutledge e2df4233a7 PathView: grab mouse on press if already moving
A side effect of 8fd398c9d2 is that it
became possible for the highlight to stop between items, rather than
snapping to a specific item, if the user taps, clicks or drags an
additional time while the movement is ongoing.  That was because it
didn't get a mouse grab, so it missed the release event.
QQuickPathViewPrivate::handleMouseReleaseEvent() needs to take care of
the snapping behavior after the user stops dragging.  This only affects
behavior in the case that the PathView is already moving and the mouse
is pressed again: we assume the user wants to alter the PathView's
velocity, not interact with any delegate inside or with any parent item.

Task-number: QTBUG-77173
Task-number: QTBUG-59620
Change-Id: I7b2f69a6ef8d8022d7c917a5bf9e8fb40c8848db
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-09-23 17:56:44 +02:00
Qt Forward Merge Bot cd9c5c2bf9 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/qml/jit/qv4baselinejit.cpp
	src/qml/jsruntime/qv4vme_moth.cpp
	tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp

Change-Id: Iec7cd27ddad0281bd3b7833fb6b252f66a6ae5d6
2019-09-17 09:58:09 +02:00
Antti Kokko 7b47350736 Add changes file for Qt 5.12.5
Change-Id: I147d3faefac8114e08a0594a0c43b3cdae959804
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-08-26 13:35:44 +00:00
Alexandru Croitor 2be575b4b1 Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I6f2152aeecaeb8e63fdbc1cdf1444132a054b6f5
2019-08-15 18:44:54 +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
Liang Qi d526a72c44 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/quick/handlers/qquickpointerdevicehandler.cpp
	src/quick/scenegraph/qsgdefaultglyphnode.cpp
	src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
	src/quick/scenegraph/qsgdefaultglyphnode_p_p.h
	tests/auto/qml/qjsengine/tst_qjsengine.cpp

Done-With: Jan Arve Sæther <jan-arve.saether@qt.io>
Done-With: Laszlo Agocs <laszlo.agocs@qt.io>
Change-Id: I35749152f8dce44b9af8d52b1283629879010f11
2019-07-26 17:05:34 +02:00
Marc Mutz b15a745c38 Fix compilation with C++20
Implicit capture of 'this' in [=] is deprecated in C++20.

Fix by using explicit captures.

Change-Id: I49b0fd2751c1d239c4f801224b71872c227fd697
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-08 12:24:14 +02:00
Qt Forward Merge Bot 10e3b24c02 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/qml/jsruntime/qv4value_p.h
	src/qml/qml/qqmlmetatype.cpp
	src/qml/qml/qqmltypewrapper.cpp
	src/quick/items/qquicktableview.cpp

Change-Id: I684f8e01a711580512848bf1253f39b39fcbf4c7
2019-06-11 11:28:44 +02:00
Ulf Hermann 3e716029ae Don't add local for anonymous function's "name"
Instead, populate their "name" property directly from the surrounding
object pattern if applicable, without adding locals. This fixes some
ecmascript tests where functions were assigned to the key "eval" in an
object. The JS engine then rejected that because you shouldn't use eval
in strict mode. That should be close enough to test for regressions.

Fixes: QTBUG-75880
Change-Id: Iacc45a3f7b0eb90cddc6ecf6d2bada616d2cf355
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-21 18:03:47 +02:00
Ulf Hermann 7f7d87c68d Split CompiledData::CompilationUnit in two
We need a CompilationUnit that only holds the data needed for
compilation and another one that is executable by the runtime.

Change-Id: I704d859ba028576a18460f5e3a59f210f64535d3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-16 12:09:23 +00:00
Jani Heikkinen 93ed9213f7 Update tests/auto/qml/ecmascripttests/test262
Task-number: QTBUG-73454
Task-number: QTBUG-71209
Change-Id: I12925ce49cc18f4bb6908a5515fc476b32a222dc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
(cherry picked from commit 896d49a4e1)
2019-03-22 12:11:40 +00:00
Ulf Hermann a126b566dc Upgrade Yarr to latest version from WebKit
This is an upgrade to commit cbb0aa18662bc26da31de91e2104c030eaa6ead2 in
webkit. It causes some more ecmascript tests to pass.

Fixes: QTBUG-73915
Change-Id: I8bb5ff9b37907d17b1020576ba64f0b3aed2f1b3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-02-26 09:32:51 +00:00
Jani Heikkinen 896d49a4e1 Update tests/auto/qml/ecmascripttests/test262
Task-number: QTBUG-73454
Change-Id: I12925ce49cc18f4bb6908a5515fc476b32a222dc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-08 12:11:03 +00:00
Lars Knoll 729b1ceb89 Correctly scope unwind handlers for try blocks
Make sure the unwind handler is always reset when leaving the
try block.

This exposes a couple of failures in the ECMAScript test suite
that were before passing by pure luck.

Task-number: QTBUG-72858
Change-Id: I014b1e37c2beff136ecd53a665a2f10933f7e12c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2019-01-30 14:39:52 +00:00
Lars Knoll 33c13efd91 Ensure our builtin constructors are subclassable
Respect the newTarget passed into those constructors and make
sure we set up the proto chain correctly.

Change-Id: I3d12c7dbef4b33660a6715d73e9fb0f89105167a
Fixes: QTBUG-71138
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2018-11-22 08:47:08 +00:00
Lars Knoll a7948a7519 Properly mark variables as unresolved when accessed from eval
If we can't resolve the variable and are executing eval code,
we need to look it up by name, and not generate a lookup in the
global object.

Change-Id: I693b3b714651911f72620160bfc463d6dbb00820
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-16 09:17:09 +00:00
Lars Knoll b1f07986c3 Create proper template objects for tagged templates
If a tagged template gets evaluated multiple times, the
underlying template object is shared.

Change-Id: Ie2f476fbc93d5991322ce1087c42719a8d8333ae
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-05 21:15:39 +00:00
Lars Knoll 0fce92af2c Correctly read files with a \0 in them
At least one test case uses this, so let's make sure
we read them correctly.

Change-Id: I9f4ea7785b5a400cd6f0b210a6a98975bbbaf7ce
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-05 21:14:54 +00:00
Lars Knoll 9755cf48cb Create proper template objects
Create the proper template object for a tagged template.
This fixes quite a few use cases (esp. String.raw), but is not
yet 100% spec compliant.

Change-Id: I69eaee22c384c0d1bd2c6c56ad711d29521b0b86
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-02 18:44:11 +00:00