Both the matchbox-window-manager and libmatchbox packages have support for the GNU Code coverage tool Gcov. To enable, at build time configure the packages with the --enable-gcov option. The built binaries will then produce gcov statistics, which can further be processed by running gcov on source files.
Within the test package exists gcov-wrapper.sh. This script will run all or any of the tests and report the percentage of code per source file the test run covered.
Usage is;
./gcov-wrapper.sh <matchbox wm src path> <libmatchbox src path> [test]
'test' defaults to testrun.sh
Set GCOV_FLAGS to any required gcov switches
It is advised you make clean and then remake matchbox-window-manager and libmatchbox before each gcov-wrapper.sh run to avoid statistics accumulating.
More information on using Gcov is available at http://gcc.gnu.org/onlinedocs/gcc-3.0/gcc_8.html