~zulcss/samba/server-dailies-3.4

« back to all changes in this revision

Viewing changes to source3/lib/ldb/README_gcov.txt

  • Committer: Chuck Short
  • Date: 2010-09-28 20:38:39 UTC
  • Revision ID: zulcss@ubuntu.com-20100928203839-pgjulytsi9ue63x1
Initial version

Show diffs side-by-side

added added

removed removed

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