-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
We often find that snippets in the documentation do not work. This is either because they were never tested and written wrongly or because they stopped working at a certain point.
It would be great to have a tool that allows us to easily validate/test QML snippets in CI. In a second step this tool has to be rolled out to our codebase to test as many snippets as possible.
There is an existing auto test that validates some QML snippets in \qt5\qtdeclarative\tests\auto\quickcontrols\snippets\tst_snippets.cpp. It would be great if this could be made more convenient/automated so we can test more snippets in CI.
It should also be noted that Rust does this already. From the Rust book: "Adding example code blocks in your documentation comments can help demonstrate how to use your library, and doing so has an additional bonus: running cargo test will run the code examples in your documentation as tests! Nothing is better than documentation with examples. But nothing is worse than examples that don’t work because the code has changed since the documentation was written." https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html
- relates to
-
QTBUG-137566 Make snippets in qtbase compilable and add to the build system
-
- Reported
-
- resulted from
-
QTBUG-138681 Follow up tasks for QQmlTreeModel
-
- Reported
-