1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

added coverage information

This commit is contained in:
Steffen Vogel 2016-10-15 22:06:00 -04:00
parent d8271f82f8
commit afefc7f5fa
4 changed files with 43 additions and 2 deletions

View file

@ -89,7 +89,7 @@ integration:
dependencies:
- build
script:
- build/release/villas-node
- "build/release/villas-node || true"
image: $DOCKER_REGISTRY/$DOCKER_IMAGE
tags:
- docker

View file

@ -59,6 +59,13 @@ RUN dnf -y update && \
bison \
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 LD_LIBRARY_PATH /usr/local/lib

34
tests/Makefile.gcov.inc Normal file
View file

@ -0,0 +1,34 @@
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

View file

@ -16,7 +16,7 @@ $(BUILDDIR)/testsuite: $(TEST_OBJS) | $(LIBS)
$(CC) $(TEST_LDFLAGS) $(TEST_LDLIBS) $^ -o $@
ifdef COVERAGE
-include Makefile.gcov.inc
-include tests/Makefile.gcov.inc
endif
# Tests are not installed