Description
The code generated by TUnit.Core.SourceGenerator.Generators.TestMetadataGenerator is not marked with the [GeneratedCode] attribute, which makes it harder to exclude from code coverage reports.
Expected Behavior
All code generated by source generators would be marked with [GeneratedCode]. If appropriate, it could also be marked with [ExcludeFromCodeCoverage] as well.
Actual Behavior
The code, which is generated in the TUnit.Generated namespace, is not marked with any attributes to signify it is auto-generated.
Steps to Reproduce
Use <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> in a project file to see the generated code and note it is not marked with attributes.
TUnit Version
1.13.0
.NET Version
.NET 10
Operating System
Windows
IDE / Test Runner
Other (please specify in additional context)
Error Output / Stack Trace
Additional Context
This happens during build, not during test execution, although the impact mostly affects code coverage reports.
IDE-Specific Issue?
Description
The code generated by
TUnit.Core.SourceGenerator.Generators.TestMetadataGeneratoris not marked with the[GeneratedCode]attribute, which makes it harder to exclude from code coverage reports.Expected Behavior
All code generated by source generators would be marked with
[GeneratedCode]. If appropriate, it could also be marked with[ExcludeFromCodeCoverage]as well.Actual Behavior
The code, which is generated in the
TUnit.Generatednamespace, is not marked with any attributes to signify it is auto-generated.Steps to Reproduce
Use
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>in a project file to see the generated code and note it is not marked with attributes.TUnit Version
1.13.0
.NET Version
.NET 10
Operating System
Windows
IDE / Test Runner
Other (please specify in additional context)
Error Output / Stack Trace
Additional Context
This happens during build, not during test execution, although the impact mostly affects code coverage reports.
IDE-Specific Issue?
dotnet testordotnet run, not just in my IDE