Repository navigation
Add COMAnalyzer - #2306
Add COMAnalyzer #2306
Conversation
| { | ||
| Trimmer = 1, | ||
| Analyzer = 2, | ||
| RequiresAssemblyFileAnalyzer = 2, |
There was a problem hiding this comment.
This seems like it's leaking implementation details. We shouldn't need to know which analyzer produces it, only if it's a diagnostic currently produced by any of the analyzers.
There was a problem hiding this comment.
But then that would be a problem whenever some test suite in Mono.Linker.Tests.Cases has ExpectedWarning with warning codes for different analyzers, no? e.g., say you have A.cs with:
[ExpectedWarning("ILXXXX", ProducedBy = ProducedBy.Analyzer)] // This is only produced by analyzer A
[ExpectedWarning("ILYYYY", ProducedBy = ProducedBy.Analyzer)] // This is only produced by analyzer B
void Foo () { ... }Since analyzer tests are ran separately, when running the tests in A.cs with analyzer A, we'd fail since it wouldn't produce ILYYYY; similar when running A.cs tests with B, in which case we'd be missing ILXXXX.
There was a problem hiding this comment.
We could also allow to pass multiple analyzers to RunTest in the analyzer test infra, if that makes more sense than having all analyzers in the enum.
There was a problem hiding this comment.
Yeah, it is leaking details a bit due to the impedance mismatch between the linker/analyzer test infrastructure - running with all the analyzers would be good to avoid this. But I like this approach as a way to ignore some expected warnings when testing with only one analyzer for now. Maybe it's worth a comment here to say why we have the individual enum values.
| { | ||
| Trimmer = 1, | ||
| Analyzer = 2, | ||
| RequiresAssemblyFileAnalyzer = 2, |
There was a problem hiding this comment.
Yeah, it is leaking details a bit due to the impedance mismatch between the linker/analyzer test infrastructure - running with all the analyzers would be good to avoid this. But I like this approach as a way to ignore some expected warnings when testing with only one analyzer for now. Maybe it's worth a comment here to say why we have the individual enum values.
* Add COM Analyzer * Add IsComInterop Run Interop tests * PR feedback * Rename variables in GetTestFilesByDirName * Extend ProducedBy with enum values for each supported analyzer * Lint * PR feedback * Return ProducedBy instead of list Commit migrated from dotnet/linker@3418bcd
Rebased #2275 on top of main. ILLinkAnalyzer test checker was validating
ExpectedWarningAttributes for any diagnostic id -- I made changes in this PR so that we only validate diagnostic ids supported by the analyzer we are testing:https://github.com/mateoatr/linker/blob/a540731187a7a0f1a7beb3d648d79003c589e4a6/test/ILLink.RoslynAnalyzer.Tests/TestChecker.cs#L34-L39