[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. |
mandel-macaque
left a comment
There was a problem hiding this comment.
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.
remote it? or uncomment?
There was a problem hiding this comment.
I think this is fine to keep until we are done with the test in general
There was a problem hiding this comment.
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"); | ||
| // } |
❌ [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. |
| 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.
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.
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.
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.