1 This patch can be used to generate a report showing what C source
2 lines are executed when the testsuite is run. gcc is required. After
3 applying this patch do:
5 $ ./configure --enable-gcov
9 Now look at gcov-report.html and the annotated source files it links
12 See also gcov(1), gcc(1).
15 ===================================================================
16 --- Makefile.in (revision 8987)
17 +++ Makefile.in (working copy)
20 BASE_URL=svn+ssh://localhost`pwd`/subversion/tests/clients/cmdline
23 + @echo -n "Collecting source files ..." ; \
24 + FILES=`find subversion/ -path '*/tests/*' -prune -o \
25 + -name '*.c' -print`; \
27 + echo "Coverage report Subversion r`svnversion .`<br>" \
29 + > gcov-report.html; \
30 + echo `uname -o -r -m` "<br>" \
31 + >> gcov-report.html; \
32 + (for file in $$FILES; do \
33 + echo $$file 1>&2 ; \
34 + base=`echo $$file | sed -e 's/.c$$//' `; \
35 + if [ -f "$$base.da" ] ; then \
38 + obj=`dirname $$base`/.libs/`basename $$base`.o; \
40 + stats=`gcov --preserve-paths \
41 + --object-directory=$$obj \
42 + $$file | sed -e "s/Creating.*//" | \
43 + sed -s "s|$$PWD/||"` \
44 + mangled=`echo $$base | tr '/' '#'`; \
45 + fixed=`echo $$base | tr '/' '_'`; \
46 + mv *$$mangled.c.gcov $$fixed.c.gcov; \
48 + sed -e "s/in file/in file <a href=\"$$fixed.c.gcov\">/"; \
50 + done) | sort -g >> gcov-report.html
53 rm -rf subversion/tests/clients/cmdline/repositories \
54 subversion/tests/clients/cmdline/working_copies \
56 ===================================================================
57 --- configure.in (revision 8987)
58 +++ configure.in (working copy)
64 +AC_HELP_STRING([--enable-gcov],
65 + [Turn on coverage testing (GCC only).]),
67 + if test "$enableval" = "yes" ; then
68 + CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
73 AC_HELP_STRING([--with-editor=PATH],
74 [Specify a default editor for the subversion client.]),