Qoverage: simple QML code coverage
-
Hi all,
I'd like to let you know about qoverage: a simple QML code coverage tool.
qoverage
tracks code coverage in QML files, including:- Component instantiations
- Property access
- Javascript functions
It was created when I wanted to see QML code coverage for a QML-based open source project and integrate it into GitHub's CI flow.
In my eyes, the strength of qoverage is in what it doesn't do: instead of implementing QML parsing from scratch, qoverage relies on Qt's own
qmldom
to find where to inject instrumentation code. This will hopefully ensure thatqoverage
can be kept up to date with relatively little effort.In terms of features, it is not at the level of a professional tool like Coco. Instead, the aim is to provide a basic, open-source tool. By keeping it simple, hopefully it can be widely used and easily maintained. Code contributions are welcome!
Feel free to give it a try.
- Github: qoverage
- Example of its output on shoopdaloop: CodeCov report -- EDIT: updated link. CI seems to be misconfigured on master - I am pointing it to an older commit now on which the QML report was correctly uploaded.
I don't consider it to be mature, but it is usable and available on PyPi. The most significant limitation is that for now, imported .js/.mjs files are not included in coverage.
Kind regards!