r9591: - Remove empty file
[sfrench/samba-autobuild/.git] / source / lib / ldb / README_gcov.txt
1 Here is how to use gcov to test code coverage in ldb.
2
3 Step 1: enable gcov support
4
5      Edit Makefile.ldb and uncommend the two GCOV_ lines
6      
7 Step 2: build ldb
8
9      make -sf Makefile.ldb clean all
10
11 Step 3: run the test suite
12      make -sf Makefile.ldb test-tdb
13
14 Step 4: produce the gcov report
15      make -sf Makefile.ldb gcov
16
17 Step 5: read the summary reports
18      less *.report.gcov
19
20 Step 6: examine the per-file reports
21      less ldb_tdb\#ldb_tdb.c.gcov
22
23 You can also combine steps 2 to 4 like this:
24
25      make -sf Makefile.ldb clean all test-tdb gcov
26
27 Note that you should not expect 100% coverage, as some error paths
28 (such as memory allocation failures) are very hard to trigger. There
29 are ways of working around this, but they are quite tricky (they
30 involve allocation wrappers that "fork and fail on malloc").
31
32 The lines to look for in the per-file reports are the ones starting
33 with "#####". Those are lines that are never executed.