Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dalexsoto authored Mar 28, 2024
1 parent 533bace commit 5be5dea
Showing 1 changed file with 57 additions and 3 deletions.
60 changes: 57 additions & 3 deletions tests/dotnet/UnitTests/TrimmerWarningsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,25 @@ public class TrimmerWarningsTest : TestBaseClass {
[TestCase (ApplePlatform.TVOS, "tvossimulator-x64")]
public void TrimmerWarningsManagedStaticRegistrar (ApplePlatform platform, string runtimeIdentifiers)
{
TrimmerWarnings (platform, runtimeIdentifiers, "managed-static", Array.Empty<ExpectedBuildMessage> ());
// FIXME: dotnet/runtime#100256
ExpectedBuildMessage [] expectedWarnings;
switch (platform) {
case ApplePlatform.iOS:
case ApplePlatform.TVOS:
expectedWarnings = Array.Empty<ExpectedBuildMessage> ();
break;
case ApplePlatform.MacOSX:
case ApplePlatform.MacCatalyst:
expectedWarnings = new ExpectedBuildMessage [] {
new ExpectedBuildMessage ("ILLink" /* line 0 */, "System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeCompiled: Attribute 'System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute' is being referenced in code but the trimmer was instructed to remove all instances of this attribute. If the attribute instances are necessary make sure to either remove the trimmer attribute XML portion which removes the attribute instances, or override the removal by using the trimmer XML descriptor to keep the attribute type (which in turn keeps all of its instances)."),
};
break;
default:
Assert.Fail ($"Unknown platform: {platform}");
return;
}

TrimmerWarnings (platform, runtimeIdentifiers, "managed-static", expectedWarnings);
}

[Test]
Expand All @@ -18,7 +36,25 @@ public void TrimmerWarningsManagedStaticRegistrar (ApplePlatform platform, strin
[TestCase (ApplePlatform.TVOS, "tvos-arm64")]
public void TrimmerWarningsStaticRegistrar (ApplePlatform platform, string runtimeIdentifiers)
{
TrimmerWarnings (platform, runtimeIdentifiers, "static", Array.Empty<ExpectedBuildMessage> ());
// FIXME: dotnet/runtime#100256
ExpectedBuildMessage [] expectedWarnings;
switch (platform) {
case ApplePlatform.iOS:
case ApplePlatform.TVOS:
expectedWarnings = Array.Empty<ExpectedBuildMessage> ();
break;
case ApplePlatform.MacOSX:
case ApplePlatform.MacCatalyst:
expectedWarnings = new ExpectedBuildMessage [] {
new ExpectedBuildMessage ("ILLink" /* line 0 */, "System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeCompiled: Attribute 'System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute' is being referenced in code but the trimmer was instructed to remove all instances of this attribute. If the attribute instances are necessary make sure to either remove the trimmer attribute XML portion which removes the attribute instances, or override the removal by using the trimmer XML descriptor to keep the attribute type (which in turn keeps all of its instances)."),
};
break;
default:
Assert.Fail ($"Unknown platform: {platform}");
return;
}

TrimmerWarnings (platform, runtimeIdentifiers, "static", expectedWarnings);
}

[Test]
Expand All @@ -28,7 +64,25 @@ public void TrimmerWarningsStaticRegistrar (ApplePlatform platform, string runti
[TestCase (ApplePlatform.TVOS, "tvos-arm64")]
public void TrimmerWarningsDynamicRegistrar (ApplePlatform platform, string runtimeIdentifiers)
{
TrimmerWarnings (platform, runtimeIdentifiers, "dynamic", Array.Empty<ExpectedBuildMessage> ());
// FIXME: dotnet/runtime#100256
ExpectedBuildMessage [] expectedWarnings;
switch (platform) {
case ApplePlatform.iOS:
case ApplePlatform.TVOS:
expectedWarnings = Array.Empty<ExpectedBuildMessage> ();
break;
case ApplePlatform.MacOSX:
case ApplePlatform.MacCatalyst:
expectedWarnings = new ExpectedBuildMessage [] {
new ExpectedBuildMessage ("ILLink" /* line 0 */, "System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeCompiled: Attribute 'System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute' is being referenced in code but the trimmer was instructed to remove all instances of this attribute. If the attribute instances are necessary make sure to either remove the trimmer attribute XML portion which removes the attribute instances, or override the removal by using the trimmer XML descriptor to keep the attribute type (which in turn keeps all of its instances)."),
};
break;
default:
Assert.Fail ($"Unknown platform: {platform}");
return;
}

TrimmerWarnings (platform, runtimeIdentifiers, "dynamic", expectedWarnings);
}

void TrimmerWarnings (ApplePlatform platform, string runtimeIdentifiers, string registrar, params ExpectedBuildMessage [] expectedWarnings)
Expand Down

7 comments on commit 5be5dea

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Windows Integration Tests passed 💻

All Windows Integration Tests passed.

Pipeline on Agent
Hash: 5be5deaa23e9f91042cbb56e7d2e1806f163f214 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ API diff for current PR / commit

Legacy Xamarin (No breaking changes)
  • iOS (no change detected)
  • tvOS (no change detected)
  • watchOS (no change detected)
  • macOS (no change detected)
NET (empty diffs)
  • iOS: (empty diff detected)
  • tvOS: (empty diff detected)
  • MacCatalyst: (empty diff detected)
  • macOS: (empty diff detected)

✅ API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 5be5deaa23e9f91042cbb56e7d2e1806f163f214 [CI build]

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📚 [CI Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent
Hash: [CI build]

Please sign in to comment.