Skip to content

Commit

Permalink
feature: support __gcov_dump on signals
Browse files Browse the repository at this point in the history
- the auto-generated loader (`ld-ev`) now calls a helper function, if
  `EVEREST_COVERAGE_ENABLED` is enabled
- this helper function, which is implemented in everest-core helper
  library, registers signal handlers, that will call `__gcov_dump` and
  terminate

Signed-off-by: aw <aw@pionix.de>
  • Loading branch information
a-w50 committed Jan 16, 2025
1 parent 46eda28 commit 165f2c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ev-dev-tools/src/ev_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""EVerest command line utility."""
__version__ = '0.4.4'
__version__ = '0.4.5'
8 changes: 8 additions & 0 deletions ev-dev-tools/src/ev_cli/templates/ld-ev.cpp.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

#include "{{ info.ld_ev_header }}"

#ifdef EVEREST_COVERAGE_ENABLED
#include <everest/staging/helpers/coverage.hpp>
#endif

#include "{{ info.module_header }}"
{% for impl in provides %}
#include "{{ impl.class_header }}"
Expand Down Expand Up @@ -150,6 +154,10 @@ std::vector<Everest::cmd> everest_register(const RequirementInitialization& requ
} // namespace module

int main(int argc, char* argv[]) {
#ifdef EVEREST_COVERAGE_ENABLED
everest::helpers::install_signal_handlers_for_gcov();
#endif

auto module_loader = Everest::ModuleLoader(argc, argv, Everest::ModuleCallbacks(
module::register_module_adapter, module::everest_register,
module::LdEverest::init, module::LdEverest::ready),
Expand Down

0 comments on commit 165f2c8

Please sign in to comment.