Test runner was not properly handling tests which
return the control back to browser event loop.
It was treating such tests as if they exited with
code 0, marking them as succesfull even if they were
eventually failing or hanging.
This commit adds a callback to TestCase so the runner
is notified when a test truly has finished.
As a side effect, two tests need to be disabled for now
as they are failing for wasm, which was not properly
detected previously.
Change-Id: I0eb9383e5bb9cd660431c18747b9e94413629d1e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Obtaining entry function name with exports = {} is about to get removed
(in emscripten 3.1.44). Use the only alternative, which is to specify
the module = {} object that gets the 'exports' variable. Oddly enough,
it gets assigned the only export name, even though the name is plural.
Change-Id: Idcda29bfcaed2d0a923a8d39af078359abc73f7d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Add scripts which generates Qt plugins and QML imports
preload lists, for use with the "preload" functionality
form qtloader.js.
The preload lists downlad plugins and imports from $QTDIR/
to /qt/ at application load time, where $QTDIR is configurable
using the qt.qtdir qtloader configuration property (set
to "qt" by default).
Sample directory structure:
app.html
app.js
qtloader.js
qt_plugins.json [generated]
qt_qml_imports.json [generated]
qt -> /path/to/qt [symlink]
The json files are generated by the scripts in this commit.
app.html configures qtloader.js to use the json files
as preload lists, which instructs it to preload from
"qt", which again is a symlink to or a copy of the Qt
installation.
Pick-to: 6.6
Task-number: QTBUG-63925
Change-Id: I53bd197f22057dbb70e9a9bee43b9d9b969aa072
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The export name is now ${TARGET_NAME}Entry. This can also be overridden
by using QT_WASM_EXPORT_NAME, both in CMake and qmake
Change-Id: I59c97ae6e22f0b2720716e9d7eff7b6b13d37ab5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Just proxy any non-standard arg to the WASM module and let it use
the arg as a filter
Change-Id: Ia77a30ca872497425017edb8fa8961b6d687ca68
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Sending each line in separate POST requests seems to clog emrun.
Join the output in 300ms intervals so that the number of requests is
limited to 3,(3) per second.
Fixes: QTBUG-109827
Change-Id: I099e8cc14d9d162c54b7040b62297d1070b234c3
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
The assignment crashes with 3.1.25 as instance.ENV is now a read-only
property. This used to be assigned to an empty object, so it was
useless anyway.
Change-Id: I47d4cd831052de514c372adb3f2202d8a0a6e06f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
There will now be a visual output in page if the qvisualoutput query
parameter is supplied. This simplifies debugging.
The main html resource has been renamed test_batch.html to reflect
the name of the actual test unit, not functionality.
Change-Id: Ib6cd4712de9c47cfcc5f670e7b34f998858f99b7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The second parameter to the onDone callback in istantiateWasm was
missing in qwasmjsrunner.js, which prevented the wasm module from
working on the threaded qt build.
Change-Id: I5d1be7a2e0d8043112f304b4d2530acdaae7b398
Reviewed-by: David Skoland <david.skoland@qt.io>
This makes the js batched test runner cooperate with emrun.
The runner sends back the output and exit messages to emrun to inform it
about the test execution state.
The code is based on emrun_postjs.js from the emsdk.
Change-Id: I758f2c185797f4000810eb4314423eebc1c5d457
Reviewed-by: David Skoland <david.skoland@qt.io>
The script is now able to:
- kill a test that is not responding after certain timeout
- multicast output to files/streams (tee-like, but not only on posix)
- forward requested format (xml/txt/etc.) to the test executable
- run a batched test from a batch test package
- interop with the js batched test runner
Change-Id: Ia189d78a078e11b9efd25865c5a0ddc6a62d9b85
Reviewed-by: David Skoland <david.skoland@qt.io>
A driver application has been prepared in js for running batched tests.
There is a convenient public API defined for reading the current test
status & subscribing to changes thereof.
The solution is modular - the module qwasmjsruntime can be used for any
wasm instantiation, e.g. in the next iteration of qtloader.
Change-Id: I00df88188c46a42f86d431285ca96d60d89b3f05
Pick-to: 6.4
Reviewed-by: David Skoland <david.skoland@qt.io>
When testing, we need to query the state of the Qt application,
so change the scope of qtloader from inside the init function
to global scope.
Additionally, adjust the test script accordingly to query and use this
state to make good decisions on how to terminate.
Change-Id: I6264ba20843716eb87340b160680617b718f6bd9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
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.
Task-number: QTBUG-67283
Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Add a python script that allows us to run wasm tests in CI, along with
the necessary cmake logic to install the script and execute tests
accordingly.
Change-Id: I93b95c115538c4e27b2b833405acab8162be2a8a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Development web server for web applications. Supports
http and https. Sets COOP and COEP headers.
The web server script supports certificate generation using
mkcert (github.com/FiloSottile/mkcert). Briefly, mkcert
supports generating server certificates for the current
local ip address(es), using a certificate authority
which can be installed on devices where the app should
run.
The COOP and COEP headers are required to enable the
SharedArrayBuffer API, which is required for Emscripten’s
pthreads implementation.
The server serves the current directory on localhost
by default. Use the “-a” argument to bind to an additional
address, or "--all” to bind to all IPv4 addresses found on
local network interfaces. Change the directory by passing
it as a positional argument.
Task-number: QTBUG-79087
Change-Id: Id0cba649e42af53ed8106e336a77e78398bcf901
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>