-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: target register functionality and coverage
- added two cmake functions `ev_register_library_target` and `ev_register_module_target` for registering modules and libraries - all modules and libraries that are registered via those functions can be retrieved with `ev_get_targets` - this functionality is used for adding target specific coverage flags (but it can also be used to add other target specific compile options and flags) Signed-off-by: aw <[email protected]>
- Loading branch information
Showing
23 changed files
with
104 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
include_guard(GLOBAL) | ||
|
||
add_custom_target(everest_targets) | ||
|
||
set_target_properties(everest_targets | ||
PROPERTIES | ||
LIBRARIES "" | ||
MODULES "" | ||
) | ||
|
||
function(_ev_register_target TYPE NAME) | ||
if (NOT TARGET ${NAME}) | ||
message(FATAL_ERROR "The supplied name ${NAME} of type ${TYPE} is not a valid target") | ||
endif() | ||
|
||
set_property( | ||
TARGET everest_targets | ||
APPEND | ||
PROPERTY ${TYPE} ${NAME} | ||
) | ||
endfunction() | ||
|
||
function(ev_register_library_target NAME) | ||
_ev_register_target(LIBRARIES ${NAME}) | ||
endfunction() | ||
|
||
function(ev_register_module_target NAME) | ||
_ev_register_target(MODULES ${NAME}) | ||
endfunction() | ||
|
||
function(ev_get_targets NAME TYPE) | ||
get_target_property(tmp everest_targets ${TYPE}) | ||
if (NOT tmp STREQUAL "" AND NOT tmp) | ||
message(FATAL_ERROR "There is no target of type ${TYPE} defined") | ||
endif() | ||
|
||
set(${NAME} ${tmp} PARENT_SCOPE) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ target_link_libraries(gpio | |
PRIVATE | ||
) | ||
|
||
ev_register_library_target(gpio) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,5 @@ target_link_libraries(slac_fsm_ev | |
slac::slac | ||
fsm::fsm | ||
) | ||
|
||
ev_register_library_target(slac_fsm_ev) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,5 @@ target_link_libraries(slac_fsm_evse | |
slac::slac | ||
fsm::fsm | ||
) | ||
|
||
ev_register_library_target(slac_fsm_evse) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ target_link_libraries(slac_io | |
PUBLIC | ||
slac::slac | ||
) | ||
|
||
ev_register_library_target(slac_io) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,5 @@ target_link_libraries(umwc_comms | |
everest::framework | ||
everest::gpio | ||
) | ||
|
||
ev_register_library_target(umwc_comms) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,5 @@ target_link_libraries(phyverso_gpio | |
phyverso_config | ||
fmt::fmt | ||
) | ||
|
||
ev_register_library_target(phyverso_gpio) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,5 @@ target_link_libraries(yeti_comms | |
everest::framework | ||
everest::gpio | ||
) | ||
|
||
ev_register_library_target(yeti_comms) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,5 @@ target_link_libraries(evyeti_comms | |
Pal::Sigslot | ||
everest::framework | ||
) | ||
|
||
ev_register_library_target(evyeti_comms) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,21 @@ | ||
# enabling coverage related things | ||
|
||
evc_include(CodeCoverage) | ||
|
||
# add compiler flags to all targets which should be coveraged | ||
|
||
foreach(type MODULES LIBRARIES) | ||
ev_get_targets(targets ${type}) | ||
|
||
foreach(target ${targets}) | ||
append_coverage_compiler_flags_to_target(${target}) | ||
endforeach() | ||
endforeach() | ||
|
||
get_target_property(GENERATED_OUTPUT_DIR generate_cpp_files EVEREST_GENERATED_OUTPUT_DIR) | ||
setup_target_for_coverage_gcovr_html( | ||
NAME ${PROJECT_NAME}_gcovr_coverage | ||
EXCLUDE "${GENERATED_OUTPUT_DIR}/*" | ||
) | ||
|
||
add_subdirectory(everest-core_tests) |