From e2471851c0bd9edc83b6dd1c6acb39461a0b430d Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 4 Aug 2023 15:27:08 +0200 Subject: [PATCH 1/2] [xcode14.3] [tests] If listing included platforms for .NET, don't include anything if .NET isn't enabled. --- tests/common/Configuration.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/common/Configuration.cs b/tests/common/Configuration.cs index d1aa7ed56bc9..be779b8b928a 100644 --- a/tests/common/Configuration.cs +++ b/tests/common/Configuration.cs @@ -916,6 +916,9 @@ public static void AssertiOS32BitAvailable () public static IEnumerable GetIncludedPlatforms (bool dotnet) { + if (dotnet && !include_dotnet) + yield break; + if (include_ios) yield return ApplePlatform.iOS; if (include_tvos) From 39373e001e69f05e8c1ef9eecd4393665914053c Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 7 Aug 2023 15:55:16 +0200 Subject: [PATCH 2/2] Do a few more .NET checks. --- tests/cecil-tests/BlittablePInvokes.cs | 6 ++++++ tests/common/Configuration.cs | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/tests/cecil-tests/BlittablePInvokes.cs b/tests/cecil-tests/BlittablePInvokes.cs index 26a51a66d9a9..51b2175e1e76 100644 --- a/tests/cecil-tests/BlittablePInvokes.cs +++ b/tests/cecil-tests/BlittablePInvokes.cs @@ -179,6 +179,8 @@ public BlitAndReason (bool isBlittable, string reason) [Test] public void CheckForNonBlittablePInvokes () { + Configuration.IgnoreIfNotDotNet (); + var failures = new Dictionary (); var pinvokes = new List<(AssemblyDefinition Assembly, MethodDefinition Method)> (); @@ -345,6 +347,8 @@ public void CheckForBlockLiterals () { var failures = new Dictionary (); + Configuration.IgnoreIfNotDotNet (); + foreach (var info in Helper.NetPlatformImplementationAssemblyDefinitions) { var assembly = info.Assembly; foreach (var type in assembly.EnumerateTypes ()) { @@ -396,6 +400,8 @@ public void CheckForMonoPInvokeCallback () { var failures = new Dictionary (); + Configuration.IgnoreIfNotDotNet (); + foreach (var info in Helper.NetPlatformImplementationAssemblyDefinitions) { var assembly = info.Assembly; foreach (var type in assembly.EnumerateTypes ()) { diff --git a/tests/common/Configuration.cs b/tests/common/Configuration.cs index be779b8b928a..fdc9c2078c7b 100644 --- a/tests/common/Configuration.cs +++ b/tests/common/Configuration.cs @@ -805,6 +805,8 @@ public static string GetBaseLibrary (TargetFramework targetFramework) public static IList GetRuntimeIdentifiers (ApplePlatform platform) { + if (!include_dotnet) + return Array.Empty (); return GetVariableArray ($"DOTNET_{platform.AsString ().ToUpper ()}_RUNTIME_IDENTIFIERS"); } @@ -1127,6 +1129,13 @@ public static void IgnoreIfAnyIgnoredPlatforms (bool dotnet = true) Assert.Ignore ($"This test requires all platforms to be included, but the following platforms aren't included: {string.Join (", ", notIncluded.Select (v => v.AsString ()))}"); } + public static void IgnoreIfNotDotNet () + { + if (include_dotnet) + return; + Assert.Ignore ($"This test requires .NET to be enabled."); + } + public static string GetTestLibraryDirectory (ApplePlatform platform, bool? simulator = null) { string dir;