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

fix coverage and some other test related issues

This commit is contained in:
Steffen Vogel 2017-03-29 08:13:44 +02:00
parent 2293e3ad4a
commit 725a4e544e
8 changed files with 52 additions and 29 deletions

View file

@ -1,26 +1,23 @@
variables:
# This registry is a linked docker container running on the same host
# and configured in gitlab-ci-runner config.toml as a linked service
DOCKER_REGISTRY: acs-public:5000
PREFIX: /usr/
BUILDDIR: build/release
stages:
- prepare
- build
- test
- packaging
- deploy
# Stage: prepare
##############################################################################
# Build docker image which is used to build & test VILLASnode
docker-images:
docker-dev:
stage: prepare
before_script:
- git submodule sync --recursive
- git submodule update --recursive --init
- docker info
- git submodule sync --recursive
- git submodule update --init --recursive
script:
- docker pull fedora:latest
- make docker-dev
@ -42,7 +39,7 @@ build:
artifacts:
name: "${CI_PROJECT_NAME}-${CI_BUILD_REF}"
paths:
- build/release/
- $BUILDDIR/
image: $DOCKER_REGISTRY/villas-dev
tags:
- docker
@ -52,13 +49,29 @@ docs:
artifacts:
name: "${CI_PROJECT_NAME}-doc-${CI_BUILD_REF}"
paths:
- build/release/doc/
- $BUILDDIR/doc/
script:
- make doc
image: $DOCKER_REGISTRY/villas-dev
tags:
- docker
packages:
stage: build
before_script:
- curl -s https://$DEPLOY_USER:$DEPLOY_PASS@$DEPLOY_HOST/packages/villas.repo > /etc/yum.repos.d/villas.repo
- dnf -y --refresh install libwebsockets-devel libxil-devel
script:
- make dist
- make rpm-villas
artifacts:
name: "${CI_PROJECT_NAME}-packages-${CI_BUILD_REF}"
paths:
- $BUILDDIR/packaging/
image: $DOCKER_REGISTRY/villas-dev
tags:
- docker
# Stage: test
##############################################################################
@ -93,6 +106,10 @@ integration:
- build
script:
- make run-integration-tests
artifacts:
name: "${CI_PROJECT_NAME}-integration-tests-${CI_BUILD_REF}"
paths:
- BUILDDIR/tests/integration/
image: $DOCKER_REGISTRY/villas-dev
tags:
- docker
@ -110,25 +127,28 @@ website:
tags:
- villas-deploy
rpm:
stage: packaging
docker:
stage: deploy
script:
- make rpm
- make docker
- docker tag -f villas $DOCKER_REGISTRY/villas:latest
- docker push $DOCKER_REGISTRY/villas:latest
dependencies:
- packages
tags:
- shell
- fedora
- linux
deliver:
stage: deploy
script:
- rsync -r build/release/doc/html/ $DEPLOY_HOST:$DEPLOY_PATH/doc/$CI_BUILD_REF_NAME/
- rsync -r build/release-coverage/coverage/ $DEPLOY_HOST:$DEPLOY_PATH/coverage/$CI_BUILD_REF_NAME/
- rsync -r build/release/packaging/rpm/RPMS $DEPLOY_HOST:$DEPLOY_PATH/../packages
- rsync -r $BUILDDIR/doc/html/ $DEPLOY_HOST:$DEPLOY_PATH/doc/$CI_BUILD_REF_NAME/
- rsync -r $BUILDDIR/packaging/rpm/RPMS $DEPLOY_HOST:$DEPLOY_PATH/../packages
- ssh $DEPLOY_HOST createrepo $DEPLOY_PATH/../packages
dependencies:
- docs
- coverage
- rpm
- packages
tags:
- villas-deploy

View file

@ -74,7 +74,7 @@ VERSION_NUM = $(shell VERSION=$(VERSION); echo $${VERSION:1})
ifdef CI
GIT_REV = ${CI_BUILD_REF:0:7}
VARIANT := ci-$(VARIANT)
VARIANT := ci~$(VARIANT)
else
GIT_REV = $(shell REV=$$(git rev-parse HEAD); echo $${REV:0:7})
endif

View file

@ -1,7 +1,7 @@
LIB_NAME = libvillas
LIB_ABI_VERSION = 1
LIB = $(BUILDDIR)/$(LIB_NAME).so
LIB = $(BUILDDIR)/$(LIB_NAME).so.$(LIB_ABI_VERSION)
# Object files for libvillas
LIB_SRCS = $(addprefix lib/nodes/, file.c cbuilder.c) \
@ -86,6 +86,7 @@ lib: $(LIB)
# Link
$(LIB): $(LIB_OBJS)
$(CC) $(LIB_LDFLAGS) -o $@ $^ $(LIB_LDLIBS)
ln -srf $@ $(BUILDDIR)/$(LIB_NAME).so
# Compile
$(BUILDDIR)/lib/%.o: lib/%.c $(BUILDDIR)/defines | $$(dir $$@)

View file

@ -1,10 +1,8 @@
-include tests/unit/Makefile.inc
-include tests/integration/Makefile.inc
tests: unit-tests
tests: unit-tests integration-tests
run-tests: run-unit-tests run-integration-tests
run-integration-tests: src tools
@$(SRCDIR)/tests/integration-tests.sh
.PHONY: tests run-tests run-integration-tests
.PHONY: tests run-tests

View file

@ -0,0 +1,4 @@
integration-tests: src tools
run-integration-tests: integration-tests
@$(SRCDIR)/tests/integration-tests.sh

View file

@ -4,7 +4,7 @@ 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
GCOVR_OPTS = --exclude ^include --root $(SRCDIR) --sort-percentage --print-summary
coverage: $(BUILDDIR)/coverage/index.html $(BUILDDIR)/coverage.xml $(BUILDDIR)/coverage.txt

View file

@ -11,15 +11,15 @@ run-unit-tests: tests
$(BUILDDIR)/unit-tests
# Compile
$(BUILDDIR)/tests/unit/%.o: tests/unit/%.c | $$(dir $$@)
$(BUILDDIR)/tests/unit/%.o: tests/unit/%.c $(BUILDDIR)/defines | $$(dir $$@)
$(CC) $(TEST_CFLAGS) -c $< -o $@
# Link
$(BUILDDIR)/unit-tests: $(TEST_OBJS) | $(LIBS)
$(BUILDDIR)/unit-tests: $(TEST_OBJS) $(LIB)
$(CC) $(TEST_LDFLAGS) $(TEST_LDLIBS) $^ -o $@
ifdef COVERAGE
-include tests/Makefile.gcov.inc
-include tests/unit/Makefile.gcov.inc
endif
# Tests are not installed

@ -1 +1 @@
Subproject commit a38b7b1664cf5bebff287ec40e4024d85a4475e8
Subproject commit 42b2334c5c4b1b3da5dd75bd92451bb49983c236