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

Analyzer test infra improvements - #2292

Merged
sbomer merged 2 commits into
dotnet:mainfrom
sbomer:analyzerTestInfraImprovements
Sep 29, 2021
Merged

sbomer merged 2 commits into
dotnet:mainfrom
sbomer:analyzerTestInfraImprovements

Conversation

@sbomer

@sbomer sbomer commented Sep 23, 2021 •

Copy link
Copy Markdown
Member

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.

@sbomer
sbomer requested a review from marek-safar as a code owner September 23, 2021 20:19
- 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
sbomer force-pushed the analyzerTestInfraImprovements branch from 9e879d7 to 75e9290 Compare September 23, 2021 21:34
@sbomer

sbomer commented Sep 28, 2021

Copy link
Copy Markdown
Member Author

@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

mateoatr commented Sep 29, 2021 •

Copy link
Copy Markdown
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants