mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 06:03:34 +08:00
Made coverage html output optional.
This commit is contained in:
+20
-3
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user