From 6e2bf7b795a0f1a9731f23ec4fa69a3e4e716cdb Mon Sep 17 00:00:00 2001 From: lloyd Date: Sun, 12 Apr 2015 03:49:44 +0000 Subject: Add coverage checking with gcov/lcov --- src/build-data/cc/clang.txt | 1 + src/build-data/cc/gcc.txt | 1 + src/build-data/makefile/coverage.in | 4 ++++ src/build-data/makefile/gmake.in | 5 +++-- 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 src/build-data/makefile/coverage.in (limited to 'src') diff --git a/src/build-data/cc/clang.txt b/src/build-data/cc/clang.txt index 9216c12c9..195318291 100644 --- a/src/build-data/cc/clang.txt +++ b/src/build-data/cc/clang.txt @@ -20,6 +20,7 @@ app_opt_flags "-O2" shared_flags "-fPIC" debug_flags "-g" no_debug_flags "" +coverage_flags "--coverage" visibility_build_flags "-fvisibility=hidden" visibility_attribute '__attribute__((visibility("default")))' diff --git a/src/build-data/cc/gcc.txt b/src/build-data/cc/gcc.txt index 324f51071..1e1eb2fb9 100644 --- a/src/build-data/cc/gcc.txt +++ b/src/build-data/cc/gcc.txt @@ -16,6 +16,7 @@ lib_opt_flags "-O2" app_opt_flags "-O2" shared_flags "-fPIC" debug_flags "-g" +coverage_flags "--coverage" visibility_build_flags "-fvisibility=hidden" visibility_attribute '__attribute__((visibility("default")))' diff --git a/src/build-data/makefile/coverage.in b/src/build-data/makefile/coverage.in new file mode 100644 index 000000000..9547c4151 --- /dev/null +++ b/src/build-data/makefile/coverage.in @@ -0,0 +1,4 @@ + +lcov: + lcov --directory build/obj/lib/ --directory src/lib --no-external --capture --output-file botan.info + genhtml botan.info -o coverage/ diff --git a/src/build-data/makefile/gmake.in b/src/build-data/makefile/gmake.in index c45cd2940..e8c480a21 100644 --- a/src/build-data/makefile/gmake.in +++ b/src/build-data/makefile/gmake.in @@ -37,8 +37,7 @@ $(STATIC_LIB): $(LIBOBJS) $(AR) $(STATIC_LIB) $(LIBOBJS) $(RANLIB) $(STATIC_LIB) -# Fake Targets -.PHONY = clean distclean docs website install valgrind +%{coverage_in} SPHINX_CONFIG = %{sphinx_config_dir} SPHINX_OPTS = -b html @@ -46,6 +45,8 @@ SPHINX_OPTS = -b html WEBSITE_DIR=%{doc_output_dir}/website WEBSITE_SRC_DIR=%{doc_output_dir}/website-src +.PHONY = clean distclean docs website install valgrind + clean: $(RM) %{libobj_dir}/* %{testobj_dir}/* %{appobj_dir}/* $(RM) $(LIBRARIES) $(SYMLINK) $(SONAME) $(APP) $(TEST) -- cgit v1.2.3