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

Add option to collapse function with template as a single function in report #164

Open
Matti-Lehtonen opened this issue Sep 8, 2022 · 6 comments

Comments

@Matti-Lehtonen
Copy link

Add some option to report functions with template as single function in generated (html) reports

template <class type>
type sum( type x, type y) {
  return x+y;
}

int main() {
  auto result1 = sum(0u,1u);
  auto result2 = sum(0.0f,1.0f);
  auto result3 = sum(0.0,1.0);
  exit(0);
}

So instead of having a coverage report with three (3) functions of sum, actually report with single sum function would be preferred.

@henry2cox
Copy link
Collaborator

henry2cox commented Sep 8, 2022 via email

@Matti-Lehtonen
Copy link
Author

Thanx!

@Matti-Lehtonen
Copy link
Author

Matti-Lehtonen commented Sep 12, 2022 via email

@henry2cox
Copy link
Collaborator

henry2cox commented Sep 12, 2022 via email

@liuluheng
Copy link

liuluheng commented Aug 12, 2023

@henry2cox any update for this? Is the “--filter function” feature can be merged to master?

@henry2cox
Copy link
Collaborator

The basic 'function alias' feature described above was merged to master many months ago, and was released in lcov 2.0 back in May.
The feature requested here (more careful handling of template naming and template aliases) is more complicated and has not been done (at least, not by me).
Depending on what you are trying to do, the existing implementation may or may not be sufficient. If not: please try to explain what you need; it is possible that your requirement is different than @Matti-Lehtonen, and interesting to others as well.
You might also want to take a look at the --show-proportion flag - which is also related to function coverage (but not to aliasing).

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

3 participants