Skip to content
Snippets Groups Projects
Commit afefc7f5 authored by Steffen Vogel's avatar Steffen Vogel :santa_tone2:
Browse files

added coverage information

parent d8271f82
Branches
Tags
No related merge requests found
...@@ -89,7 +89,7 @@ integration: ...@@ -89,7 +89,7 @@ integration:
dependencies: dependencies:
- build - build
script: script:
- build/release/villas-node - "build/release/villas-node || true"
image: $DOCKER_REGISTRY/$DOCKER_IMAGE image: $DOCKER_REGISTRY/$DOCKER_IMAGE
tags: tags:
- docker - docker
......
...@@ -59,6 +59,13 @@ RUN dnf -y update && \ ...@@ -59,6 +59,13 @@ RUN dnf -y update && \
bison \ bison \
texinfo texinfo
# Tools for coverage and profiling
RUN dnf -y update && \
dnf -y install \
python-pip && \
pip install \
gcovr
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
ENV LD_LIBRARY_PATH /usr/local/lib ENV LD_LIBRARY_PATH /usr/local/lib
......
COVERAGE_TESTS = $(BUILDDIR)/testsuite
COVERAGE_OBJS = $(LIB_OBJS) $(SRC_OBJS)
GCDAS = $(COVERAGE_OBJS:.o=.gcda)
GCNOS = $(COVERAGE_OBJS:.o=.gcno)
GCOVR_OPTS = --exclude ^include --root . --sort-percentage --print-summary
coverage: $(BUILDDIR)/coverage/index.html $(BUILDDIR)/coverage.xml $(BUILDDIR)/coverage.txt
$(BUILDDIR)/coverage.txt: $(addsuffix .gcdas,$(COVERAGE_TESTS)) | $$(dir $$@)
gcovr $(GCOVR_OPTS) -o $@
$(BUILDDIR)/coverage.xml: $(addsuffix .gcdas,$(COVERAGE_TESTS)) | $$(dir $$@)
gcovr $(GCOVR_OPTS) --xml --xml-pretty -o $@
$(BUILDDIR)/coverage/index.html: $(addsuffix .gcdas,$(COVERAGE_TESTS)) | $$(dir $$@)
gcovr $(GCOVR_OPTS) --html --html-details -o $@
# This is an intermediate target. It is used to run the test only once for all gcovr rules.
%.gcdas: %
@echo "Delete previous coverage information"
rm -f $(GCDAS)
@echo "Run $< for collecting coverage information (.gcda)"
$^
clean-coverage:
rm -rf $(BUILDDIR)/coverage $(BUILDDIR)/coverage.txt $(BUILDDIR)/coverage.xml
rm -f $(GCDAS)
install-coverage:
.INTERMEDIATE: $(addsuffix .gcdas,$(COVERAGE_TESTS))
.PHONY: coverage gcda clean-coverage install-coverage
\ No newline at end of file
...@@ -16,7 +16,7 @@ $(BUILDDIR)/testsuite: $(TEST_OBJS) | $(LIBS) ...@@ -16,7 +16,7 @@ $(BUILDDIR)/testsuite: $(TEST_OBJS) | $(LIBS)
$(CC) $(TEST_LDFLAGS) $(TEST_LDLIBS) $^ -o $@ $(CC) $(TEST_LDFLAGS) $(TEST_LDLIBS) $^ -o $@
ifdef COVERAGE ifdef COVERAGE
-include Makefile.gcov.inc -include tests/Makefile.gcov.inc
endif endif
# Tests are not installed # Tests are not installed
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment