summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2017-03-01 17:24:12 -0500
committerPaul Moore <paul@paul-moore.com>2017-03-01 17:24:12 -0500
commit30be87efde4e0853e351e304c46c14c019a3d238 (patch)
treeac056cd7399e852c25864c01e09ea98f898b949c
parentfda1f0741fb55d6951f312f310cc159e17555788 (diff)
downloadlibseccomp-30be87efde4e0853e351e304c46c14c019a3d238.tar.gz
build: create an easy to use test coverage make target
Signed-off-by: Paul Moore <paul@paul-moore.com>
-rw-r--r--.travis.yml7
-rw-r--r--Makefile.am11
2 files changed, 13 insertions, 5 deletions
diff --git a/.travis.yml b/.travis.yml
index e1bd540..6b84bd6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -61,11 +61,8 @@ script:
- LIBSECCOMP_TSTCFG_TYPE=live make -C tests check
# ubuntu 14.04 (trusty) clang has problems with the cython generated code
- make clean && ./configure && scan-build --status-bugs make
- # limit the code coverage tests to the native/c code
- - make clean && ./configure --enable-code-coverage &&
- make -C src check-code-coverage &&
- LIBSECCOMP_TSTCFG_TYPE=basic make check-code-coverage &&
- LIBSECCOMP_TSTCFG_TYPE=bpf-sim make check-code-coverage
+ # limit the code coverage tests to the 'test-code-coverage' target
+ - make clean && ./configure --enable-code-coverage && make test-code-coverage
after_success:
# https://github.com/eddyxu/cpp-coveralls/blob/master/README.md
diff --git a/Makefile.am b/Makefile.am
index 29ee2ec..48078e0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -37,8 +37,19 @@ check-build: all
check-syntax:
@./tools/check-syntax
+if CODE_COVERAGE_ENABLED
check-code-coverage: check-build
${MAKE} ${AM_MAKEFLAGS} -C tests check-code-coverage
+endif
+
+if CODE_COVERAGE_ENABLED
+test-code-coverage: check-build
+ ${MAKE} ${AM_MAKEFLAGS} -C src check-code-coverage
+ LIBSECCOMP_TSTCFG_TYPE=basic \
+ ${MAKE} ${AM_MAKEFLAGS} check-code-coverage
+ LIBSECCOMP_TSTCFG_TYPE=bpf-sim \
+ ${MAKE} ${AM_MAKEFLAGS} check-code-coverage
+endif
if COVERITY
coverity-build: clean