gcov is a tool you can use in conjunction with GCC to test code coverage in your programs.
gcov
© Free Software FoundationLicensed under the GNU Free Documentation License, Version 1.3. https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/Gcov.html