source: trunk/server/source4/lib/ldb/README_gcov.txt

Last change on this file was 414, checked in by Herwig Bauernfeind, 16 years ago

Samba 3.5.0: Initial import

File size: 830 bytes
Line 
1Here is how to use gcov to test code coverage in ldb.
2
3Step 1: build ldb with gcov enabled
4
5 make clean all WITH_GCOV=1
6
7Step 3: run the test suite
8 make test-tdb
9
10Step 4: produce the gcov report
11 make gcov
12
13Step 5: read the summary reports
14 less *.report.gcov
15
16Step 6: examine the per-file reports
17 less ldb_tdb\#ldb_tdb.c.gcov
18
19You can also combine steps 2 to 4 like this:
20
21 make clean all test-tdb gcov WITH_GCOV=1
22
23Note that you should not expect 100% coverage, as some error paths
24(such as memory allocation failures) are very hard to trigger. There
25are ways of working around this, but they are quite tricky (they
26involve allocation wrappers that "fork and fail on malloc").
27
28The lines to look for in the per-file reports are the ones starting
29with "#####". Those are lines that are never executed.
Note: See TracBrowser for help on using the repository browser.