-
Notifications
You must be signed in to change notification settings - Fork 514
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
Add cecil test for verifying obsoleted apis #13590
Conversation
tests/cecil-tests/ObsoleteTest.cs
Outdated
var assembly = Helper.GetAssembly (assemblyPath); | ||
if (assembly == null) { | ||
Assert.Ignore ("{assemblyPath} could not be found (might be disabled in build)"); | ||
return; // just to help nullability |
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.
return; // just to help nullability | |
return; |
tests/cecil-tests/ObsoleteTest.cs
Outdated
|
||
// TODO: Events? | ||
|
||
Console.WriteLine (found.Count); |
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.
This CWL was a debugging aid on the sample I pointed you to. I think it can be removed.
tests/cecil-tests/ObsoleteTest.cs
Outdated
|
||
bool HasObsoleteAttribute (IEnumerable<CustomAttribute> attributes) => attributes.Any (a => IsObsoleteAttribute (a)); | ||
|
||
bool IsObsoleteAttribute (CustomAttribute attribute) |
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.
Maybe a 1 liner here?
bool IsObsoleteAttribute (CustomAttribute attribute) => attribute.AttributeType.Name == "Obsolete" ||
attribute.AttributeType.Name == "ObsoleteAttribute";
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.
This looks great! I've just added a few minor comments
tests/cecil-tests/ObsoleteTest.cs
Outdated
Assert.Ignore ("{assemblyPath} could not be found (might be disabled in build)"); | ||
return; | ||
} | ||
Console.WriteLine(assemblyPath); |
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.
Console.WriteLine(assemblyPath); | |
Console.WriteLine (assemblyPath); |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View dotnet API diffView dotnet legacy API diffAPI Current PR diffℹ️ API Diff (from PR only) (please review changes) View dotnet API diffView dotnet legacy API diffGenerator diff✅ Generator Diff (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results3 tests failed, 166 tests passed.Failed tests
Pipeline on Agent XAMBOT-1101.BigSur' |
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 awesome!
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View dotnet API diffView dotnet legacy API diffAPI Current PR diffℹ️ API Diff (from PR only) (please review changes) View dotnet API diffView dotnet legacy API diffGenerator diff✅ Generator Diff (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results11 tests failed, 158 tests passed.Failed tests
Pipeline on Agent XAMBOT-1094.BigSur' |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View dotnet API diffView dotnet legacy API diffAPI Current PR diffℹ️ API Diff (from PR only) (please review changes) View dotnet API diffView dotnet legacy API diffGenerator diff✅ Generator Diff (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results3 tests failed, 166 tests passed.Failed tests
Pipeline on Agent XAMBOT-1101.BigSur' |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View dotnet API diffView dotnet legacy API diffAPI Current PR diffℹ️ API Diff (from PR only) (please review changes) View dotnet API diffView dotnet legacy API diffGenerator 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, 168 tests passed.Failed tests
Pipeline on Agent XAMBOT-1097.BigSur' |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View dotnet API diffView dotnet legacy API diffAPI Current PR diffℹ️ API Diff (from PR only) (please review changes) View dotnet API diffView dotnet legacy API diffGenerator diff✅ Generator Diff (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results3 tests failed, 166 tests passed.Failed tests
Pipeline on Agent XAMBOT-1094.BigSur' |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View dotnet API diffView dotnet legacy API diffAPI Current PR diffℹ️ API Diff (from PR only) (please review changes) View dotnet API diffView dotnet legacy API diffGenerator diff✅ Generator Diff (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results2 tests failed, 167 tests passed.Failed tests
Pipeline on Agent XAMBOT-1094.BigSur' |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View dotnet API diffView dotnet legacy API diffAPI Current PR diffℹ️ API Diff (from PR only) (please review changes) View dotnet API diffView dotnet legacy API diffGenerator 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, 168 tests passed.Failed tests
Pipeline on Agent XAMBOT-1101.BigSur' |
bgen-tests are no longer failing! Thank you @chamons for all the help. Remaining failing test is unrelated: https://github.com/xamarin/maccore/issues/2414 |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View dotnet API diffView dotnet legacy API diffAPI Current PR diffℹ️ API Diff (from PR only) (please review changes) View dotnet API diffView dotnet legacy API diffGenerator 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, 168 tests passed.Failed tests
Pipeline on Agent XAMBOT-1104.BigSur' |
Wrote a cecil test for verifying obsolete properties, methods, and types.
Included a switch statement to filter by namespace as work progresses.
Largely collaborated with @chamons and inspired by his AttributeTest