[bind10-dev] [Fwd: bind 9 code coverage]
Shane Kerr
shane at isc.org
Mon Dec 21 11:50:42 UTC 2009
All,
We had a discussion about measuring code coverage on last week's BIND 10
call. Michael did a related bit of work for BIND 9 coverage, and found
that we can use gcc to do this. Some excerpts from his investigation,
which we can use as a basis for BIND 10 perhaps:
-------- Forwarded Message --------
> Steps:
>
> Compile bind 9 without any -O flags, and with
> -fprofile-arcs -ftest-coverage
> added to CFLAGS. I did this by ./configure, then editing
> config.status's CFLAGS line, then ./config.status to update
> all the Makefiles.
>
> Download and unpack http://ltp.sourceforge.net/coverage/lcov.php
> I unpacked it two levels back from where I keep bind soure (../..)
>
> Build bind.
>
> run "make test"
>
> Run these commands:
>
> ../../lcov-1.7/bin/lcov --capture --directory . --output-file all.info
> ../../lcov-1.7/bin/lcov --remove all.info bin/tests/* --output notests.info
> rm -rf coverage
> ../../lcov-1.7/bin/genhtml -o coverage notests.info
>
> And now, coverage/index.html has all you need.
>
> It is a good idea to delete the data files between runs. There is also
> some sort of diff mode for lcov, but I've not experimented. Once I got
> html, I was thrilled.
>
> Known issues:
>
> If a test seg faults, it does not update its coverage information.
> This is why many things in bin/tests/ are failing to be marked as
> covered.
>
> lcov includes system stuff, and I don't yet really know how to exclude
> that from collection or html generation.
--
Shane
More information about the bind10-dev
mailing list