diff --git a/src/core/report.c b/src/core/report.c index 9d1b8b3..3938949 100644 --- a/src/core/report.c +++ b/src/core/report.c @@ -44,11 +44,14 @@ if (!open_module_self(&self)) \ abort(); \ void *start = map_section_data(&self, CR_HSEC_STR(Kind), §); \ - if (!start) \ + if (!start) { \ + close_module(&self); \ return; \ + } \ void *end = (char *) start + sect.sec_len; \ for (f_report_hook *hook = start; hook < (f_report_hook *) end; ++hook) \ (*hook ? *hook : nothing)(data); \ + close_module(&self); \ } IMPL_CALL_REPORT_HOOKS(PRE_ALL) diff --git a/src/core/runner.c b/src/core/runner.c index 024dd45..7f2157e 100644 --- a/src/core/runner.c +++ b/src/core/runner.c @@ -168,6 +168,8 @@ struct criterion_test_set *criterion_init(void) criterion_register_test(set, *test); } + close_module(&self); + return set; }