Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse linker tests in analyzer #2299

Closed
4 tasks done
sbomer opened this issue Sep 29, 2021 · 1 comment
Closed
4 tasks done

Reuse linker tests in analyzer #2299

sbomer opened this issue Sep 29, 2021 · 1 comment
Assignees

Comments

@sbomer
Copy link
Member

sbomer commented Sep 29, 2021

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
@sbomer
Copy link
Member Author

sbomer commented Jan 13, 2022

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.

@sbomer sbomer closed this as completed Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants