Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e4896d

Browse files
committed
Fix coverage targets so that HTML view is reliably updated when test data
changes. Add some documenting comments.
1 parent 8f1658c commit 0e4896d

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/Makefile.global.in

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*-makefile-*-
2-
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.243 2008/09/05 12:11:18 petere Exp $
2+
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.244 2008/10/03 15:35:17 petere Exp $
33

44
#------------------------------------------------------------------------------
55
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -592,18 +592,30 @@ endif # enable_nls
592592
#
593593
# Coverage
594594

595+
# Explanation of involved files:
596+
# foo.c source file
597+
# foo.o object file
598+
# foo.gcno gcov graph (a.k.a. "notes") file, created at compile time
599+
# (by gcc -ftest-coverage)
600+
# foo.gcda gcov data file, created when the program is run (for
601+
# programs compiled with gcc -fprofile-arcs)
602+
# foo.c.gcov gcov output file with coverage information, created by
603+
# gcov from foo.gcda (by "make coverage")
604+
# foo.c.gcov.out stdout captured when foo.c.gcov is created, mildly
605+
# interesting
606+
# lcov.info lcov tracefile, built from gcda files in one directory,
607+
# later collected by "make coverage-html"
608+
595609
ifeq ($(enable_coverage), yes)
596610

597611
# There is a strange interaction between lcov and existing .gcov
598612
# output files. Hence the rm command and the ordering dependency.
599613

600614
gcda_files := $(wildcard *.gcda)
601615

602-
lcov.info:
616+
lcov.info: $(gcda_files)
603617
rm -f *.gcov
604-
ifneq (,$(gcda_files))
605-
$(LCOV) -d . -c -o $@ $(LCOVFLAGS)
606-
endif
618+
$(if $^,$(LCOV) -d . -c -o $@ $(LCOVFLAGS))
607619

608620
%.c.gcov: %.gcda | lcov.info
609621
$(GCOV) -b -f -p -o . $(GCOVFLAGS) $*.c >$*.c.gcov.out

0 commit comments

Comments
 (0)