🔨 added Makefile target to calculate lcov coverage

This commit is contained in:
Niels Lohmann 2017-10-05 00:17:09 +02:00
parent 1b3df3a63f
commit 7b82e4b4c8
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69

View file

@ -5,6 +5,7 @@ all:
@echo "check - compile and execute test suite"
@echo "check-fast - compile and execute test suite (skip long-running tests)"
@echo "clean - remove built files"
@echo "coverage - create coverage information with lcov"
@echo "cppcheck - analyze code with cppcheck"
@echo "doctest - compile example files and check their output"
@echo "fuzz_testing - prepare fuzz testing of the JSON parser"
@ -35,11 +36,25 @@ check-fast:
clean:
rm -fr json_unit json_benchmarks fuzz fuzz-testing *.dSYM test/*.dSYM
rm -fr benchmarks/files/numbers/*.json
rm -fr build_coverage
$(MAKE) clean -Cdoc
$(MAKE) clean -Ctest
$(MAKE) clean -Cbenchmarks
##########################################################################
# coverage
##########################################################################
coverage:
mkdir build_coverage
cd build_coverage ; CXX=g++-5 cmake .. -GNinja -DJSON_Coverage=ON
cd build_coverage ; ninja
cd build_coverage ; ctest
cd build_coverage ; ninja lcov_html
open build_coverage/test/html/index.html
##########################################################################
# documentation tests
##########################################################################