Repository navigation
Test Restructure - #2336
Test Restructure#2336
Conversation
Add ProducedBy for LogContains and LogDoesNotContain Remove Analyzer Generic for test case run, since now all analyzers are run
… AddRAFToRequiresTestFile
… AddRAFToRequiresTestFile
…he base Requires file Remove tests from Analyzer if they are being tested in linker Add RequiresAssemblyFilesMismatchAttribute Tittle and Message to fix bug Add testing in linker for mismatching attributes Add testing in linker for Delegates in CompilerGenerated file
| } | ||
|
|
||
| [ExpectedWarning ("IL3003", "DerivedClassWithoutRequires.VirtualPropertyAnnotationInProperty", "BaseClassWithRequires.VirtualPropertyAnnotationInProperty", ProducedBy = ProducedBy.Analyzer)] | ||
| public override string VirtualPropertyAnnotationInProperty { get; set; } |
There was a problem hiding this comment.
Why is this for assembly files only and not for unreferenced code as well?
There was a problem hiding this comment.
You cannot place RUC on a property, but you can do it in RAF
There was a problem hiding this comment.
Hmm that's a curious limitation... can you please create an issue somewhere to make this consistent? Unless there's a reason (and I just forgot).
There was a problem hiding this comment.
I think it's the same deal... In theory there's no reason for these two attributes to have different behavior (at least I'm not aware of one). It's fine if they're not identical right now, but I think they should be eventually.
| var action = new Action (MethodWithRequires); | ||
| } | ||
|
|
||
| [ExpectedWarning ("IL2026", "Message from --InitString--", CompilerGeneratedCode = true)] |
There was a problem hiding this comment.
I don't think these should have the CompilerGeneratedCode = true on them... that is meant for cases where the origin is from the compiler generated code (and thus it's not possible to put the attribute there). In this case the warning happens on a static field directly - so no need for this.
There was a problem hiding this comment.
According to linker the warning comes from the static constructor, for example:
ILLink: Trim analysis warning IL2026: Mono.Linker.Tests.Cases.RequiresCapability.RequiresInCompilerGeneratedCode.SuppressInAsyncBody..cctor(): Using member 'Mono.Linker.Tests.Cases.RequiresCapability.RequiresInCompilerGeneratedCode.InitString()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Message from --InitString--. so the CompilerGeneratedCode is needed. In fact I think I forgot to add some code handling that I had before
There was a problem hiding this comment.
OK _ I guess we can treat static .ctors as compiler generated code. This property was initially designed for the async/iterator state machine code, but it seems to make sense in other cases as well 😄
There was a problem hiding this comment.
Added an additional piece of code in the result checker to verify the static constructor call (was already in #2113)
Add support for static constructor compiler generated calls
…y the analyzer yet
|
Marked as done several points of #2299 |
Move RequiresAssemblyFiles from Analyzer to the linker RequiresCapability file Move the new constraint code from RequiresUnreferencedCode to be on the base Requires file Add Warning Id to messages from the analyzer to distinguish in a test which analyzer missed/found a warning Add RequiresAssemblyFilesMismatchAttribute Title and Message to fix bug Add testing in linker for mismatching attributes Add testing in linker for Delegates in CompilerGenerated file Add support for static constructor compiler-generated calls Add additional warnings from DAM and RUC interaction. Not supported by the analyzer yet Commit migrated from dotnet/linker@8e455f0
Add RequiresAssemblyFiles to RequiresCapability file
Add ProducedBy for LogContains and LogDoesNotContain
Remove Analyzer Generic for test case run, since now all analyzers are run