Made coverage html output optional.

This commit is contained in:
James Goppert
2016-05-09 12:13:00 -04:00
parent 061609322a
commit dd8ff8db12
2 changed files with 26 additions and 8 deletions
+20 -3
View File
@@ -27,13 +27,30 @@ foreach(test_name ${tests})
endforeach()
if (${CMAKE_BUILD_TYPE} STREQUAL "Profile")
add_custom_target(coverage
add_custom_target(coverage_build
COMMAND ${CMAKE_CTEST_COMMAND}
COMMAND lcov --capture --directory . --output-file coverage.info
COMMAND lcov --summary coverage.info
COMMAND genhtml coverage.info --output-directory out
COMMAND x-www-browser out/index.html
WORKING_DIRECTORY ${CMAKE_BUILD_DIR}
DEPENDS test_build
)
add_custom_target(coverage_html
COMMAND genhtml coverage.info --output-directory out
COMMAND x-www-browser out/index.html
WORKING_DIRECTORY ${CMAKE_BUILD_DIR}
DEPENDS coverage_build
)
set(coverage_deps
coverage_build)
if (COV_HTML)
list(APPEND coverage_deps coverage_html)
endif()
add_custom_target(coverage
DEPENDS ${coverage_deps}
)
endif()