We are working on getting more of the MariaDB source covered by our mysql-test-run (MTR) test suite. This is an ongoing (and slow) task as there is still a lot of old code with not very good coverage.
For new code in MariaDB, we aim much higher:
The goals are:
The reason we are using 'purecov' to mark lines is an attribution to the purecov tool we originally used for code coverage in the early years of MySQL.
The recommended markers are:
/* purecov: tested */
/* purecov: inspected */
/* purecov: deadcode */
The comment must be placed on the line/lines that are affected.
For code blocks larger than 1 line one can use the block syntax:
/* purecov: begin tested */ .... /* purecov: end */
To be able to see the level of coverage within the current test suite, do the following:
./mysql-test-run -gcov
source_file_name.gcov in the source tree. In MariaDB 10.1 or below it's in the CMakeFiles directory where the object files are stored. In MariaDB 10.2 it's stored together with the source files. buildbot, the MariaDB build system, is doing automatic coverage testing for each push.
© 2023 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/code-coverage/