-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
ILLink: Check for all expected warnings, then fail if any are unmatched #102286
ILLink: Check for all expected warnings, then fail if any are unmatched #102286
Conversation
Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas |
@@ -14,9 +16,9 @@ public TrimmingTestLogger () | |||
MessageContainers = new List<MessageContainer> (); | |||
} | |||
|
|||
public List<MessageContainer> GetLoggedMessages () | |||
public ImmutableArray<MessageContainer> GetLoggedMessages () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make sure we don't modify the message list outside of the logger, we should return an immutable array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you! This will come in handy.
…ed (dotnet#102286) In Linker tests, we fail at the first ExpectedWarning that isn't matched, and print all the messages that haven't been matched yet, even though they may match another ExpectedWarning that just hasn't been processed yet. Instead, we should keep a list of all expected warnings that were missing report them at once along with all unmatched warnings. This makes it much easier to debug when a test is failing.
In Linker tests, we fail at the first ExpectedWarning that isn't matched, and print all the messages that haven't been matched yet, even though they may match another ExpectedWarning that just hasn't been processed yet.
Instead, we should keep a list of all expected warnings that were missing report them at once along with all unmatched warnings. This makes it much easier to debug when a test is failing.