[clamav-users] Regarding ClamAV code coverage metrics with help of existing unit-test cases

Andrew C Aitchison clamav at aitchison.me.uk
Thu Nov 26 09:21:18 UTC 2020


On Thu, 26 Nov 2020, Satish Kumar via clamav-users wrote:

> Dear All,
> I would like to build the ClamAV software from source code on an ubuntu machine
> and  measure the  code coverage of the ClamAV project with the help  of
> existing unit test cases in the ClamAV project
>  for that, the  below  steps that I  followed
> 1.compiled the ClamAV source code locally  and installed successfully on the
> local ubuntu machine
>  a)autogen.sh  b)./configure --enable-check  --enable-coveragec)sudo make
> install
> 2)After installation, I  switched from the ClamAV source folder to  "unit_tests"
> and  executed the make command but failed with the below error makemake: Nothing
> to be done for 'all'.
> I want to run all  unit-test cases covered (at one go)  under the unit_test
> folder  and measure the ClamAV  code coverage  metrics( in terms of 
> line/statement coverage, function coverage, branch coverage) by  exiting the
> unit-test case suite(s) of ClamAV
> I have gone through  ClamAV documentation a little bit but could not find a clue
> for it. Could any one of you please help me on  this and any help /suggestions
> would be appreciated 

# tail -17 Makefile
.PRECIOUS: Makefile

lcov:
         ($(MAKE); cd unit_tests; $(MAKE) lcov)
quick-check:
         ($(MAKE); cd unit_tests; $(MAKE) quick-check)
fuzz-all:
         ($(MAKE); cd fuzz; $(MAKE) all)
fuzz-check:
         ($(MAKE); cd fuzz; $(MAKE) check)

dist-hook:
         rm -rf $(distdir)/win32/clamav-for-windows $(distdir)/win32/build

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

... so I would guess
         make lcov
or
         make lcov quick-check

-- 
Andrew C. Aitchison                                     Kendal, UK
                         andrew at aitchison.me.uk


More information about the clamav-users mailing list