diff --git a/tests/bindings-framework-test/dotnet/iOS/bindings-framework-test.csproj b/tests/bindings-framework-test/dotnet/iOS/bindings-framework-test.csproj index 6bd13ee186cf..31f7752f30a8 100644 --- a/tests/bindings-framework-test/dotnet/iOS/bindings-framework-test.csproj +++ b/tests/bindings-framework-test/dotnet/iOS/bindings-framework-test.csproj @@ -10,4 +10,8 @@ + + + + diff --git a/tests/bindings-framework-test/dotnet/tvOS/bindings-framework-test.csproj b/tests/bindings-framework-test/dotnet/tvOS/bindings-framework-test.csproj index 5261f8f1c844..73f5542aee7a 100644 --- a/tests/bindings-framework-test/dotnet/tvOS/bindings-framework-test.csproj +++ b/tests/bindings-framework-test/dotnet/tvOS/bindings-framework-test.csproj @@ -10,4 +10,8 @@ + + + + diff --git a/tests/bindings-xcframework-test/dotnet/shared.csproj b/tests/bindings-xcframework-test/dotnet/shared.csproj index 0995fe7c55d0..c04de55618f9 100644 --- a/tests/bindings-xcframework-test/dotnet/shared.csproj +++ b/tests/bindings-xcframework-test/dotnet/shared.csproj @@ -33,8 +33,24 @@ libframework.h + + + + Framework + False + CoreLocation ModelIO + true + true + + + Framework + False + CoreLocation ModelIO + true + true + Framework False diff --git a/tests/dotnet/BundleStructure/shared.csproj b/tests/dotnet/BundleStructure/shared.csproj index 5d29912b327e..d36fd4d6ccf6 100644 --- a/tests/dotnet/BundleStructure/shared.csproj +++ b/tests/dotnet/BundleStructure/shared.csproj @@ -326,12 +326,12 @@ - - + diff --git a/tests/dotnet/LibraryReferencingBindingLibrary/shared.csproj b/tests/dotnet/LibraryReferencingBindingLibrary/shared.csproj index 9d005c624966..7c9bdbd3998e 100644 --- a/tests/dotnet/LibraryReferencingBindingLibrary/shared.csproj +++ b/tests/dotnet/LibraryReferencingBindingLibrary/shared.csproj @@ -6,6 +6,6 @@ - + diff --git a/tests/dotnet/UnitTests/BundleStructureTest.cs b/tests/dotnet/UnitTests/BundleStructureTest.cs index 7077f40da424..e878e6d1f57c 100644 --- a/tests/dotnet/UnitTests/BundleStructureTest.cs +++ b/tests/dotnet/UnitTests/BundleStructureTest.cs @@ -646,14 +646,15 @@ public void Build (ApplePlatform platform, string runtimeIdentifiers, CodeSignat expectedWarnings.AddRange (expectedWarnings); } - var zippedFrameworks = platform == ApplePlatform.MacCatalyst || platform == ApplePlatform.MacOSX; + var zippedFrameworks = true; //platform == ApplePlatform.MacCatalyst || platform == ApplePlatform.MacOSX; + var xcArch = GetXCFrameworkArchitectures (platform, runtimeIdentifiers); foreach (var rid in rids) { if (zippedFrameworks) { - expectedWarnings.Add ($"The framework {Path.Combine ("obj", configuration, tfm, rid, "bindings-framework-test.resources.zip", "XStaticObjectTest.framework")} is a framework of static libraries, and will not be copied to the app."); - expectedWarnings.Add ($"The framework {Path.Combine ("obj", configuration, tfm, rid, "bindings-framework-test.resources.zip", "XStaticArTest.framework")} is a framework of static libraries, and will not be copied to the app."); + expectedWarnings.Add ($"The framework {Path.Combine ("obj", configuration, tfm, rid, "bindings-framework-test.resources.zip", "XStaticObjectTest.xcframework", xcArch, "XStaticObjectTest.framework")} is a framework of static libraries, and will not be copied to the app."); + expectedWarnings.Add ($"The framework {Path.Combine ("obj", configuration, tfm, rid, "bindings-framework-test.resources.zip", "XStaticArTest.xcframework", xcArch, "XStaticArTest.framework")} is a framework of static libraries, and will not be copied to the app."); } else { - expectedWarnings.Add ($"The framework {Path.Combine (testsDirectory, "bindings-framework-test", "dotnet", platformString, "bin", configuration, tfm, "bindings-framework-test.resources", "XStaticObjectTest.framework")} is a framework of static libraries, and will not be copied to the app."); - expectedWarnings.Add ($"The framework {Path.Combine (testsDirectory, "bindings-framework-test", "dotnet", platformString, "bin", configuration, tfm, "bindings-framework-test.resources", "XStaticArTest.framework")} is a framework of static libraries, and will not be copied to the app."); + expectedWarnings.Add ($"The framework {Path.Combine (testsDirectory, "bindings-framework-test", "dotnet", platformString, "bin", configuration, tfm, "bindings-framework-test.resources", "XStaticObjectTest.xcframework", xcArch, "XStaticObjectTest.framework")} is a framework of static libraries, and will not be copied to the app."); + expectedWarnings.Add ($"The framework {Path.Combine (testsDirectory, "bindings-framework-test", "dotnet", platformString, "bin", configuration, tfm, "bindings-framework-test.resources", "XStaticArTest.xcframework", xcArch, "XStaticArTest.framework")} is a framework of static libraries, and will not be copied to the app."); } } @@ -706,6 +707,26 @@ public void Build (ApplePlatform platform, string runtimeIdentifiers, CodeSignat ExecuteWithMagicWordAndAssert (platform, runtimeIdentifiers, appExecutable); } + static string GetXCFrameworkArchitectures (ApplePlatform platform, string runtimeIdentifiers) + { + switch (platform) { + case ApplePlatform.iOS: + if (runtimeIdentifiers.Contains ("simulator")) + return "ios-arm64_x86_64-simulator"; + return "ios-arm64"; + case ApplePlatform.TVOS: + if (runtimeIdentifiers.Contains ("simulator")) + return "tvossimulator-arm64_x86_64"; + return "tvos-arm64"; + case ApplePlatform.MacCatalyst: + return "ios-arm64_x86_64-maccatalyst"; + case ApplePlatform.MacOSX: + return "macos-arm64_x86_64"; + default: + throw new NotImplementedException (platform.ToString ()); + } + } + public static string [] FilterWarnings (IEnumerable warnings, bool canonicalizePaths = false) { return warnings diff --git a/tests/dotnet/UnitTests/PackTest.cs b/tests/dotnet/UnitTests/PackTest.cs index ebc33c771f11..d6d02b4e69a7 100644 --- a/tests/dotnet/UnitTests/PackTest.cs +++ b/tests/dotnet/UnitTests/PackTest.cs @@ -34,14 +34,11 @@ public void BindingOldStyle (ApplePlatform platform) [Test] [Category ("Multiplatform")] - [TestCase (ApplePlatform.iOS, true)] - [TestCase (ApplePlatform.iOS, false)] [TestCase (ApplePlatform.MacCatalyst, true)] [TestCase (ApplePlatform.MacCatalyst, false)] - [TestCase (ApplePlatform.TVOS, true)] - [TestCase (ApplePlatform.TVOS, false)] [TestCase (ApplePlatform.MacOSX, true)] [TestCase (ApplePlatform.MacOSX, false)] + // The bindings-framework-test project doesn't work on iOS or tvOS. public void BindingFrameworksProject (ApplePlatform platform, bool noBindingEmbedding) { var project = "bindings-framework-test"; diff --git a/tests/dotnet/UnitTests/ProjectTest.cs b/tests/dotnet/UnitTests/ProjectTest.cs index b562a4f5732b..11bab23d11c7 100644 --- a/tests/dotnet/UnitTests/ProjectTest.cs +++ b/tests/dotnet/UnitTests/ProjectTest.cs @@ -820,21 +820,6 @@ public void LibraryReferencingBindingLibrary (ApplePlatform platform) Path.Combine ("BindingWithUncompressedResourceBundle.resources", "manifest"), }; - switch (platform) { - case ApplePlatform.iOS: - case ApplePlatform.TVOS: - bindingResourcePackages.Add (Path.Combine ("bindings-framework-test.resources", "XStaticArTest.framework", "XStaticArTest")); - bindingResourcePackages.Add (Path.Combine ("bindings-framework-test.resources", "XStaticObjectTest.framework", "XStaticObjectTest")); - bindingResourcePackages.Add (Path.Combine ("bindings-framework-test.resources", "XTest.framework", "Info.plist")); - bindingResourcePackages.Add (Path.Combine ("bindings-framework-test.resources", "XTest.framework", "XTest")); - bindingResourcePackages.Add (Path.Combine ("bindings-framework-test.resources", "manifest")); - break; - case ApplePlatform.MacCatalyst: - case ApplePlatform.MacOSX: - bindingResourcePackages.Add ("bindings-framework-test.resources.zip"); - break; - } - foreach (var brp in bindingResourcePackages) { var file = Path.Combine (bindir, brp); Assert.That (file, Does.Exist, "Existence"); @@ -846,10 +831,152 @@ public void LibraryReferencingBindingLibrary (ApplePlatform platform) // then we won't create an xcframework with symlinks, which means that building the binding project for iOS and tvOS // will produce a non-compressed binding package. Thus we assert that we either have a non-compressed or a compressed // package here. - var hasCompressedResources = File.Exists (Path.Combine (bindir, "BindingWithDefaultCompileInclude.resources.zip")); - var hasDirectoryResources = Directory.Exists (Path.Combine (bindir, "BindingWithDefaultCompileInclude.resources")); - if (!hasDirectoryResources && !hasCompressedResources) - Assert.Fail ($"Could not find either BindingWithDefaultCompileInclude.resources.zip or BindingWithDefaultCompileInclude.resources in {bindir}"); + foreach (var rx in new string [] { "BindingWithDefaultCompileInclude", "bindings-framework-test" }) { + var zip = Path.Combine (bindir, $"{rx}.resources.zip"); + var hasCompressedResources = File.Exists (zip); + var hasDirectoryResources = Directory.Exists (Path.Combine (bindir, $"{rx}.resources")); + if (!hasDirectoryResources && !hasCompressedResources) + Assert.Fail ($"Could not find either {rx}.resources.zip or {rx}.resources in {bindir}"); + + + if (hasDirectoryResources) + continue; + + var zipContents = ZipHelpers.List (zip).ToHashSet (); + var mustHaveContents = new List { + "manifest", + }; + var mayHaveContents = new List (); + List addHere; + + if (rx == "bindings-framework-test") { + foreach (var lib in new string [] { "XStaticArTest", "XStaticObjectTest" }) { + addHere = Configuration.include_watchos ? mustHaveContents : mayHaveContents; + addHere.AddRange (new string [] { + $"{lib}.xcframework/watchos-arm64_32_armv7k", + $"{lib}.xcframework/watchos-arm64_32_armv7k/{lib}.framework", + $"{lib}.xcframework/watchos-arm64_32_armv7k/{lib}.framework/{lib}", + $"{lib}.xcframework/watchos-x86_64-simulator", + $"{lib}.xcframework/watchos-x86_64-simulator/{lib}.framework", + $"{lib}.xcframework/watchos-x86_64-simulator/{lib}.framework/{lib}", + }); + + addHere = Configuration.include_tvos ? mustHaveContents : mayHaveContents; + addHere.AddRange (new string [] { + $"{lib}.xcframework/tvos-arm64", + $"{lib}.xcframework/tvos-arm64/{lib}.framework", + $"{lib}.xcframework/tvos-arm64/{lib}.framework/{lib}", + $"{lib}.xcframework/tvos-arm64_x86_64-simulator", + $"{lib}.xcframework/tvos-arm64_x86_64-simulator/{lib}.framework", + $"{lib}.xcframework/tvos-arm64_x86_64-simulator/{lib}.framework/{lib}", + }); + + addHere = Configuration.include_mac ? mustHaveContents : mayHaveContents; + addHere.AddRange (new string [] { + $"{lib}.xcframework/macos-arm64_x86_64", + $"{lib}.xcframework/macos-arm64_x86_64/{lib}.framework", + $"{lib}.xcframework/macos-arm64_x86_64/{lib}.framework/{lib}", + }); + + addHere = Configuration.include_maccatalyst ? mustHaveContents : mayHaveContents; + addHere.AddRange (new string [] { + $"{lib}.xcframework/ios-arm64_x86_64-maccatalyst", + $"{lib}.xcframework/ios-arm64_x86_64-maccatalyst/{lib}.framework", + $"{lib}.xcframework/ios-arm64_x86_64-maccatalyst/{lib}.framework/{lib}", + }); + + addHere = Configuration.include_ios ? mustHaveContents : mayHaveContents; + addHere.AddRange (new string [] { + $"{lib}.xcframework/ios-arm64_x86_64-simulator", + $"{lib}.xcframework/ios-arm64_x86_64-simulator/{lib}.framework", + $"{lib}.xcframework/ios-arm64_x86_64-simulator/{lib}.framework/{lib}", + $"{lib}.xcframework/ios-arm64", + $"{lib}.xcframework/ios-arm64/{lib}.framework", + $"{lib}.xcframework/ios-arm64/{lib}.framework/{lib}", + }); + + mustHaveContents.AddRange (new string [] { + $"{lib}.xcframework", + $"{lib}.xcframework/Info.plist", + }); + } + } + + mustHaveContents.AddRange (new string [] { + "XTest.xcframework", + "XTest.xcframework/Info.plist", + }); + + addHere = Configuration.include_ios ? mustHaveContents : mayHaveContents; + addHere.AddRange (new string [] { + "XTest.xcframework/ios-arm64", + "XTest.xcframework/ios-arm64/XTest.framework", + "XTest.xcframework/ios-arm64/XTest.framework/Info.plist", + "XTest.xcframework/ios-arm64/XTest.framework/XTest", + "XTest.xcframework/ios-arm64_x86_64-simulator", + "XTest.xcframework/ios-arm64_x86_64-simulator/XTest.framework", + "XTest.xcframework/ios-arm64_x86_64-simulator/XTest.framework/Info.plist", + "XTest.xcframework/ios-arm64_x86_64-simulator/XTest.framework/XTest", + }); + + addHere = Configuration.include_maccatalyst ? mustHaveContents : mayHaveContents; + addHere.AddRange (new string [] { + "XTest.xcframework/ios-arm64_x86_64-maccatalyst", + "XTest.xcframework/ios-arm64_x86_64-maccatalyst/XTest.framework", + "XTest.xcframework/ios-arm64_x86_64-maccatalyst/XTest.framework/Resources", + "XTest.xcframework/ios-arm64_x86_64-maccatalyst/XTest.framework/Versions", + "XTest.xcframework/ios-arm64_x86_64-maccatalyst/XTest.framework/Versions/A", + "XTest.xcframework/ios-arm64_x86_64-maccatalyst/XTest.framework/Versions/A/Resources", + "XTest.xcframework/ios-arm64_x86_64-maccatalyst/XTest.framework/Versions/A/Resources/Info.plist", + "XTest.xcframework/ios-arm64_x86_64-maccatalyst/XTest.framework/Versions/A/XTest", + "XTest.xcframework/ios-arm64_x86_64-maccatalyst/XTest.framework/Versions/Current", + "XTest.xcframework/ios-arm64_x86_64-maccatalyst/XTest.framework/XTest", + }); + + addHere = Configuration.include_mac ? mustHaveContents : mayHaveContents; + addHere.AddRange (new string [] { + "XTest.xcframework/macos-arm64_x86_64", + "XTest.xcframework/macos-arm64_x86_64/XTest.framework", + "XTest.xcframework/macos-arm64_x86_64/XTest.framework/Resources", + "XTest.xcframework/macos-arm64_x86_64/XTest.framework/Versions", + "XTest.xcframework/macos-arm64_x86_64/XTest.framework/Versions/A", + "XTest.xcframework/macos-arm64_x86_64/XTest.framework/Versions/A/Resources", + "XTest.xcframework/macos-arm64_x86_64/XTest.framework/Versions/A/Resources/Info.plist", + "XTest.xcframework/macos-arm64_x86_64/XTest.framework/Versions/A/XTest", + "XTest.xcframework/macos-arm64_x86_64/XTest.framework/Versions/Current", + "XTest.xcframework/macos-arm64_x86_64/XTest.framework/XTest", + }); + + addHere = Configuration.include_tvos ? mustHaveContents : mayHaveContents; + addHere.AddRange (new string [] { + "XTest.xcframework/tvos-arm64", + "XTest.xcframework/tvos-arm64/XTest.framework", + "XTest.xcframework/tvos-arm64/XTest.framework/Info.plist", + "XTest.xcframework/tvos-arm64/XTest.framework/XTest", + "XTest.xcframework/tvos-arm64_x86_64-simulator", + "XTest.xcframework/tvos-arm64_x86_64-simulator/XTest.framework", + "XTest.xcframework/tvos-arm64_x86_64-simulator/XTest.framework/Info.plist", + "XTest.xcframework/tvos-arm64_x86_64-simulator/XTest.framework/XTest", + }); + + addHere = Configuration.include_watchos ? mustHaveContents : mayHaveContents; + addHere.AddRange (new string [] { + "XTest.xcframework/watchos-arm64_32_armv7k", + "XTest.xcframework/watchos-arm64_32_armv7k/XTest.framework", + "XTest.xcframework/watchos-arm64_32_armv7k/XTest.framework/Info.plist", + "XTest.xcframework/watchos-arm64_32_armv7k/XTest.framework/XTest", + "XTest.xcframework/watchos-x86_64-simulator", + "XTest.xcframework/watchos-x86_64-simulator/XTest.framework", + "XTest.xcframework/watchos-x86_64-simulator/XTest.framework/Info.plist", + "XTest.xcframework/watchos-x86_64-simulator/XTest.framework/XTest", + }); + + var missing = mustHaveContents.ToHashSet ().Except (zipContents); + Assert.That (missing, Is.Empty, "No missing files"); + + var extra = zipContents.Except (mustHaveContents).Except (mayHaveContents); + Assert.That (extra, Is.Empty, "No extra files"); + } } void AssertAppContents (ApplePlatform platform, string app_directory) diff --git a/tests/dotnet/UnitTests/WindowsTest.cs b/tests/dotnet/UnitTests/WindowsTest.cs index c0195c7d9024..878deff51dda 100644 --- a/tests/dotnet/UnitTests/WindowsTest.cs +++ b/tests/dotnet/UnitTests/WindowsTest.cs @@ -118,7 +118,7 @@ public void BundleStructureWithHotRestart (ApplePlatform platform, string runtim .OrderBy (v => v) .ToList (); - // The reference to the bindings-framework-test project is skipped on Windows, because we can't build binding projects unless we're connected to a Mac. + // The reference to the bindings-xcframework-test project is skipped on Windows, because we can't build binding projects unless we're connected to a Mac. AddOrAssert (merged, "bindings-framework-test.dll"); AddOrAssert (merged, "bindings-framework-test.pdb"); AddOrAssert (merged, Path.Combine ("Frameworks", "XTest.framework")); // XTest.framework comes from bindings-framework-test.csproj @@ -222,11 +222,11 @@ public void BundleStructureWithRemoteMac (ApplePlatform platform, string runtime var zippedFrameworks = platform == ApplePlatform.MacCatalyst || platform == ApplePlatform.MacOSX; foreach (var rid in rids) { if (zippedFrameworks) { - expectedWarnings.Add ($"The framework {Path.Combine ("obj", configuration, tfm, rid, "bindings-framework-test.resources.zip", "XStaticObjectTest.framework")} is a framework of static libraries, and will not be copied to the app."); - expectedWarnings.Add ($"The framework {Path.Combine ("obj", configuration, tfm, rid, "bindings-framework-test.resources.zip", "XStaticArTest.framework")} is a framework of static libraries, and will not be copied to the app."); + expectedWarnings.Add ($"The framework {Path.Combine ("obj", configuration, tfm, rid, "bindings-xcframework-test.resources.zip", "XStaticObjectTest.framework")} is a framework of static libraries, and will not be copied to the app."); + expectedWarnings.Add ($"The framework {Path.Combine ("obj", configuration, tfm, rid, "bindings-xcframework-test.resources.zip", "XStaticArTest.framework")} is a framework of static libraries, and will not be copied to the app."); } else { - expectedWarnings.Add ($"The framework {Path.Combine (testsDirectory, "bindings-framework-test", "dotnet", platformString, "bin", configuration, tfm, "bindings-framework-test.resources", "XStaticObjectTest.framework")} is a framework of static libraries, and will not be copied to the app."); - expectedWarnings.Add ($"The framework {Path.Combine (testsDirectory, "bindings-framework-test", "dotnet", platformString, "bin", configuration, tfm, "bindings-framework-test.resources", "XStaticArTest.framework")} is a framework of static libraries, and will not be copied to the app."); + expectedWarnings.Add ($"The framework {Path.Combine (testsDirectory, "bindings-xcframework-test", "dotnet", platformString, "bin", configuration, tfm, "bindings-framework-test.resources", "XStaticObjectTest.xcframework", runtimeIdentifiers, "XStaticObjectTest.framework")} is a framework of static libraries, and will not be copied to the app."); + expectedWarnings.Add ($"The framework {Path.Combine (testsDirectory, "bindings-xcframework-test", "dotnet", platformString, "bin", configuration, tfm, "bindings-framework-test.resources", "XStaticArTest.xcframework", runtimeIdentifiers, "XStaticArTest.framework")} is a framework of static libraries, and will not be copied to the app."); } } diff --git a/tests/test-libraries/Makefile b/tests/test-libraries/Makefile index cb753d8088a6..6a3794a654f4 100644 --- a/tests/test-libraries/Makefile +++ b/tests/test-libraries/Makefile @@ -84,6 +84,12 @@ $(1)_XTEST_TARGETS += \ .libs/$(1)/XTest.framework$($(2)_BINARY_INFIX)/XTest \ .libs/$(1)/XTest.framework$($(2)_INFO_PLIST_INFIX)/Info.plist \ +$(1)_XSTATICARTEST_TARGETS += \ + .libs/$(1)/XStaticArTest.framework/XStaticArTest \ + +$(1)_XSTATICOBJECTTEST_TARGETS += \ + .libs/$(1)/XStaticObjectTest.framework/XStaticObjectTest \ + $(1)_SWIFTTEST_TARGETS += \ .libs/$(1)/SwiftTest.framework$($(2)_BINARY_INFIX)/SwiftTest \ .libs/$(1)/SwiftTest.framework$($(2)_INFO_PLIST_INFIX)/Info.plist \ @@ -103,6 +109,8 @@ $(2)_TARGETS = \ $$(foreach arch,$(3),.libs/$(1)/libtest-ar.$$(arch).a) \ .libs/$(1)/XTest.framework \ .libs/$(1)/XTest.framework.stamp \ + .libs/$(1)/XStaticArTest.framework.stamp \ + .libs/$(1)/XStaticObjectTest.framework.stamp \ .libs/$(1)/SwiftTest.framework \ .libs/$(1)/SwiftTest.framework.stamp \ @@ -111,6 +119,12 @@ all-local:: $$($(2)_TARGETS) $(GENERATED_FILES) .libs/$(1)/XTest.framework.stamp: $$($(1)_XTEST_TARGETS) $$(Q) touch $$@ +.libs/$(1)/XStaticArTest.framework.stamp: $$($(1)_XSTATICARTEST_TARGETS) + $$(Q) touch $$@ + +.libs/$(1)/XStaticObjectTest.framework.stamp: $$($(1)_XSTATICOBJECTTEST_TARGETS) + $$(Q) touch $$@ + .libs/$(1)/SwiftTest.framework.stamp: $$($(1)_SWIFTTEST_TARGETS) $$(Q) touch $$@ @@ -414,6 +428,26 @@ XTEST_XCTARGETS += \ all-local:: .libs/XTest.xcframework +XSTATICARTEST_XCFRAMEWORKS += $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/XStaticArTest.framework) +XSTATICARTEST_XCTARGETS += \ + $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/XStaticArTest.framework.stamp) \ + +.libs/XStaticArTest.xcframework: $(XSTATICARTEST_XCTARGETS) Makefile + $(Q) rm -rf $@ + $(Q_GEN) $(XCODE_DEVELOPER_ROOT)/usr/bin/xcodebuild -quiet -create-xcframework $(foreach fw,$(XSTATICARTEST_XCFRAMEWORKS),-framework $(fw)) -output $@ + +all-local:: .libs/XStaticArTest.xcframework + +XSTATICOBJECTTEST_XCFRAMEWORKS += $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/XStaticObjectTest.framework) +XSTATICOBJECTTEST_XCTARGETS += \ + $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/XStaticObjectTest.framework.stamp) \ + +.libs/XStaticObjectTest.xcframework: $(XSTATICOBJECTTEST_XCTARGETS) Makefile + $(Q) rm -rf $@ + $(Q_GEN) $(XCODE_DEVELOPER_ROOT)/usr/bin/xcodebuild -quiet -create-xcframework $(foreach fw,$(XSTATICOBJECTTEST_XCFRAMEWORKS),-framework $(fw)) -output $@ + +all-local:: .libs/XStaticObjectTest.xcframework + LIBTEST_XCFRAMEWORKS += $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/libtest.a) .libs/libtest.xcframework: $(LIBTEST_XCFRAMEWORKS) Makefile diff --git a/tests/xharness/Harness.cs b/tests/xharness/Harness.cs index 5f4a3d0beb8a..5fa8a1cb4479 100644 --- a/tests/xharness/Harness.cs +++ b/tests/xharness/Harness.cs @@ -386,6 +386,17 @@ void AutoConfigureDotNet () new { Label = TestLabel.Xcframework, ProjectPath = "xcframework-test", IsFSharp = false, Configurations = noConfigurations, }, }; + var iOSSkip = new TestLabel [] { + TestLabel.Framework, + }; + var tvOSSkip = new TestLabel [] { + TestLabel.Framework, + }; + var macOSSkip = new TestLabel [] { + }; + var macCatalystSkip = new TestLabel [] { + }; + // If .NET is not enabled, then ignore, otherwise leave undecided for other code to determine. bool? dotnetIgnored = ENABLE_DOTNET ? null : (bool?) true; foreach (var projectInfo in projects) { @@ -393,52 +404,60 @@ void AutoConfigureDotNet () var projectName = Path.GetFileName (projectPath); var projExtension = projectInfo.IsFSharp ? ".fsproj" : ".csproj"; - IOSTestProjects.Add (new iOSTestProject (projectInfo.Label, Path.GetFullPath (Path.Combine (RootDirectory, projectPath, "dotnet", "iOS", projectName + projExtension))) { - Name = projectName, - IsDotNetProject = true, - SkipiOSVariation = false, - SkiptvOSVariation = true, - SkipwatchOSVariation = true, - SkipTodayExtensionVariation = true, - SkipDeviceVariations = false, - TestPlatform = TestPlatform.iOS_Unified, - Ignore = dotnetIgnored, - Configurations = projectInfo.Configurations, - }); + if (!iOSSkip.Contains (projectInfo.Label)) { + IOSTestProjects.Add (new iOSTestProject (projectInfo.Label, Path.GetFullPath (Path.Combine (RootDirectory, projectPath, "dotnet", "iOS", projectName + projExtension))) { + Name = projectName, + IsDotNetProject = true, + SkipiOSVariation = false, + SkiptvOSVariation = true, + SkipwatchOSVariation = true, + SkipTodayExtensionVariation = true, + SkipDeviceVariations = false, + TestPlatform = TestPlatform.iOS_Unified, + Ignore = dotnetIgnored, + Configurations = projectInfo.Configurations, + }); + } - IOSTestProjects.Add (new iOSTestProject (projectInfo.Label, Path.GetFullPath (Path.Combine (RootDirectory, projectPath, "dotnet", "tvOS", projectName + projExtension))) { - Name = projectName, - IsDotNetProject = true, - SkipiOSVariation = true, - SkiptvOSVariation = true, - SkipwatchOSVariation = true, - SkipTodayExtensionVariation = true, - SkipDeviceVariations = false, - GenerateVariations = false, - TestPlatform = TestPlatform.tvOS, - Ignore = dotnetIgnored, - Configurations = projectInfo.Configurations, - }); + if (!tvOSSkip.Contains (projectInfo.Label)) { + IOSTestProjects.Add (new iOSTestProject (projectInfo.Label, Path.GetFullPath (Path.Combine (RootDirectory, projectPath, "dotnet", "tvOS", projectName + projExtension))) { + Name = projectName, + IsDotNetProject = true, + SkipiOSVariation = true, + SkiptvOSVariation = true, + SkipwatchOSVariation = true, + SkipTodayExtensionVariation = true, + SkipDeviceVariations = false, + GenerateVariations = false, + TestPlatform = TestPlatform.tvOS, + Ignore = dotnetIgnored, + Configurations = projectInfo.Configurations, + }); + } - MacTestProjects.Add (new MacTestProject (projectInfo.Label, Path.GetFullPath (Path.Combine (RootDirectory, projectPath, "dotnet", "macOS", projectName + projExtension))) { - Name = projectName, - IsDotNetProject = true, - TargetFrameworkFlavors = MacFlavors.DotNet, - Platform = "AnyCPU", - Ignore = dotnetIgnored, - TestPlatform = TestPlatform.Mac, - Configurations = projectInfo.Configurations, - }); + if (!macOSSkip.Contains (projectInfo.Label)) { + MacTestProjects.Add (new MacTestProject (projectInfo.Label, Path.GetFullPath (Path.Combine (RootDirectory, projectPath, "dotnet", "macOS", projectName + projExtension))) { + Name = projectName, + IsDotNetProject = true, + TargetFrameworkFlavors = MacFlavors.DotNet, + Platform = "AnyCPU", + Ignore = dotnetIgnored, + TestPlatform = TestPlatform.Mac, + Configurations = projectInfo.Configurations, + }); + } - MacTestProjects.Add (new MacTestProject (projectInfo.Label, Path.GetFullPath (Path.Combine (RootDirectory, projectPath, "dotnet", "MacCatalyst", projectName + projExtension))) { - Name = projectName, - IsDotNetProject = true, - TargetFrameworkFlavors = MacFlavors.MacCatalyst, - Platform = "AnyCPU", - Ignore = dotnetIgnored, - TestPlatform = TestPlatform.MacCatalyst, - Configurations = projectInfo.Configurations, - }); + if (!macCatalystSkip.Contains (projectInfo.Label)) { + MacTestProjects.Add (new MacTestProject (projectInfo.Label, Path.GetFullPath (Path.Combine (RootDirectory, projectPath, "dotnet", "MacCatalyst", projectName + projExtension))) { + Name = projectName, + IsDotNetProject = true, + TargetFrameworkFlavors = MacFlavors.MacCatalyst, + Platform = "AnyCPU", + Ignore = dotnetIgnored, + TestPlatform = TestPlatform.MacCatalyst, + Configurations = projectInfo.Configurations, + }); + } } }