Skip to content
Snippets Groups Projects
Commit c416440c authored by Marek Vavruša's avatar Marek Vavruša
Browse files

tests: code coverage with coveralls

parent aec9b565
Branches
Tags
1 merge request!9Code coverage support
......@@ -7,14 +7,19 @@ env:
- LDFLAGS="-L${HOME}/fakeroot/lib"
- PIP_DOWNLOAD_CACHE="${HOME}/.pip-cache"
- CFLAGS="${CFLAGS} -DNDEBUG"
- PATH="${PATH}:${HOME}/.local/bin"
before_script:
- ./scripts/bootstrap-depends.sh ${HOME}/fakeroot
- pip install --user travis -r tests/pydnstest/requirements.txt
- pip install --user travis cpp-coveralls
script:
- autoreconf -i
- ./configure --enable-integration-tests
- ./configure --enable-integration-tests --enable-code-coverage
- make
- make check
after_script:
- cd lib
- coveralls -E include --gcov-options '\-lp'
sudo: false
cache:
directories:
......
# Knot DNS Resolver
[![Build Status](https://travis-ci.org/CZNIC-Labs/knot-resolver.svg?branch=master)](https://travis-ci.org/CZNIC-Labs/knot-resolver)
[![Coverage Status](https://coveralls.io/repos/CZNIC-Labs/knot-resolver/badge.svg?branch=master)](https://coveralls.io/r/CZNIC-Labs/knot-resolver?branch=master)
The Knot DNS Resolver is a minimalistic caching resolver implementation. The project provides both a resolver
library and a small daemon. Modular architecture of the library keeps the core tiny and efficient, and provides
......
......@@ -46,6 +46,15 @@ AM_CONDITIONAL([BUILD_TESTS], [test "$build_tests" == "yes"])
AM_CONDITIONAL([BUILD_INTEGRATION], [test "$build_integration" == "yes"])
AM_CONDITIONAL([BUILD_DAEMON], [test "$build_daemon" == "yes"])
# Check for code coverage
AC_ARG_ENABLE([code-coverage],
AS_HELP_STRING([--enable-code-coverage], [enable code coverage, default: no]),
[code_coverage=yes], [code_coverage=no])
if test "x${code_coverage}" == "xyes"; then
CFLAGS="${CFLAGS} --coverage -O0 -g"
fi
# Search other libraries
AC_SEARCH_LIBS([mdb_env_open], [lmdb])
......
......@@ -20,6 +20,7 @@ check_PROGRAMS = \
check-compile-only: $(check_PROGRAMS)
check-local-exec: $(check_PROGRAMS)
@echo "---- Executing unit tests ----"
@cd $(top_builddir)
$(top_builddir)/tests/runtests -b $(top_builddir)/tests $(check_PROGRAMS)
else
......@@ -44,7 +45,8 @@ convenience-link: $(check_LTLIBRARIES)
check-local-integration: convenience-link
@echo "---- Executing integration tests ----"
@$(abs_builddir)/test_integration.py testdata
@cd $(top_builddir)
@$(top_builddir)/tests/test_integration.py testdata
clean-local:
@for soname in `echo | $(EGREP) "^dlname=" $(check_LTLIBRARIES) | $(SED) -e "s|^dlname='\(.*\)'|\1|"`; do \
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment