Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incompatibility with llvm-cov #29

Closed
wants to merge 2 commits into from

Conversation

Finomnis
Copy link

@Finomnis Finomnis commented Oct 20, 2023

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 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:

  • Confirm that this change fixes the coverage issue. (example)

@Finomnis Finomnis marked this pull request as draft October 20, 2023 13:27
@Finomnis Finomnis changed the title Move call_once logic into non-macro part to fix coverage problems Fix incompatibility with llvm-cov Oct 20, 2023
@Finomnis Finomnis marked this pull request as ready for review October 20, 2023 21:35
@Finomnis Finomnis marked this pull request as draft October 20, 2023 21:59
@Finomnis Finomnis marked this pull request as ready for review October 20, 2023 22:31
@Finomnis
Copy link
Author

Finomnis commented Nov 9, 2023

Closed due to inactivity.

@Finomnis Finomnis closed this Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant