Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
Description
Overview
Qt's existing auto-tests cover a significant portion of the Qt API and implementation. For the purpose of supporting platform development they do however have limitations. Some of these apply to all platform development, and some are specific to Qt for WebAssembly.
- The existing tests are cross-platform and do not always test platform and implementation specific behavior.
- QTestLib is synchronous, while the Web platform is asynchronous.
Platform-specific testing can compliment the existing auto-test suite and help catch regressions in platform-specific Qt code.
Implementation
Currently, the following is implemented (as patches on gerrit):
- Add wasmtestlib: https://codereview.qt-project.org/c/qt/qtbase/+/390270/9
This implements a small asynchronous testing library with a C++ API similar to QTestLib, and a JavaScript API for running the tests. - Event dispatcher auto test: https://codereview.qt-project.org/c/qt/qtbase/+/405881/
Tests the event dispatcher implementation for single-threaded, multi-threaded, and asyncify-enabled builds. - QWindow auto test: (WIP): https://codereview.qt-project.org/c/qt/qtbase/+/410456/
Pending
- Support running as an auto-test (in CI system etc). Currently the tests are run as manual-tests, where the developer builds the test and then loads the output html file in a web browser. Depends on QTBUG-67449.
- Expand tests where it makes sense. We are looking to test code and features which would not be covered by existing auto-tests (either because the test code does not exist, or because it cannot be run on the web platform).