TO-DO: Help us figure out how to compute code coverage and document the process here.
gcov/lcov can be used to produce a code coverage report indicating which lines of code were executed on a single run or by multiple runs of
clamscan. NOTE: for these metrics to be collected, ClamAV needs to have been configured with the
First, run the following to zero out all of the performance metrics:
lcov -z --directory . --output-file coverage.lcov.data
Next, run ClamAV through whatever test cases you have. Then, run lcov again to collect the coverage data as follows:
lcov -c --directory . --output-file coverage.lcov.data
Finally, run the genhtml tool that ships with lcov to produce the code coverage report:
genhtml coverage.lcov.data --output-directory report
The report directory will have an
index.html page which can be loaded into any web browser.
For more information, visit the lcov webpage