Repository: incubator-hawq Updated Branches: refs/heads/master 57b33b49c -> 5ea92a599
HAWQ-716. Support code coverage build and report in hawq Makefile Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/5ea92a59 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/5ea92a59 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/5ea92a59 Branch: refs/heads/master Commit: 5ea92a599c7ad3ab8af5a92bf08be864eb2716f3 Parents: 57b33b4 Author: Ruilong Huo <[email protected]> Authored: Wed May 4 16:11:38 2016 +0800 Committer: Ruilong Huo <[email protected]> Committed: Tue May 10 09:23:33 2016 +0800 ---------------------------------------------------------------------- GNUmakefile.in | 9 +++++++++ configure | 2 +- src/bin/gpfdist/Makefile | 5 +++-- 3 files changed, 13 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5ea92a59/GNUmakefile.in ---------------------------------------------------------------------- diff --git a/GNUmakefile.in b/GNUmakefile.in index f20ee2c..66f97bd 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -157,5 +157,14 @@ distcheck: $(distdir).tar.gz -rm -rf $(distdir) $(dummy) @echo "Distribution integrity checks out." +coverage-show: + lcov --directory . --capture --output-file CodeCoverage.info + lcov --remove CodeCoverage.info 'test/*' 'mock/*' '/usr/*' '/opt/*' '*ext/rhel5_x86_64*' '*ext/osx*' --output-file CodeCoverage.info.cleaned + genhtml -o CodeCoverageReport CodeCoverage.info.cleaned + +coverage-reset: + lcov --directory . --zerocounters + + .PHONY: dist distdir distcheck unexport split-dist http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5ea92a59/configure ---------------------------------------------------------------------- diff --git a/configure b/configure index 76842d4..34f2788 100755 --- a/configure +++ b/configure @@ -1509,7 +1509,7 @@ disable 64-bit integer date/time support --disable-spinlocks do not use spinlocks --enable-debug build with debugging symbols (-g) --enable-profiling build with profiling enabled -build with coverage testing instrumentation + --enable-coverage build with coverage testing instrumentation --enable-dtrace build with DTrace support --enable-depend turn on automatic dependency tracking --enable-cassert enable assertion checks (for debugging) http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5ea92a59/src/bin/gpfdist/Makefile ---------------------------------------------------------------------- diff --git a/src/bin/gpfdist/Makefile b/src/bin/gpfdist/Makefile index 5817375..13d06dc 100644 --- a/src/bin/gpfdist/Makefile +++ b/src/bin/gpfdist/Makefile @@ -22,7 +22,8 @@ include $(top_builddir)/src/Makefile.global LIBS := -levent -lyaml -lz -lbz2 -lssl -lcrypto ifeq ($(BUILD_TYPE), gcov) -LIBS := -lgcov $(LIBS) +LIBS := -lgcov $(LIBS) +CFLAGS := -fprofile-arcs -ftest-coverage $(CFLAGS) endif code_dir = $(CURDIR)/src/gpfdist/ @@ -61,7 +62,7 @@ mkgpfdist: mkdir ( $(CC) $(INCLUDES) $(CFLAGS) $(LIBS) -c $(code_dir)$${file}); \ done # link - $(CC) -o $(code_dir)gpfdist $(OBJS) $(LIBS) + $(CC) $(CFLAGS) -o $(code_dir)gpfdist $(OBJS) $(LIBS) mkdir -p build/bin mv -f src/gpfdist/gpfdist build/bin/
