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

Globally registered test suites won't appear in code coverage #546

Open
kammce opened this issue Dec 12, 2022 · 0 comments
Open

Globally registered test suites won't appear in code coverage #546

kammce opened this issue Dec 12, 2022 · 0 comments

Comments

@kammce
Copy link

kammce commented Dec 12, 2022

From what I could gather from some testing I did last night, it seems that globally defined/registered boost::ut::suite objects do not show up in code coverage even though they do in fact run.

Seems that code coverage is only picked up from when main starts and ends and due to this working during global static initialization occurs, none of the unit tests are picked up.

A work around appears to be changing the suite to a simple void function and calling it within the main function will fix the problem if one wants to keep their test files separate.

Is there some way to prevent suites from being executed at static init time and be manually run within main. That way we get the global registration, but we don't execute before main executes. I'm not sure what would be required to make this work with the runner config. Any thoughts?

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

No branches or pull requests

1 participant