summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-02 08:53:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:07:56 -0500
commit62ffbdb9f1d9ded63f6d8623f14741145a2d6b47 (patch)
tree212cf420d0041961380082c3d93211edfe303a5d /source4/lib/ldb
parent500d5523d2a83234d6bfbf264d78293426488bfc (diff)
downloadsamba-62ffbdb9f1d9ded63f6d8623f14741145a2d6b47.tar.gz
samba-62ffbdb9f1d9ded63f6d8623f14741145a2d6b47.tar.bz2
samba-62ffbdb9f1d9ded63f6d8623f14741145a2d6b47.zip
r4476: added a little gcov howto for ldb
(This used to be commit 5dc1995118c7d25adf89b6cc6156b1e6fc281e9b)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/README.gcov33
1 files changed, 33 insertions, 0 deletions
diff --git a/source4/lib/ldb/README.gcov b/source4/lib/ldb/README.gcov
new file mode 100644
index 0000000000..02f090f69f
--- /dev/null
+++ b/source4/lib/ldb/README.gcov
@@ -0,0 +1,33 @@
+Here is how to use gcov to test code coverage in ldb.
+
+Step 1: enable gcov support
+
+ Edit Makefile.ldb and uncommend the two GCOV_ lines
+
+Step 2: build ldb
+
+ make -sf Makefile.ldb clean all
+
+Step 3: run the test suite
+ make -sf Makefile.ldb test-tdb
+
+Step 4: produce the gcov report
+ make -sf Makefile.ldb 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 -sf Makefile.ldb clean all test-tdb gcov
+
+Note that you should not expect 100% coverage, as some error paths
+(such as memory allocation failures) are verr 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.