🔨 added Makefile target to calculate lcov coverage

pull/783/head
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
1 changed files with 15 additions and 0 deletions

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
##########################################################################