aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp
Commit message (Collapse)AuthorAgeFilesLines
* tst_ecmascript: Run tests on separate processes instead of threadsOlivier De Cannière2023-12-201-854/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Add a heartbeat messageFabian Kosmale2023-11-231-1/+6
| | | | | | | | | The test sometimes gets killed, because it runs for a very long time without any output. Avoid that by peridoically printing a heartbeat message. Change-Id: Ib39f75ce1ab9e38b6390ead64b729eb82095ba5d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Test262Runner: fix -Wunused-but-set-variableMarc Mutz2023-01-201-4/+0
| | | | | | | | | | | | | | | | | | | | | The 'int line' variable is shadowed a few lines below by the 'QByteArray line' one, even in the initial commit, so it can never have been used, except for the increment in the first line of the loop's bodies. Remove the variable, fix the warning. Found by Clang 15: test262runner.cpp:380:9: warning: variable 'line' set but not used [-Wunused-but-set-variable] int line = 0; ^ Amends d9c4a527241e0ef3a30e990c518197b0ba345b50. Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I2139aa4552d1ff2ddbb5737e2a1b26650d6519e7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-5/+5
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I601bf70f020f511019ed28731ba53b14b765dbf0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Port from container::count() and length() to size()Marc Mutz2022-10-071-3/+3
| | | | | | | | | | | | | | | | | | | | 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>
* Use QQmlDataTest in tst_ecmascripttests.cppUlf Hermann2022-09-071-17/+19
| | | | | | | | 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>
* QML: Make modules imported with registerModule() available in QMLUlf Hermann2022-09-021-6/+6
| | | | | | | | | So far, you could only use them from pure JavaScript programs. Also, fix re-exporting parts of native modules. Fixes: QTBUG-105901 Change-Id: I170017083284e6457b1aa0c6e606fd26227edae3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Print assert messages in tst_ecmascripttestsSami Shalayel2022-09-011-45/+60
| | | | | | | | | | Up to now, just the test result (pass or fail) was saved during testing. Add an errorMessage in the test result that is retrieved from the engine and print it out when a test is failling. Fixes: QTBUG-106096 Change-Id: I73f9f7daaa92a942d89391043682d8d9ebbcdfa3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-111-27/+3
| | | | | | | | | | | | 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>
* Make uninteresting JS-test output easier to ignoreEdward Welbourne2022-06-101-10/+18
| | | | | | | | | | | | | | | | | | | | | | | The JS-tests produce so much output that it routinely surpasses the maximum number of debug messages testlib is willing to produce, after which it cuts off and we don't get to see the output of failing tests, which we actually need to see. Add a logging category, just for this test, and condition the boring bits on this category being enabled. Those are all qCDebug()s, so disable the category for debug by default. In the process, re-enable a commented-out qDebug() by converting it to use the new logging category (and fixing the bit-rot that it had suffered while commented out). This should mean any future Coin failures in this test are reported more usefully. If seeing all the PASS lines is really important to you, enable category "qt.v4.ecma262.tests" in your Qt logging options and pass -maxwarnings with a huge value when you run the test. Pick-to: 6.4 Change-Id: I8ba1f6575120fcef533ae756d31cc40635c13370 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* V4: Fix naming of array data classesUlf Hermann2022-01-201-2/+2
| | | | | | | | | | | 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>
* test252runner.cpp: Add overrideFabian Kosmale2020-07-281-1/+1
| | | | | Change-Id: I9d1bc607015f47c327f5d721e809b22a79225815 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-261-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix compilation with C++20Marc Mutz2019-07-081-1/+1
| | | | | | | | | | | | | | | | | | 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>
* | Split CompiledData::CompilationUnit in twoUlf Hermann2019-05-161-1/+1
|/ | | | | | | | 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>
* Correctly read files with a \0 in themLars Knoll2018-11-051-2/+2
| | | | | | | | 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>
* Skip all realm related testsLars Knoll2018-09-081-0/+14
| | | | | | | | We don't support realms currently, and it's unclear whether we'll ever need the support. Change-Id: I023f84d477f374b3cef2590a78542c0c9408a144 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement the $262.detachArrayBuffer() method for testingLars Knoll2018-08-201-0/+38
| | | | | Change-Id: I30ddca4402254e1cde17712d07ea0bff2ea5f595 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add support for compiling ES modules ahead of timeSimon Hausmann2018-08-171-1/+1
| | | | | | | | | | | | This is also pretty straight-forward by adding .mjs as supported extension in the qmake and cmake support. This also tweaks qv4engine.cpp to share the same module compilation function across all code paths. Change-Id: Ia0e23c78a794f2330ecf8f991ee6ea948f4ac89d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add support for disk caching of ES modulesSimon Hausmann2018-08-171-1/+1
| | | | | | | | | | | | | | | | | | Two minor fixes needed for this otherwise straight-forward change: (1) When compiling modules, use the full url for the source file of the compilation unit, as that's what we use for the relocation check when loading the cache file. (2) Record the proper source time stamp for cache invalidation. As a bonus, when importing scripts from .qml files, we now also attempt to use the cached version that we created on the fly in an effort to replace heap memory with mmap backed memory - just like we do for .qml files. Change-Id: I5b03a18e3c44d537c3242cb1d969636df32fe42a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add initial basic support for ES6 modulesSimon Hausmann2018-08-091-20/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The entry point from the parsing perspective into modules is not QV4::Script but QV4::ExecutionEngine::compileModule. For convenience, the ESModule AST node gets a body, which is the statement list connected between the ModuleItemList items that are not import/export declarations. The QV4::Module allocates a call context where the exported variables are stored as named locals. This will also become the module namespace object. The imports in turn is an array of value pointers that point into the locals array of the context of the imported modules. The default module loading in ExecutionEngine assumes the accessibility of module urls via QFile (so local file system or resource). This is what qmljs also uses and QJSEngine as well via public API in the future. The test runner compiles the modules manually and injects them, because they need to be compiled together with the test harness code. The QML type loader will the mechanism for injection in the future for module imports from .qml files. Change-Id: I93be9cfe54c651fdbd08c5e1d22d58f47284e54f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Enable running module testsSimon Hausmann2018-07-311-2/+10
| | | | | | | They all fail right now (unless pass by accident). Change-Id: I0a64bd29459ef32f555614a1decea3419bd44170 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Exclude ES6 module fixtures from the test planSimon Hausmann2018-07-311-0/+2
| | | | | | | | As per INTERPRETING.md, files ending with _FIXTURE.js should be excluded. Change-Id: I31d12dd7a30216ad67a46b8572bdaff43e697a03 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix running the ES test suiteSimon Hausmann2018-07-021-3/+4
| | | | | | | | | 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>
* Fix running the test suite on WindowsSimon Hausmann2018-06-251-0/+1
| | | | | | | | | | By "accident" it appears that the files in the submodule have \n line-endings in the CI. However in a regular developer checkout, the YAML test harness config file has \r\n endings and that requires fixing before attempting to parse the YAML. Change-Id: I98bba1864433d5b44741dd7863125b13ae7b58de Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix running ES tests with ASAN -Og buildsSimon Hausmann2018-05-091-1/+1
| | | | | | | | | These builds appear to require more stack space than without ASAN, but fortunately doubling from 8 to 16 appears to do be sufficient to avoid an overflow. Change-Id: I023e36dddc1b3b6b28f2b8d0658d9aa8491d5843 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add Generator supportLars Knoll2018-05-031-2/+6
| | | | | | | | | | | | | Add support for ES6 generators. Those are currently always executed in the interpreter (we never JIT them), to simplify the initial implementation. Most functionality, except for 'yield *' expressions are supported. 'yield *' will have to wait until we support for(... of ...) Change-Id: I7c059d1e3b301cbcb79e3746b4bec346738fd426 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Raise the stack limit of threads in the threadpoolLars Knoll2018-05-021-0/+1
| | | | | | | | | | On some platforms (e.g. macOS), the default stack size for secondary threads is only 512k, which isn't enough to run all our tests. Raise the value to 8M (in line with the stack size on Linux and the main thread on macOS. Change-Id: I6f0ea1d27cd463f4d776b26cb9fee5813dd3579e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Replace the test262 python script with a C++ based executableLars Knoll2018-05-021-0/+753
This does significantly speed up test execution, and allows us to also catch any potential crashes in the tests. Longer term, we will also be able to get better and more detailed checking implemented, e.g. whether a certain error has been thrown at parse or runtime and validating the type of the error. The new test application is called qjstest. Change-Id: I37409cb7634e063a49322c43c4c8f9a9181038d9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>