Description
This is a tracking issue that I'll try to keep updated to reflect the work left to get to 100% coverage of the linker's warning validation in the analyzer.
We already have some shared tests, and #2292 improves the validation (especially for UnrecognizedReflectionAccessPattern
), but there are still some discrepancies that prevent sharing of tests. The one I'm aware of is:
[ ] Ensure analyzer and linker use same signature format- This is required for a lot of the
UnrecognizedReflectionAccessPattern
attributes - No namespaces in parameter types
- No namespace or declaring type in callee method
- Use spaces between parameters
- This is required for a lot of the
Once that's fixed we should start turning on various tests and fixing any remaining discrepancies as we uncover them:
-
Enable linker tests for DAM without dataflow ([feature/damAnalyzer] Enable a few linker DAM tests for analyzer #2307, [DAM analyzer] Add support for properties and enable more tests #2390)
- A good portion of the tests in https://github.com/dotnet/linker/tree/main/test/Mono.Linker.Tests.Cases/DataFlow probably don't require dataflow analysis.
-
Enable linker dataflow tests (https://github.com/dotnet/linker/pull/2360/files)
- Depends on analyzer support for dataflow analysis
- We should aim to get most of the tests in running with the analyzer.
-
Move analyzer tests into shared linker testcases
- We can keep a few analyzer-only tests as a sanity check, but once we have confidence in the validation, most of the tests should be shared.
Other test sharing that we can start doing, which doesn't depend on the UnrecognizedReflectionAccessPattern
as far as I know:
- Share RequiresCapability tests
RequiresAssemblyFiles
analyzer should be able to reuse testcases forRequiresUnreferencedCode
.- @tlakollo already renamed the test to be agnostic to the attribute name: Rename RequiresUnreferencedCode to Requires #2301
- Need to add
RequiresAssemblyFiles
attribute andExpectedWarnings
produced byRequiresAssemblyFiles
analyzer only