Coverage generated by llvm-cov frequently report #[traced_test] as uncovered. (example)
Reason is that the generated code in call_once only gets executed once per project, and hence all tests (except one) report the code inside of it as uncovered.
Another reason is that the functions logs_contain and logs_assert do not necessarily have to be used by the programmer.
Solution
Move call_once into the non-macro part of the library, and call it from the macro part.
Add feature llvm-cov-compat which marks logs_contain and logs_assert as:
#[cfg_attr(coverage_nightly, coverage(off))]
Todo:
[x] Confirm that this change fixes the coverage issue. (example)
Rationale
Coverage generated by
llvm-cov
frequently report#[traced_test]
as uncovered. (example)Reason is that the generated code in
call_once
only gets executed once per project, and hence all tests (except one) report the code inside of it as uncovered. Another reason is that the functionslogs_contain
andlogs_assert
do not necessarily have to be used by the programmer.Solution
call_once
into the non-macro part of the library, and call it from the macro part.llvm-cov-compat
which markslogs_contain
andlogs_assert
as:Todo: