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

Analyzer test infra improvements #2292

Merged
merged 2 commits into from
Sep 29, 2021

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Sep 23, 2021

This makes the analyzer test validation more similar to the linker test validation and adds extra reporting when tests fail. The change caught a few differences between the linker and analyzer behavior:

  • Analyzer was producing cctor warnings - so I removed that
  • Analyzer was producing duplicate warnings for RUC properties set in attributes
  • Analyzer behavior for reference to a testcase dependency assembly was already fixed

As part of this I also had to tweak the logic for checking whether a diagnostic originates from a particular member.

- When diagnostics are missing, display all missing diagnostics
- Show candidate diagnostics that didn't match any expected ones
- Adjust match criteria to match Roslyn strings
- Various small fixes
- Clean up nullable annotations in test infra
- Remove cctor warnings from analyzer to match linker
- Remove redundant attribute property setter warnings
- Fix location filtering for warnings that originate from types
@sbomer
Copy link
Member Author

sbomer commented Sep 28, 2021

@mateoatr once this is ready I plan to merge the changes from main into the DAM feature branch. These changes should make it easier to add coverage by sharing tests with the linker. PTAL when you have a chance!

@mateoatr
Copy link
Contributor

mateoatr commented Sep 29, 2021

This LGTM. I think we are almost on par with what we have under VerifyLoggedMessages in the linker's result checker! It would be good to try to start sharing code between that and the analyzer's test checker.

@sbomer sbomer merged commit 640878a into dotnet:main Sep 29, 2021
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
* Improve analyzer test checker

- When diagnostics are missing, display all missing diagnostics
- Show candidate diagnostics that didn't match any expected ones
- Adjust match criteria to match Roslyn strings
- Clean up nullable annotations in test infra
- Remove cctor warnings from analyzer to match linker
- Remove redundant attribute property setter warnings
- Fix location filtering for warnings that originate from types

Commit migrated from dotnet/linker@640878a
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

Successfully merging this pull request may close these issues.

2 participants