Skip to content

Commit

Permalink
[tests] Fix the don't link test on .NET. (dotnet#9501)
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne authored Aug 26, 2020
2 parents fb40d7e + ebbd1e6 commit c0e16ef
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
15 changes: 13 additions & 2 deletions tests/linker/CommonDontLinkTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,20 @@ public class CommonDontLinkTest {
public void TypeDescriptorCanary ()
{
// this will fail is ReflectTypeDescriptionProvider.cs is modified
var rtdp = Type.GetType ("System.ComponentModel.ReflectTypeDescriptionProvider, System");
var rtdp = typeof (System.ComponentModel.BooleanConverter).Assembly.GetType ("System.ComponentModel.ReflectTypeDescriptionProvider");
Assert.NotNull (rtdp, "type");
var p = rtdp.GetProperty ("IntrinsicTypeConverters", BindingFlags.Static | BindingFlags.NonPublic);
Assert.NotNull (p, "property");
var ht = (Hashtable) p.GetGetMethod (true).Invoke (null, null);
Assert.NotNull (ht, "Hashtable");
Assert.That (ht.Count, Is.EqualTo (26), "Count");

#if NET
var expectedCount = 28;
#else
var expectedCount = 26;
#endif
Assert.That (ht.Count, Is.EqualTo (expectedCount), "Count");

foreach (var item in ht.Values) {
var name = item.ToString ();
switch (name) {
Expand Down Expand Up @@ -50,6 +57,10 @@ public void TypeDescriptorCanary ()
case "System.ComponentModel.UInt32Converter":
case "System.ComponentModel.ByteConverter":
case "System.ComponentModel.EnumConverter":
#if NET
case "System.ComponentModel.VersionConverter":
case "System.UriTypeConverter":
#endif
break;
default:
Assert.Fail ($"Unknown type descriptor {name}");
Expand Down
3 changes: 3 additions & 0 deletions tests/linker/ios/dont link/CalendarTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ namespace DontLink.Calendars {
[TestFixture]
// we want the tests to be available because we use the linker
[Preserve (AllMembers = true)]
#if NET
[Ignore ("No globalization data yet - https://github.com/xamarin/xamarin-macios/issues/8906")]
#endif
public class CalendarTest {

// application must *NOT* be build with I18N.MidEast and I18N.Other (Thai)
Expand Down
3 changes: 3 additions & 0 deletions tests/linker/ios/dont link/DontLinkRegressionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public void RemovedAttributes ()
}

[Test]
#if NET
[Ignore ("MulticastDelegate.BeginInvoke isn't supported in .NET (https://github.com/dotnet/runtime/issues/16312)")]
#endif
public void Bug5354 ()
{
Action<string> testAction = (string s) => { s.ToString (); };
Expand Down
2 changes: 1 addition & 1 deletion tests/xharness/Harness.cs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ void AutoConfigureIOS ()
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "introspection", "iOS", "introspection-ios-dotnet.csproj"))) { Name = "introspection", IsDotNetProject = true, SkipiOSVariation = false, SkiptvOSVariation = false, SkipwatchOSVariation = true, SkipTodayExtensionVariation = true, SkipDeviceVariations = true, SkipiOS32Variation = true, });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "monotouch-test", "dotnet", "iOS", "monotouch-test.csproj"))) { Name = "monotouch-test", IsDotNetProject = true, SkipiOSVariation = false, SkiptvOSVariation = true, SkipwatchOSVariation = true, SkipTodayExtensionVariation = true, SkipDeviceVariations = true, SkipiOS32Variation = true, Ignore = true, });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "linker", "ios", "dont link", "dont link.csproj"))) { Configurations = new string [] { "Debug", "Release" } });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "linker", "ios", "dont link", "dotnet", "iOS", "dont link.csproj"))) { Configurations = new string [] { "Debug", "Release" }, IsDotNetProject = true, SkipiOSVariation = false, SkiptvOSVariation = true, SkipwatchOSVariation = true, SkipTodayExtensionVariation = true, SkipDeviceVariations = true, SkipiOS32Variation = true, Ignore = true });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "linker", "ios", "dont link", "dotnet", "iOS", "dont link.csproj"))) { Configurations = new string [] { "Debug", "Release" }, IsDotNetProject = true, SkipiOSVariation = false, SkiptvOSVariation = true, SkipwatchOSVariation = true, SkipTodayExtensionVariation = true, SkipDeviceVariations = true, SkipiOS32Variation = true });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "linker", "ios", "link all", "link all.csproj"))) { Configurations = new string [] { "Debug", "Release" } });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "linker", "ios", "link sdk", "link sdk.csproj"))) { Configurations = new string [] { "Debug", "Release" } });

Expand Down

0 comments on commit c0e16ef

Please sign in to comment.