Commit 4c186748 authored by Steffen Jaeckel's avatar Steffen Jaeckel Committed by Derek Konigsberg

Add coverage make target

Which runs the tests and creates code coverage using lcov

Excluded upstream and generated source files from coverage report

Closes #1
parent a91cf1eb
......@@ -30,6 +30,20 @@ IF(HAVE_MEMSET_S)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
SET(LINK_FLAGS "${LINK_FLAGS} -fprofile-arcs -ftest-coverage")
add_custom_command(OUTPUT run_coverage
COMMAND lcov -q --capture --directory src --output-file
COMMAND lcov -q --remove 'vpool.*' 'ut*.h' '*.pb-c.*' 'protobuf-c/*' 'curve25519/*' --output-file
COMMAND genhtml -q --output-directory coverage
COMMENT Collecting and creating coverage information
add_custom_target( coverage DEPENDS run_coverage )
......@@ -10,13 +10,15 @@ environments. See the [Java library](
### Build dependencies
* [CMake]( 2.8.4 or higher
* [Check](
* [OpenSSL]( 1.0 or higher
* [Check *1](
* [OpenSSL *1]( 1.0 or higher
* [LCOV *2](
Most of these dependencies are required just for the unit test suite and
development of the library itself. When integrating into actual applications,
you should not need anything beyond CMake. Alternatively, you may integrate
the code using a build system of your choice.
Items marked with *1 are required for tests, with *2 are additionaliy required for code coverage.
### Setting up a fresh source tree
......@@ -29,8 +31,17 @@ the code using a build system of your choice.
### Running the unit tests
$ cd /path/to/libaxolotl-c/build
$ ctest
### Creating the code coverage
$ cd /path/to/libaxolotl-c/build
$ make coverage
And find the generated code coverage in `/path/to/libaxolotl-c/build/coverage`
### Eclipse project setup
CMake provides a tutorial on Eclipse project setup here:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment