Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Reuse linker tests in analyzer #2299

Closed
Closed

Description

@sbomer

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

Once that's fixed we should start turning on various tests and fixing any remaining discrepancies as we uncover them:

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 for RequiresUnreferencedCode.
    • @tlakollo already renamed the test to be agnostic to the attribute name: Rename RequiresUnreferencedCode to Requires  #2301
    • Need to add RequiresAssemblyFiles attribute and ExpectedWarnings produced by RequiresAssemblyFiles analyzer only

Activity

  1. sbomer commented on Jan 13, 2022

    @sbomer
    MemberAuthor

    I've updated the above with links to some of the completed work. Additionally, the following changes made it easier to share tests and give us increased confidence that the tests catch all disparities between the linker and analyzer:

    We don't really want to use the same signature format for linker and analyzer, so I've crossed out that item above. We have a tracking issue for it at #2406.

    I think we can close this now. We are already sharing a good portion of the tests with the analyzer, and I'm not aware of any infrastructure issues preventing us from doing further sharing. The remaining work is just about analyzer parity, tracked in #2273.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions