From 3ce540b918c2fdd4883363533d664fd66e7a4350 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 23 Jul 2020 14:23:03 +0200 Subject: [PATCH 1/3] [tests] Port link all to .NET --- .../ios/link all/dotnet/iOS/link all.csproj | 101 ++++++++++++++++++ tests/xharness/Harness.cs | 1 + 2 files changed, 102 insertions(+) create mode 100644 tests/linker/ios/link all/dotnet/iOS/link all.csproj diff --git a/tests/linker/ios/link all/dotnet/iOS/link all.csproj b/tests/linker/ios/link all/dotnet/iOS/link all.csproj new file mode 100644 index 000000000000..bdda8c051359 --- /dev/null +++ b/tests/linker/ios/link all/dotnet/iOS/link all.csproj @@ -0,0 +1,101 @@ + + + + net5.0 + ios-x64 + Exe + NET + latest + linkall + link all + Full + xamarinios10;$(AssetTargetFallback) + true + --optimize=all,-remove-dynamic-registrar,-force-rejected-types-removal + + + + + ../../support.dll + + + + + + + + + + + + + + + + + + + + + + + + + + Info.plist + + + + + + + + + + + + + + + OptimizeGeneratedCodeTest.cs + + + + + + + + + ReflectionTest.cs + + + + + TestRuntime.cs + + + CommonLinkAllTest.cs + + + CommonLinkAnyTest.cs + + + NetworkResources.cs + + + + + + + + + + + + + + + + + + diff --git a/tests/xharness/Harness.cs b/tests/xharness/Harness.cs index 8187719950d9..e234cf42e32f 100644 --- a/tests/xharness/Harness.cs +++ b/tests/xharness/Harness.cs @@ -395,6 +395,7 @@ void AutoConfigureIOS () 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 }); 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 all", "dotnet", "iOS", "link all.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", "link sdk", "link sdk.csproj"))) { Configurations = new string [] { "Debug", "Release" } }); IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "linker", "ios", "link sdk", "dotnet", "iOS", "link sdk.csproj"))) { Configurations = new string [] { "Debug" /*, "Release" */ }, IsDotNetProject = true, SkipiOSVariation = false, SkiptvOSVariation = true, SkipwatchOSVariation = true, SkipTodayExtensionVariation = true, SkipDeviceVariations = true, SkipiOS32Variation = true }); From 37acf24fc6b32b3caef3bf6bafec4637a898776d Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 23 Jul 2020 14:49:44 +0200 Subject: [PATCH 2/3] [tests] Exclude link all tests in .NET that reference OpenTK-1.0.dll OpenTK-1.0.dll isn't supported yet. --- tests/linker/ios/link all/LinkAllTest.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/linker/ios/link all/LinkAllTest.cs b/tests/linker/ios/link all/LinkAllTest.cs index ee1e30a072b9..40b8f0d38b59 100644 --- a/tests/linker/ios/link all/LinkAllTest.cs +++ b/tests/linker/ios/link all/LinkAllTest.cs @@ -424,6 +424,7 @@ public void AssemblyReferences_16213 () } #if !__WATCHOS__ +#if !NET // OpenTK-1.0.dll isn't supported in .NET yet [Test] public void OpenTk10_Preserved () { @@ -442,6 +443,7 @@ public void OpenTk10_Preserved () core = Helper.GetType ("OpenTK.Graphics.ES20.GL/Core, OpenTK-1.0", false); Assert.NotNull (core, "ES20/Core"); } +#endif // !NET #endif // !__WATCHOS__ [Test] From 128b1e72308e7bf17a9be2c0df1a6d974a68ce9b Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 23 Jul 2020 14:49:44 +0200 Subject: [PATCH 3/3] [tests] Exclude link all tests using API that isn't available anymore in .NET. --- tests/linker/ios/link all/LinkAllTest.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/linker/ios/link all/LinkAllTest.cs b/tests/linker/ios/link all/LinkAllTest.cs index 40b8f0d38b59..c887fc64d7da 100644 --- a/tests/linker/ios/link all/LinkAllTest.cs +++ b/tests/linker/ios/link all/LinkAllTest.cs @@ -151,6 +151,8 @@ public enum CertificateProblem : long { CertTRUSTEFAIL = 0x800B010B, } +#if !NET + // ICertificatePolicy has been removed from .NET 5+ class TestPolicy : ICertificatePolicy { const int RecoverableTrustFailure = 5; // SecTrustResult @@ -202,6 +204,7 @@ public void TrustUsingOldPolicy () ServicePointManager.CertificatePolicy = old; } } +#endif [Test] public void DetectPlatform ()