mirror of
https://github.com/KDE/konsole.git
synced 2026-06-10 06:55:13 -04:00
Add target to generate coverage html pages
Add cmake-options -DBUILD_COVERAGE=ON -DCOVERAGE_GENERATE_HTML=ON Output will be in build folder under coverage/
This commit is contained in:
@@ -28,6 +28,7 @@ if(BUILD_TESTING)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
### Security concerns about sendText and runCommand dbus methods being public
|
||||
option(REMOVE_SENDTEXT_RUNCOMMAND_DBUS_METHODS "Konsole: remove sendText and runCommand dbus methods" OFF)
|
||||
|
||||
@@ -375,3 +376,19 @@ target_link_libraries(konsolepart
|
||||
)
|
||||
install(TARGETS konsolepart DESTINATION ${KDE_INSTALL_PLUGINDIR})
|
||||
|
||||
# Add cmake-options -DBUILD_COVERAGE=ON -DCOVERAGE_GENERATE_HTML=ON
|
||||
if(COVERAGE_GENERATE_HTML)
|
||||
# find required tools - no error checking
|
||||
find_program(LCOV lcov REQUIRED)
|
||||
find_program(GENHTML genhtml REQUIRED)
|
||||
|
||||
add_custom_target(coverage
|
||||
# runs tests to get .gcda files
|
||||
COMMAND ctest --progress
|
||||
# generate data
|
||||
COMMAND ${LCOV} --directory . --capture --output-file coverage.info
|
||||
# generate report
|
||||
COMMAND ${GENHTML} --ignore-errors source --demangle-cpp -o coverage coverage.info
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user