I've previously talked about what could/should be in the doc. A main issue for me was testing. Please let me share my experience about it.
- I 'm only talking about the qml side for a pyside user. python testing is very simple and pytest-qt great
- QtTest is very good but the doc is not clear (example are two simple). It needs a complex example on how to write tst_files (but it's more qt.io than pyside problem).
- about the issue to run the tests. I tested qmltestrunner and running tests with C++. They are not equivalent. some tests are passing with c++ but not with qmltestrunner.
- So I've chosen to use C++: It's very simple. I have no knowledge in c++.it only needs 2 files:
qml_tests.pro
CONFIG += warn_on qmltestcase
TEMPLATE = app
SOURCES += \
main.cpp
RESOURCES += \
../../src/main/resources/qml.qrcand the c++ main.cpp :
#include <QtQuickTest/quicktest.h>
QUICK_TEST_MAIN(example)
- Then it needs qmake but as python user pip is your friends : pip install aqtinstall. It's a wrapper to install qt with python.
- install qt: `aqt install 5.14.0 linux desktop --outputdir Qt
- then configure test :
Qt/5.14.0/gcc_64/bin/qmake -o Makefile qml_tests.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug
make -C target/qml_tests- run the tests:
./target/qml_tests/qml_tests
And that's it !!! I put all these commands in a Makefile next to install, dev, run_pytest... and it works like a charm.