From 546d86c8ecdf3c710ae98b1d66a23e9857477189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Fri, 31 Jan 2014 16:19:43 +0100 Subject: [PATCH] Add an 'lcov' target for HTML coverage report --- .gitignore | 1 + CMakeLists.txt | 6 ++++++ Makefile | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/.gitignore b/.gitignore index 07374ec899..02b0a98c53 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ CMakeFiles CTestTestfile.cmake cmake_install.cmake Testing +Coverage diff --git a/CMakeLists.txt b/CMakeLists.txt index c3ae81d9ea..a4b012c007 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,6 +74,12 @@ ADD_CUSTOM_TARGET(test-ref-config COMMAND tests/scripts/test-ref-configs.pl ) +ADD_CUSTOM_TARGET(lcov + COMMAND geninfo *.gcda + COMMAND genhtml -o ../../../Coverage *.info + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/library/CMakeFiles/polarssl.dir + ) + ADD_CUSTOM_TARGET(memcheck COMMAND ctest -O memcheck.log -D ExperimentalMemCheck COMMAND tail -n1 memcheck.log | grep 'Memory checking results:' > /dev/null diff --git a/Makefile b/Makefile index 1a1082a30a..2ca3cf54eb 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ clean: cd library && $(MAKE) clean && cd .. cd programs && $(MAKE) clean && cd .. cd tests && $(MAKE) clean && cd .. + find . \( -name \*.gcno -o -name \*.gcda -o -name *.info \) -exec rm {} + check: lib ( cd tests && $(MAKE) && $(MAKE) check ) @@ -55,6 +56,11 @@ check: lib test-ref-configs: tests/scripts/test-ref-configs.pl +lcov: + rm -rf Coverage + ( cd library && geninfo *.gcda ) + ( cd library && genhtml -o ../Coverage *.info ) + apidoc: mkdir -p apidoc doxygen doxygen/polarssl.doxyfile