-
Notifications
You must be signed in to change notification settings - Fork 519
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
[tests] Add disabled NET6 availability attribute test #14106
Conversation
A lot of the duplication in functions at the bottom is due to the fact that CustomAttributes is not on any Cecil base class from what I could tell, so I had to abuse type overloading to share code. |
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.
Looks good, not blocking for my nits, please clean them a little :)
// #if DEBUG | ||
// const string Filter = "AppKit"; | ||
// if (!fullName.Contains (" " + Filter)) { | ||
// return; | ||
// } | ||
// #endif |
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.
remote it? or uncomment?
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.
I think this is fine to keep until we are done with the test in general
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.
I'm planning on landing these just to uncomment out when debugging the mel and generator changes.
// // iOS implies maccatalyst, but only for parent scope | ||
// if (parentAvailability.Contains("ios") && !parentAvailability.Contains("maccatalyst")) { | ||
// parentAvailability.Append("maccatalyst"); | ||
// } |
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.
same.
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.
same as above
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View dotnet API diffView dotnet legacy API diffView dotnet iOS-MacCatalayst API diff
API Current PR diffℹ️ API Diff (from PR only) (please review changes) View dotnet API diffView dotnet legacy API diffView dotnet iOS-MacCatalayst API diff
Generator diff✅ Generator Diff (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results1 tests failed, 105 tests passed.Failed tests
Pipeline on Agent XAMBOT-1094.BigSur' |
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Added that second suggested test. |
tests/cecil-tests/AttributeTest.cs
Outdated
if (attribute.ConstructorArguments.Count == 1 && attribute.ConstructorArguments[0].Type.Name == "String") { | ||
string full = (string)attribute.ConstructorArguments[0].Value; | ||
switch (full) { | ||
case string s when full.StartsWith("ios", StringComparison.Ordinal): |
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.
Woah, I've never seen this before! Very handy
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View dotnet API diffView dotnet legacy API diffView dotnet iOS-MacCatalayst API diff
API Current PR diffℹ️ API Diff (from PR only) (please review changes) View dotnet API diffView dotnet legacy API diffView dotnet iOS-MacCatalayst API diff
Generator diff✅ Generator Diff (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results1 tests failed, 105 tests passed.Failed tests
Pipeline on Agent XAMBOT-1098.BigSur |
} | ||
|
||
// Unfortunate state we need to keep since I can't see to walk "up" from a | ||
// MethodDefinition get_Foo or SetFoo to see it's container's properties |
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.
Something like this should work:
var getter = ...;
var property = getter.DeclaringType.Properties.Find (v => v.Name == getter.Name.Substring (4));
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.
It seems to work, at least enough for this PR. I'll fix it up with the attribute changes in follow up.
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View dotnet API diffView dotnet legacy API diffView dotnet iOS-MacCatalayst API diff
API Current PR diffℹ️ API Diff (from PR only) (please review changes) View dotnet API diffView dotnet legacy API diffView dotnet iOS-MacCatalayst API diff
Generator diff✅ Generator Diff (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results1 tests failed, 105 tests passed.Failed tests
Pipeline on Agent XAMBOT-1104.BigSur' |
Test failure was good old https://github.com/xamarin/maccore/issues/2443 |
This test is double disabled:
But I wanted to get it in and reviewed sooner.