-
|
After running dotnet test with XPlat Code Coverage enabled, the resulting cobertura reports contains classes from auto generated files. I am running the tests on a .NET Maui project. Specifically, I want to exclude all files ending in .g.cs. <class name="~.~.Content.CircularProgressBar" filename="obj\Debug\net9.0-windows10.0.19041.0\~.~.Maui.Mvvm.SourceGenerators\~.~.Maui.Mvvm.SourceGenerators.BindablePropertyGenerator\CircularProgressBar_BindableProperty.g.cs" ...>
<class name="~.~.Content.ContentItemsCollectionView" filename="obj\Debug\net9.0-windows10.0.19041.0\~.~.Maui.Mvvm.SourceGenerators\~.~.Maui.Mvvm.SourceGenerators.BindablePropertyGenerator2\ContentItemsCollectionView_ContentLayout_BindableProperty.g.cs" `...>
I have attempted to remove these results by adding the following to the .runsettings file: <ExcludeByFile>**/*.g.cs</ExcludeByFile><ExcludeByFile>
**/bin/**/*,
**/obj/**/*
</ExcludeByFile>This does nothing to remove the above results due to our source code generators not including the proper attributes. <ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>Currently there is someone working on adding the correct attributes to our source code generators, but for the moment I would like to see if a ExcludeByFile approach is possible. Strangely, the .NET Maui Community Toolkit source code generators get filtered no problem with the above, however our generators (which use Roslyn) does not get properly filtered. Some questions I have:
I feel this should be a simple clear cut problem, however nothing seems to filter these undesirable results. Feel free to ask for any further clarification if needed, however the information I can give away is limited due to the closed source nature of the code. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Please use ExcludeAssembliesWithoutSources option. The issue 14239 which has more information. |
Beta Was this translation helpful? Give feedback.
Please use ExcludeAssembliesWithoutSources option. The issue 14239 which has more information.