Skip to content

Instantly share code, notes, and snippets.

@EricWF
Created April 30, 2015 19:42
Show Gist options
  • Select an option

  • Save EricWF/eaf2dc4ce888cb659275 to your computer and use it in GitHub Desktop.

Select an option

Save EricWF/eaf2dc4ce888cb659275 to your computer and use it in GitHub Desktop.
Coverage change for Benchmark
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 5fb0b29..38277ab 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -54,11 +54,13 @@ if (${CMAKE_BUILD_TYPE} MATCHES "[Cc]overage")
if (GCOV AND LCOV AND GENHTML AND MAKE AND "${CMAKE_GENERATOR}" STREQUAL "Unix Makefiles")
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/lcov/index.html
- COMMAND ${LCOV} -q -z -d .
- COMMAND ${LCOV} --no-external -q -c -b "${CMAKE_BINARY_DIR}" -d . -o initial.lcov -i
+ COMMAND ${LCOV} --zerocounters -d .
+ COMMAND ${LCOV} --capture --initial --no-external -b ${CMAKE_SOURCE_DIR} -d . -o initial.lcov
COMMAND ${MAKE} test
- COMMAND ${LCOV} --no-external -q -c -b "${CMAKE_BINARY_DIR}" -d . -o info.lcov
- COMMAND ${GENHTML} info.lcov --o lcov --demangle-cpp --sort -p "${CMAKE_BINARY_DIR}" -t benchmark
+ COMMAND ${LCOV} --capture --no-external -b ${CMAKE_SOURCE_DIR} -d . -o after_tests.lcov
+ COMMAND ${LCOV} -a initial.lcov -a after_tests.lcov -o final.lcov
+ COMMAND ${LCOV} --remove final.lcov "'${CMAKE_SOURCE_DIR}/test/*'" -o final.lcov
+ COMMAND ${GENHTML} final.lcov -o lcov --demangle-cpp --sort -p "${CMAKE_BINARY_DIR}" -t benchmark
DEPENDS filter_test benchmark_test options_test basic_test fixture_test cxx03_test
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Running LCOV"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment