-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
Class name invalid for gcov parser #516
Comments
As a bonus: It would be nice if the assembly name could be derived from the input filename somehow. |
I applied your proposed fix in dc395da, thanks for that! Regarding the assembly name: I'm not sure if the file name is helpful. In your example it would be |
Wow, thanks for this blazing fast implementation & reply. Regarding the assembly name: Some ideas, that would enable this:
|
I like this approach:
Reasons:
|
I thought about the assembly naming again. If a suffix is added, it will only work if each file represents a different assembly. |
Good point. But I can see your points as well. It's a bit of an effort to introduce a new command line parameter. And in case I want to specify a different assembly name for multiple reports, I would have to invoke the tool multiple times... |
Release 5.1.7 contains a new setting/command line parameter which will allow to specify the default name.
See also: |
Fantastic work. Thank you so much. |
I have just tried it in our production pipeline. But the class names still contain the full path 😢. |
Could you please try again with release 5.1.8? |
Now it works |
Sorry, had to revert the change in 5.1.9 because it caused #522. |
Describe the bug
When I use ReportGenerator to convert a gcov report to a cobertura report, the file path is not stripped from the class name.
To reproduce
test_coverage.info
with contents likeInvoke ReportGenerator like this
ReportGenerator -reports:./test_coverage.info -sourcedirs:/home/agent/src -targetdir:./Results/ -reporttypes:Cobertura
Take a look at the generated
./Results/Cobertura.xml
file:Why is this a problem?
I later merge reports together using ReportGenerator with
-reporttypes:HtmlInline_AzurePipelines
.Classnames containing a path like this, are not correctly rendered in the report.
Possible Fix
https://github.com/danielpalme/ReportGenerator/blob/main/src/ReportGenerator.Core/Parser/GCovParser.cs#L89
var @class = new Class(fileName, assembly);
var @class = new Class(className, assembly);
The text was updated successfully, but these errors were encountered: