File: README_gcov.txt

package info (click to toggle)
samba 2%3A4.1.17%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 102,820 kB
  • sloc: ansic: 1,165,393; xml: 114,314; python: 103,454; perl: 28,180; sh: 12,167; asm: 3,281; cpp: 2,281; yacc: 1,949; ada: 1,681; exp: 1,582; makefile: 1,287; pascal: 1,082; cs: 879; lex: 566; awk: 140; csh: 58; sed: 45
file content (29 lines) | stat: -rw-r--r-- 830 bytes parent folder | download | duplicates (32)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Here is how to use gcov to test code coverage in ldb.

Step 1: build ldb with gcov enabled

     make clean all WITH_GCOV=1

Step 3: run the test suite
     make test-tdb

Step 4: produce the gcov report
     make gcov

Step 5: read the summary reports
     less *.report.gcov

Step 6: examine the per-file reports
     less ldb_tdb\#ldb_tdb.c.gcov

You can also combine steps 2 to 4 like this:

     make clean all test-tdb gcov WITH_GCOV=1

Note that you should not expect 100% coverage, as some error paths
(such as memory allocation failures) are very hard to trigger. There
are ways of working around this, but they are quite tricky (they
involve allocation wrappers that "fork and fail on malloc").

The lines to look for in the per-file reports are the ones starting
with "#####". Those are lines that are never executed.