From 1b5cb356230f7d9c84ad89da3eeffa3fc84497b2 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 13 Aug 2021 09:30:45 +0200 Subject: [PATCH] [tests] Add .NET versions of xcframeworks-test and bindings-xcframework-test. (#12420) --- .../dotnet/MacCatalyst/Makefile | 1 + .../bindings-xcframework-test.csproj | 13 +++++ .../dotnet/iOS/Makefile | 1 + .../iOS/bindings-xcframework-test.csproj | 13 +++++ .../dotnet/macOS/Makefile | 1 + .../macOS/bindings-xcframework-test.csproj | 13 +++++ .../dotnet/shared.csproj | 51 +++++++++++++++++++ .../dotnet/shared.mk | 22 ++++++++ .../dotnet/tvOS/Makefile | 1 + .../tvOS/bindings-xcframework-test.csproj | 13 +++++ .../dotnet/MacCatalyst/Info.plist | 14 +++++ .../dotnet/MacCatalyst/Makefile | 1 + .../MacCatalyst/xcframework-test.csproj | 13 +++++ tests/xcframework-test/dotnet/Makefile | 8 +++ tests/xcframework-test/dotnet/iOS/Info.plist | 14 +++++ tests/xcframework-test/dotnet/iOS/Makefile | 2 + .../dotnet/iOS/xcframework-test.csproj | 13 +++++ .../xcframework-test/dotnet/macOS/Info.plist | 14 +++++ tests/xcframework-test/dotnet/macOS/Makefile | 1 + .../dotnet/macOS/xcframework-test.csproj | 13 +++++ tests/xcframework-test/dotnet/shared.csproj | 43 ++++++++++++++++ tests/xcframework-test/dotnet/shared.mk | 29 +++++++++++ tests/xcframework-test/dotnet/tvOS/Info.plist | 14 +++++ tests/xcframework-test/dotnet/tvOS/Makefile | 1 + .../dotnet/tvOS/xcframework-test.csproj | 13 +++++ tests/xharness/Harness.cs | 24 +++++++++ 26 files changed, 346 insertions(+) create mode 100644 tests/bindings-xcframework-test/dotnet/MacCatalyst/Makefile create mode 100644 tests/bindings-xcframework-test/dotnet/MacCatalyst/bindings-xcframework-test.csproj create mode 100644 tests/bindings-xcframework-test/dotnet/iOS/Makefile create mode 100644 tests/bindings-xcframework-test/dotnet/iOS/bindings-xcframework-test.csproj create mode 100644 tests/bindings-xcframework-test/dotnet/macOS/Makefile create mode 100644 tests/bindings-xcframework-test/dotnet/macOS/bindings-xcframework-test.csproj create mode 100644 tests/bindings-xcframework-test/dotnet/shared.csproj create mode 100644 tests/bindings-xcframework-test/dotnet/shared.mk create mode 100644 tests/bindings-xcframework-test/dotnet/tvOS/Makefile create mode 100644 tests/bindings-xcframework-test/dotnet/tvOS/bindings-xcframework-test.csproj create mode 100644 tests/xcframework-test/dotnet/MacCatalyst/Info.plist create mode 100644 tests/xcframework-test/dotnet/MacCatalyst/Makefile create mode 100644 tests/xcframework-test/dotnet/MacCatalyst/xcframework-test.csproj create mode 100644 tests/xcframework-test/dotnet/Makefile create mode 100644 tests/xcframework-test/dotnet/iOS/Info.plist create mode 100644 tests/xcframework-test/dotnet/iOS/Makefile create mode 100644 tests/xcframework-test/dotnet/iOS/xcframework-test.csproj create mode 100644 tests/xcframework-test/dotnet/macOS/Info.plist create mode 100644 tests/xcframework-test/dotnet/macOS/Makefile create mode 100644 tests/xcframework-test/dotnet/macOS/xcframework-test.csproj create mode 100644 tests/xcframework-test/dotnet/shared.csproj create mode 100644 tests/xcframework-test/dotnet/shared.mk create mode 100644 tests/xcframework-test/dotnet/tvOS/Info.plist create mode 100644 tests/xcframework-test/dotnet/tvOS/Makefile create mode 100644 tests/xcframework-test/dotnet/tvOS/xcframework-test.csproj diff --git a/tests/bindings-xcframework-test/dotnet/MacCatalyst/Makefile b/tests/bindings-xcframework-test/dotnet/MacCatalyst/Makefile new file mode 100644 index 0000000000..110d078f45 --- /dev/null +++ b/tests/bindings-xcframework-test/dotnet/MacCatalyst/Makefile @@ -0,0 +1 @@ +include ../shared.mk diff --git a/tests/bindings-xcframework-test/dotnet/MacCatalyst/bindings-xcframework-test.csproj b/tests/bindings-xcframework-test/dotnet/MacCatalyst/bindings-xcframework-test.csproj new file mode 100644 index 0000000000..f356662163 --- /dev/null +++ b/tests/bindings-xcframework-test/dotnet/MacCatalyst/bindings-xcframework-test.csproj @@ -0,0 +1,13 @@ + + + + net6.0-maccatalyst + + + + + + + + + diff --git a/tests/bindings-xcframework-test/dotnet/iOS/Makefile b/tests/bindings-xcframework-test/dotnet/iOS/Makefile new file mode 100644 index 0000000000..110d078f45 --- /dev/null +++ b/tests/bindings-xcframework-test/dotnet/iOS/Makefile @@ -0,0 +1 @@ +include ../shared.mk diff --git a/tests/bindings-xcframework-test/dotnet/iOS/bindings-xcframework-test.csproj b/tests/bindings-xcframework-test/dotnet/iOS/bindings-xcframework-test.csproj new file mode 100644 index 0000000000..07d0bfb4fb --- /dev/null +++ b/tests/bindings-xcframework-test/dotnet/iOS/bindings-xcframework-test.csproj @@ -0,0 +1,13 @@ + + + + net6.0-ios + + + + + + + + + diff --git a/tests/bindings-xcframework-test/dotnet/macOS/Makefile b/tests/bindings-xcframework-test/dotnet/macOS/Makefile new file mode 100644 index 0000000000..110d078f45 --- /dev/null +++ b/tests/bindings-xcframework-test/dotnet/macOS/Makefile @@ -0,0 +1 @@ +include ../shared.mk diff --git a/tests/bindings-xcframework-test/dotnet/macOS/bindings-xcframework-test.csproj b/tests/bindings-xcframework-test/dotnet/macOS/bindings-xcframework-test.csproj new file mode 100644 index 0000000000..f1a8342a15 --- /dev/null +++ b/tests/bindings-xcframework-test/dotnet/macOS/bindings-xcframework-test.csproj @@ -0,0 +1,13 @@ + + + + net6.0-macos + + + + + + + + + diff --git a/tests/bindings-xcframework-test/dotnet/shared.csproj b/tests/bindings-xcframework-test/dotnet/shared.csproj new file mode 100644 index 0000000000..582765de57 --- /dev/null +++ b/tests/bindings-xcframework-test/dotnet/shared.csproj @@ -0,0 +1,51 @@ + + + + Library + true + true + $(DefineConstants);NET + $(DefineConstants);NET;XCFRAMEWORK;FRAMEWORK_TEST + latest + bindingstest + True + ..\..\..\..\product.snk + True + bindings-framework-test + + $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\..\..\..')) + $(RootTestsDirectory)\test-libraries + $(RootTestsDirectory)\bindings-framework-test + + + true + + $(DefineConstants);DEBUG + + + + + + + + + + libframework.m + + + libframework.h + + + + + + Framework + False + CoreLocation ModelIO + + + + + + + diff --git a/tests/bindings-xcframework-test/dotnet/shared.mk b/tests/bindings-xcframework-test/dotnet/shared.mk new file mode 100644 index 0000000000..97d95a62af --- /dev/null +++ b/tests/bindings-xcframework-test/dotnet/shared.mk @@ -0,0 +1,22 @@ +TOP=../../../.. +include $(TOP)/Make.config +include $(TOP)/mk/colors.mk + +prepare: + $(Q) $(MAKE) -C $(TOP)/tests/dotnet copy-dotnet-config + +reload: + $(Q) rm -Rf $(TOP)/tests/dotnet/packages + $(Q) $(MAKE) -C $(TOP) -j8 all + $(Q) $(MAKE) -C $(TOP) -j8 install + $(Q) git clean -xfdq + +reload-and-build: + $(Q) $(MAKE) reload + $(Q) $(MAKE) build + +build: prepare + $(Q) $(DOTNET6) build /bl *.csproj $(MSBUILD_VERBOSITY) $(BUILD_ARGUMENTS) + +diag: prepare + $(Q) $(DOTNET6) build /v:diag msbuild.binlog diff --git a/tests/bindings-xcframework-test/dotnet/tvOS/Makefile b/tests/bindings-xcframework-test/dotnet/tvOS/Makefile new file mode 100644 index 0000000000..110d078f45 --- /dev/null +++ b/tests/bindings-xcframework-test/dotnet/tvOS/Makefile @@ -0,0 +1 @@ +include ../shared.mk diff --git a/tests/bindings-xcframework-test/dotnet/tvOS/bindings-xcframework-test.csproj b/tests/bindings-xcframework-test/dotnet/tvOS/bindings-xcframework-test.csproj new file mode 100644 index 0000000000..c34d0b9628 --- /dev/null +++ b/tests/bindings-xcframework-test/dotnet/tvOS/bindings-xcframework-test.csproj @@ -0,0 +1,13 @@ + + + + net6.0-tvos + + + + + + + + + diff --git a/tests/xcframework-test/dotnet/MacCatalyst/Info.plist b/tests/xcframework-test/dotnet/MacCatalyst/Info.plist new file mode 100644 index 0000000000..6af0db6e21 --- /dev/null +++ b/tests/xcframework-test/dotnet/MacCatalyst/Info.plist @@ -0,0 +1,14 @@ + + + + + CFBundleDisplayName + xcframework-test + CFBundleIdentifier + com.xamarin.xcframework-test + CFBundleName + xcframework-test + LSMinimumSystemVersion + 10.15 + + diff --git a/tests/xcframework-test/dotnet/MacCatalyst/Makefile b/tests/xcframework-test/dotnet/MacCatalyst/Makefile new file mode 100644 index 0000000000..110d078f45 --- /dev/null +++ b/tests/xcframework-test/dotnet/MacCatalyst/Makefile @@ -0,0 +1 @@ +include ../shared.mk diff --git a/tests/xcframework-test/dotnet/MacCatalyst/xcframework-test.csproj b/tests/xcframework-test/dotnet/MacCatalyst/xcframework-test.csproj new file mode 100644 index 0000000000..f356662163 --- /dev/null +++ b/tests/xcframework-test/dotnet/MacCatalyst/xcframework-test.csproj @@ -0,0 +1,13 @@ + + + + net6.0-maccatalyst + + + + + + + + + diff --git a/tests/xcframework-test/dotnet/Makefile b/tests/xcframework-test/dotnet/Makefile new file mode 100644 index 0000000000..c07acf79f1 --- /dev/null +++ b/tests/xcframework-test/dotnet/Makefile @@ -0,0 +1,8 @@ +TOP=../../.. +include $(TOP)/Make.config + +build-all: + for platform in $(DOTNET_PLATFORMS); do \ + echo "Building in $$platform"; \ + $(MAKE) -C "$$platform" build; \ + done diff --git a/tests/xcframework-test/dotnet/iOS/Info.plist b/tests/xcframework-test/dotnet/iOS/Info.plist new file mode 100644 index 0000000000..f2bfebf8a0 --- /dev/null +++ b/tests/xcframework-test/dotnet/iOS/Info.plist @@ -0,0 +1,14 @@ + + + + + CFBundleDisplayName + xcframework-test + CFBundleIdentifier + com.xamarin.xcframework-test + CFBundleName + xcframework-test + MinimumOSVersion + 10.0 + + diff --git a/tests/xcframework-test/dotnet/iOS/Makefile b/tests/xcframework-test/dotnet/iOS/Makefile new file mode 100644 index 0000000000..75e1f69ed6 --- /dev/null +++ b/tests/xcframework-test/dotnet/iOS/Makefile @@ -0,0 +1,2 @@ +include ../shared.mk + diff --git a/tests/xcframework-test/dotnet/iOS/xcframework-test.csproj b/tests/xcframework-test/dotnet/iOS/xcframework-test.csproj new file mode 100644 index 0000000000..07d0bfb4fb --- /dev/null +++ b/tests/xcframework-test/dotnet/iOS/xcframework-test.csproj @@ -0,0 +1,13 @@ + + + + net6.0-ios + + + + + + + + + diff --git a/tests/xcframework-test/dotnet/macOS/Info.plist b/tests/xcframework-test/dotnet/macOS/Info.plist new file mode 100644 index 0000000000..322f397759 --- /dev/null +++ b/tests/xcframework-test/dotnet/macOS/Info.plist @@ -0,0 +1,14 @@ + + + + + CFBundleDisplayName + xcframework-test + CFBundleIdentifier + com.xamarin.xcframework-test + CFBundleName + xcframework-test + LSMinimumSystemVersion + 10.14 + + diff --git a/tests/xcframework-test/dotnet/macOS/Makefile b/tests/xcframework-test/dotnet/macOS/Makefile new file mode 100644 index 0000000000..110d078f45 --- /dev/null +++ b/tests/xcframework-test/dotnet/macOS/Makefile @@ -0,0 +1 @@ +include ../shared.mk diff --git a/tests/xcframework-test/dotnet/macOS/xcframework-test.csproj b/tests/xcframework-test/dotnet/macOS/xcframework-test.csproj new file mode 100644 index 0000000000..f1a8342a15 --- /dev/null +++ b/tests/xcframework-test/dotnet/macOS/xcframework-test.csproj @@ -0,0 +1,13 @@ + + + + net6.0-macos + + + + + + + + + diff --git a/tests/xcframework-test/dotnet/shared.csproj b/tests/xcframework-test/dotnet/shared.csproj new file mode 100644 index 0000000000..56e301713b --- /dev/null +++ b/tests/xcframework-test/dotnet/shared.csproj @@ -0,0 +1,43 @@ + + + + Exe + $(DefineConstants);NET + latest + xcframeworktest + + $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\..\..\..')) + $(RootTestsDirectory)\test-libraries + $(RootTestsDirectory)\xcframework-test + + + true + + $(DefineConstants);DEBUG + + + + + + + + + + + + + + + + Resources\Default-568h%402x.png + + + + + + + + + + + diff --git a/tests/xcframework-test/dotnet/shared.mk b/tests/xcframework-test/dotnet/shared.mk new file mode 100644 index 0000000000..bc7ccd2596 --- /dev/null +++ b/tests/xcframework-test/dotnet/shared.mk @@ -0,0 +1,29 @@ +TOP=../../../.. +include $(TOP)/Make.config +include $(TOP)/mk/colors.mk + +prepare: + $(Q) $(MAKE) -C $(TOP)/tests/dotnet copy-dotnet-config + +reload: + $(Q) rm -Rf $(TOP)/tests/dotnet/packages + $(Q) $(MAKE) -C $(TOP) -j8 all + $(Q) $(MAKE) -C $(TOP) -j8 install + $(Q) git clean -xfdq + +reload-and-build: + $(Q) $(MAKE) reload + $(Q) $(MAKE) build + +reload-and-run: + $(Q) $(MAKE) reload + $(Q) $(MAKE) run + +build: prepare + $(Q) $(DOTNET6) build /bl *.csproj $(MSBUILD_VERBOSITY) $(BUILD_ARGUMENTS) + +run: prepare + $(Q) $(DOTNET6) build /bl *.csproj $(MSBUILD_VERBOSITY) $(BUILD_ARGUMENTS) -t:Run + +diag: prepare + $(Q) $(DOTNET6) build /v:diag msbuild.binlog diff --git a/tests/xcframework-test/dotnet/tvOS/Info.plist b/tests/xcframework-test/dotnet/tvOS/Info.plist new file mode 100644 index 0000000000..86dfecf2a2 --- /dev/null +++ b/tests/xcframework-test/dotnet/tvOS/Info.plist @@ -0,0 +1,14 @@ + + + + + CFBundleDisplayName + xcframework-test + CFBundleIdentifier + com.xamarin.xcframework-test + CFBundleName + xcframework-test + MinimumOSVersion + 10.0 + + diff --git a/tests/xcframework-test/dotnet/tvOS/Makefile b/tests/xcframework-test/dotnet/tvOS/Makefile new file mode 100644 index 0000000000..110d078f45 --- /dev/null +++ b/tests/xcframework-test/dotnet/tvOS/Makefile @@ -0,0 +1 @@ +include ../shared.mk diff --git a/tests/xcframework-test/dotnet/tvOS/xcframework-test.csproj b/tests/xcframework-test/dotnet/tvOS/xcframework-test.csproj new file mode 100644 index 0000000000..c34d0b9628 --- /dev/null +++ b/tests/xcframework-test/dotnet/tvOS/xcframework-test.csproj @@ -0,0 +1,13 @@ + + + + net6.0-tvos + + + + + + + + + diff --git a/tests/xharness/Harness.cs b/tests/xharness/Harness.cs index f927694942..1118281d52 100644 --- a/tests/xharness/Harness.cs +++ b/tests/xharness/Harness.cs @@ -395,6 +395,26 @@ namespace Xharness { TestPlatform = TestPlatform.MacCatalyst, }); + // xcframework-test + + MacTestProjects.Add (new MacTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "xcframework-test", "dotnet", "macOS", "xcframework-test.csproj"))) { + Name = "xcframework-test", + IsDotNetProject = true, + TargetFrameworkFlavors = MacFlavors.DotNet, + Platform = "AnyCPU", + Ignore = !ENABLE_DOTNET, + TestPlatform = TestPlatform.Mac, + }); + + MacTestProjects.Add (new MacTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "xcframework-test", "dotnet", "MacCatalyst", "xcframework-test.csproj"))) { + Name = "xcframework-test", + IsDotNetProject = true, + TargetFrameworkFlavors = MacFlavors.MacCatalyst, + Platform = "AnyCPU", + Ignore = !ENABLE_DOTNET, + TestPlatform = TestPlatform.MacCatalyst, + }); + var monoImportTestFactory = new BCLTestImportTargetFactory (this); MacTestProjects.AddRange (monoImportTestFactory.GetMacBclTargets ()); @@ -528,6 +548,10 @@ namespace Xharness { IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "framework-test", "dotnet", "iOS", "framework-test.csproj"))) { Name = "framework-test", IsDotNetProject = true, SkipiOSVariation = false, SkiptvOSVariation = true, SkipwatchOSVariation = true, SkipTodayExtensionVariation = true, SkipDeviceVariations = false, SkipiOS32Variation = true, SkipMacCatalystVariation = true, TestPlatform = TestPlatform.iOS_Unified, }); IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "framework-test", "dotnet", "tvOS", "framework-test.csproj"))) { Name = "framework-test", IsDotNetProject = true, SkipiOSVariation = true, SkiptvOSVariation = true, SkipwatchOSVariation = true, SkipTodayExtensionVariation = true, SkipDeviceVariations = false, SkipiOS32Variation = true, GenerateVariations = false, TestPlatform = TestPlatform.tvOS, }); + // xcframework-test + IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "xcframework-test", "dotnet", "iOS", "xcframework-test.csproj"))) { Name = "xcframework-test", IsDotNetProject = true, SkipiOSVariation = false, SkiptvOSVariation = true, SkipwatchOSVariation = true, SkipTodayExtensionVariation = true, SkipDeviceVariations = false, SkipiOS32Variation = true, SkipMacCatalystVariation = true, TestPlatform = TestPlatform.iOS_Unified, }); + IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (RootDirectory, "xcframework-test", "dotnet", "tvOS", "xcframework-test.csproj"))) { Name = "xcframework-test", IsDotNetProject = true, SkipiOSVariation = true, SkiptvOSVariation = true, SkipwatchOSVariation = true, SkipTodayExtensionVariation = true, SkipDeviceVariations = false, SkipiOS32Variation = true, GenerateVariations = false, TestPlatform = TestPlatform.tvOS, }); + foreach (var flavor in new MonoNativeFlavor [] { MonoNativeFlavor.Compat, MonoNativeFlavor.Unified }) { var monoNativeInfo = new MonoNativeInfo (DevicePlatform.iOS, flavor, RootDirectory, Log); var iosTestProject = new iOSTestProject (monoNativeInfo.ProjectPath) {