aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/ecmascripttests/tst_ecmascripttests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Clean up ECMAScript test runnerUlf Hermann2025-06-181-15/+19
| | | | | | | | | | | | | | Remove some unused code and allow it to run without QProcess. We can use threads after all. Also, activate the "filter" mode via an environment variable. Running only a subset of the tests is very handy at times. Most of the dead code was supposed to be used with the qjstest executable from d9c4a527241e0ef3a30e990c518197b0ba345b50, but d08ede57dd530a67c3420b3858fe39bf1e5eb598 removed qjstest in favor of using tst_ecmascripttests itself for all ways of running the tests. Change-Id: I0d220964a98c3f49e97fc6650cf3169db5644af5 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QtQml: Avoid direct file access in ECMAScript test runnerUlf Hermann2025-06-171-1/+3
| | | | | | | | | | | | | | | | | | We want the type loader to do this job rather than poorly duplicate it in the test. In particular, the local implementation didn't properly register the dependencies of loaded ECMAScript modules. So far we could only load ECMAScript modules using the type loader if their file names ended it ".mjs". The ECMAScript test suite does not follow this convention. In order to deal with that, we need to add a second characteristic. ECMAScript modules can now also be marked using a URL fragment "#module". Furthermore, since JavaScript files loaded outside any QML document get full access to the global context, we introduce another URL fragment "#global" to discern them from the same files loaded from a QML document. Change-Id: I625088335d16d5b8eeaa2673f07718367dca1605 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Tests: include QTest, not QtTestGiuseppe D'Angelo2025-04-151-1/+1
| | | | | | | | | | | | | Never use module-wide inclusions. They blow up build times. For QtTest this is usually just a typo (QTest was meant instead). Add missing includes as needed. In the diffs I've spotted other huge inclusions (QtQuick, QtQml), but those need more attention. Task-number: QTQAINFRA-7110 Pick-to: 6.9 6.8 Change-Id: I74bf3fe212f50a7a3a6af2b1c80bbcaabc2516d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Correct license for test filesLucie Gérard2024-02-271-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 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>
* tst_ecmascript: Run tests on separate processes instead of threadsOlivier De Cannière2023-12-201-5/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, tests were run in parallel on separate threads. This was faster than running them on only one but was still significantly slower than it could be, on Windows. This is due to them sharing the same heap and the fact that each memory allocation and free would temporarilly lock the heap for all other threads making the tests run much slower than on other platforms. This patch changes the way the test is run so that each js test file is run on a separate process. This ensures that the heap is no longer being shared by all test runners and reduces overhead significantly. The test runner processes listen for test data in JSON format over their standard input, run the test, return the results over their standard output and then wait for the next test data. tst_ecmascripttests on 13900k with 32 threads Debug MSVC Windows Debug GCC Linux threads: 569s 105s processes: 89s (~ -84%) 52s (~ -50%) On platforms where QT_CONFIG(process) returns false, the tests fallback to running on threads as before. Change-Id: Id51fc9d6e0d5ef0ae5c88f96b0119aa99e57f0fe Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_ecmascripttests: Adapt to renaming of logging categoryUlf Hermann2023-10-201-2/+2
| | | | | | | | Amends commit 1bd18723f72b451d3c5abf4560b4dd31394e5243. Change-Id: I2752af68dd463cb8a81cc3ff90a2653e876f6cfb Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QML: Test ECMAScript compliance on all platformsUlf Hermann2022-09-301-6/+7
| | | | | | Fixes: QTBUG-100242 Change-Id: Iddd9be89b11327afb1e1e520992d52fe8de524b0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Tests: Define function timeout in C++ rather than CMakeUlf Hermann2022-09-131-1/+4
| | | | | | | | | Setting the timeout in C++ is more robust because it applies to all ways of starting the test binary, not only ctest. Task-number: QTBUG-100242 Change-Id: Ifd51b2b1067b2c8d6bb90615129fc26f36a76e90 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use QQmlDataTest in tst_ecmascripttests.cppUlf Hermann2022-09-071-6/+10
| | | | | | | | This should make it possible to run the tests on android. Task-number: QTBUG-100242 Change-Id: I7bec37d2cfda21e43979b4f33faf827f7a6c9017 Reviewed-by: Fabian Kosmale <fabian.kosmale@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>
* Split two long lines for the sake of readabilityEdward Welbourne2022-06-101-2/+8
| | | | | | | | It's easier to see which flags are being set this way. Pick-to: 6.4 Change-Id: I5ed7e9bcedacde19cb751512d404a872981f6eb0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Suppress ES-compiler warnings against the ES-262 test-suiteEdward Welbourne2022-06-101-2/+44
| | | | | | | | | | | | | | | | | | V4's ES-compiler warns about assorted variables in the ES-262 test-suite being used before declaration. We aren't about to fix that test-suite, so the warnings are just noise to us. As there are many of them, they overflow the QTestLib logger's -maxwarnings threshold, causing actually relevant messages (like test failures) to be lost in the output. Install a trivial QLoggingCategory::CategoryFilter to filter out warnings and debug for the qt.qml.compiler category (and all sub-categories of it). Condition this on a define so that someone who actually wants to see those warnings can turn them on. Pick-to: 6.4 Change-Id: If7decc241b407e816f5d7979b32f31a9f614d30f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Enable the ES testsuite on macOSSimon Hausmann2018-07-181-2/+2
| | | | | | | | | After commit 42cc42acae8b4b5d8aa79e0d4f079b4322588ce7 in qtbase, QString::localeAwareCompare should work now on all platforms in accordance with what we need in the ES testsuite. Change-Id: I42dd2ac44e3b14e1cad42cfbe46efb8c401b454b Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Fix running the ES test suiteSimon Hausmann2018-07-021-2/+2
| | | | | | | | | When we have one or more failures, make sure that the auto-test fails. This produces a few additional failures but oddly also "fixes" some tests that are marked as expected failure. Change-Id: I0bbbed463b326336ab9caa33f434520c90ed36de Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use the new test runner for the autotestLars Knoll2018-05-021-33/+15
| | | | | | | It's quite a bit faster than the old test runner. Change-Id: If7e59dd175d740f3f702032f4affeff786be8a32 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* V4: Only start JITting after a minimum of 3 callsErik Verbruggen2017-12-141-2/+23
| | | | | | Change-Id: I748e06041f3085980ce48391ba2d829a9d86a727 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix the fix to get test262 runningErik Verbruggen2017-07-041-0/+1
| | | | | Change-Id: I96d4200c452fcb05bf25e7a0f24ebd90eddc509e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix the runner for test262Erik Verbruggen2017-07-041-13/+1
| | | | | Change-Id: Ie292bae849abf1f2d5bd2da3f7cc913dd66a7bef Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Also run the ecmascript testsuite in the interpreterErik Verbruggen2017-06-081-1/+1
| | | | | | Change-Id: Ibc3e67273bf01dccfad132b53aef6e5241883d97 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Minor cleanup: Don't require QtGui for ES6 testsSimon Hausmann2017-03-291-1/+1
| | | | | | | We don't need a QGuiApplication to launch test262.py Change-Id: I3f8e200245a30d88f3c6ff578be414ec76bcfb9c Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Run ES5 tests on Linux/x86-64Simon Hausmann2017-03-241-0/+77
This requires including the test suite as a submodule by default and bumping the module to a new sha1 that removes some particularly long paths. Also force the test suite to run under a US locale, as tests like ch15/15.5/15.5.4/15.5.4.7/S15.5.4.7_A1_T11 cannot deal with locale dependent output for date formatting. The test harness now returns a non-zero exit code when a test fails. This is used by the QTestLib wrapper to determine success or failure. The tests with JIT are run, but the tests with the interpreter are omitted at the moment until the last failure is fixed. The tests add about 10-15 minutes extra time to the total time it takes to run tests on Linux in the CI. Change-Id: Id01fd3b41350f9c9a6ce9e43236f51f7f0fb71c8 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>