diff --git a/tests/Makefile b/tests/Makefile index 9f9a6d770f63..6b57f8b34d4f 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -189,11 +189,9 @@ logdev: build-test-libraries: @$(MAKE) -C $(TOP)/tests/test-libraries -.stamp-xharness-configure: $(XHARNESS_EXECUTABLE) - $(Q_GEN) $(DOTNET) $< $(XHARNESS_VERBOSITY) --configure --autoconf --rootdir $(CURDIR) - $(Q) touch $@ +xharness: $(XHARNESS_EXECUTABLE) -all-local:: .stamp-xharness-configure +all-local:: xharness $(TOP)/tools/common/SdkVersions.cs: $(TOP)/tools/common/SdkVersions.in.cs @$(MAKE) -C $(TOP)/tools/mtouch ../common/SdkVersions.cs @@ -348,13 +346,5 @@ package-test-libraries.zip: $(Q) $(MAKE) all -C test-libraries/custom-type-assembly build-assembly $(Q_GEN) rm -f "$@" "$@.tmp" $(Q_GEN) cd $(TOP) && zip -9r --symlinks $(abspath $@).tmp ./tests/test-libraries - $(Q_GEN) cd $(TOP) && find tests -regex '.*/generated-projects/.*[c|f]sproj' -exec zip -9r --symlinks $(abspath $@).tmp {} + - $(Q_GEN) cd $(TOP) && find tests -regex '.*/generated-projects/.*sln' -exec zip -9r --symlinks $(abspath $@).tmp {} + $(Q_GEN) cd $(TOP) && find tests -regex 'tests/test-libraries/custom-type-assembly/.libs/.*dll' -exec zip -9r --symlinks $(abspath $@).tmp {} + - $(Q_GEN) cd $(TOP) && git ls-files -o -- 'tests/*/Info-*plist' | zip -9r --symlinks $(abspath $@).tmp -@ -ifdef INCLUDE_XAMARIN_LEGACY -ifdef INCLUDE_IOS - $(Q_GEN) cd $(TOP) && zip -9r --symlinks $(abspath $@).tmp ./tools/mtouch/simlauncher*-sgen* -endif -endif $(Q) mv "$@".tmp "$@" diff --git a/tests/package-mac-tests.sh b/tests/package-mac-tests.sh index c096193d9224..f4d3ba4c335a 100755 --- a/tests/package-mac-tests.sh +++ b/tests/package-mac-tests.sh @@ -23,7 +23,6 @@ export MD_APPLE_SDK_ROOT="$(dirname "$(dirname "$XCODE_DEVELOPER_ROOT")")" export RootTestsDirectory="$(pwd)" make -make .stamp-xharness-configure TEST_SUITE_DEPENDENCIES+=(bindings-test) TEST_SUITE_DEPENDENCIES+=(EmbeddedResources) diff --git a/tests/xharness/AppRunner.cs b/tests/xharness/AppRunner.cs index 0efd5c0c68a1..bcc9d631abe6 100644 --- a/tests/xharness/AppRunner.cs +++ b/tests/xharness/AppRunner.cs @@ -42,9 +42,7 @@ public class AppRunner { readonly string buildConfiguration; string deviceName; - string companionDeviceName; ISimulatorDevice simulator; - ISimulatorDevice companionSimulator; bool ensureCleanSimulatorState = true; bool EnsureCleanSimulatorState { @@ -80,9 +78,7 @@ public AppRunner (IMlaunchProcessManager processManager, string projectFilePath, string buildConfiguration, ISimulatorDevice simulator = null, - ISimulatorDevice companionSimulator = null, string deviceName = null, - string companionDeviceName = null, bool ensureCleanSimulatorState = false, double timeoutMultiplier = 1, string variation = null, @@ -102,10 +98,8 @@ public AppRunner (IMlaunchProcessManager processManager, this.Logs = logs ?? throw new ArgumentNullException (nameof (logs)); this.timeoutMultiplier = timeoutMultiplier; this.deviceName = deviceName; - this.companionDeviceName = companionDeviceName; this.ensureCleanSimulatorState = ensureCleanSimulatorState; this.simulator = simulator; - this.companionSimulator = companionSimulator; this.buildTask = buildTask; this.target = target; this.variation = variation; @@ -129,7 +123,7 @@ async Task FindSimulatorAsync () var sims = simulatorsLoaderFactory.CreateLoader (); await sims.LoadDevices (Logs.Create ($"simulator-list-{Harness.Helpers.Timestamp}.log", "Simulator list"), false, false); - (simulator, companionSimulator) = await sims.FindSimulators (target.GetTargetOs (false), MainLog); + (simulator, _) = await sims.FindSimulators (target.GetTargetOs (false), MainLog); return simulator is not null; } @@ -149,9 +143,6 @@ async Task FindDevice () var device = await devs.FindDevice (runMode, MainLog, false, false); deviceName = device?.Name; - - if (runMode == RunMode.WatchOS) - companionDeviceName = (await devs.FindCompanionDevice (MainLog, device)).Name; } public async Task InstallAsync (CancellationToken cancellation_token) @@ -172,14 +163,10 @@ public async Task InstallAsync (CancellationToken cancel args.Add (new VerbosityArgument ()); args.Add (new InstallAppOnDeviceArgument (AppInformation.AppPath)); - args.Add (new DeviceNameArgument (companionDeviceName ?? deviceName)); - - if (runMode == RunMode.WatchOS) { - args.Add (new DeviceArgument ("ios,watchos")); - } + args.Add (new DeviceNameArgument (deviceName)); var totalSize = Directory.GetFiles (AppInformation.AppPath, "*", SearchOption.AllDirectories).Select ((v) => new FileInfo (v).Length).Sum (); - MainLog.WriteLine ($"Installing '{AppInformation.AppPath}' to '{companionDeviceName ?? deviceName}'. Size: {totalSize} bytes = {totalSize / 1024.0 / 1024.0:N2} MB"); + MainLog.WriteLine ($"Installing '{AppInformation.AppPath}' to '{deviceName}'. Size: {totalSize} bytes = {totalSize / 1024.0 / 1024.0:N2} MB"); return await processManager.ExecuteCommandAsync (args, MainLog, TimeSpan.FromHours (1), cancellationToken: cancellation_token); } @@ -197,7 +184,7 @@ public async Task UninstallAsync () args.Add (new VerbosityArgument ()); args.Add (new UninstallAppFromDeviceArgument (AppInformation.BundleIdentifier)); - args.Add (new DeviceNameArgument (companionDeviceName ?? deviceName)); + args.Add (new DeviceNameArgument (deviceName)); return await processManager.ExecuteCommandAsync (args, MainLog, TimeSpan.FromMinutes (1)); } @@ -302,16 +289,7 @@ public async Task RunAsync () args.AddRange (harness.EnvironmentVariables.Select (kvp => new SetEnvVariableArgument (kvp.Key, kvp.Value))); if (IsExtension) { - switch (AppInformation.Extension) { - case Extension.TodayExtension: - args.Add (isSimulator - ? (MlaunchArgument) new LaunchSimulatorExtensionArgument (AppInformation.LaunchAppPath, AppInformation.BundleIdentifier) - : new LaunchDeviceExtensionArgument (AppInformation.LaunchAppPath, AppInformation.BundleIdentifier)); - break; - case Extension.WatchKit2: - default: - throw new NotImplementedException (); - } + throw new NotImplementedException ("Extensions aren't supported in xharness at the moment (no .NET extension tests yet)"); } else { args.Add (isSimulator ? (MlaunchArgument) new LaunchSimulatorAppArgument (AppInformation.LaunchAppPath) @@ -329,14 +307,12 @@ public async Task RunAsync () args.Add (new SetStdoutArgument (stdout_log)); args.Add (new SetStderrArgument (stderr_log)); - var simulators = new [] { simulator, companionSimulator }.Where (s => s is not null); + var simulators = new [] { simulator }; var systemLogs = new List (); foreach (var sim in simulators) { // Upload the system log MainLog.WriteLine ("System log for the '{1}' simulator is: {0}", sim.SystemLog, sim.Name); - bool isCompanion = sim != simulator; - - var logDescription = isCompanion ? LogType.CompanionSystemLog.ToString () : LogType.SystemLog.ToString (); + var logDescription = LogType.SystemLog.ToString (); var log = captureLogFactory.Create ( Path.Combine (Logs.Directory, sim.Name + ".log"), sim.SystemLog, @@ -393,12 +369,7 @@ public async Task RunAsync () } else { MainLog.WriteLine ("*** Executing {0}/{1} on device '{2}' ***", AppInformation.AppName, runMode, deviceName); - if (runMode == RunMode.WatchOS) { - args.Add (new AttachNativeDebuggerArgument ()); // this prevents the watch from backgrounding the app. - } else { - args.Add (new WaitForExitArgument ()); - } - + args.Add (new WaitForExitArgument ()); args.Add (new DeviceNameArgument (deviceName)); var deviceSystemLog = Logs.Create ($"device-{deviceName}-{Harness.Helpers.Timestamp}.log", "Device log"); diff --git a/tests/xharness/Harness.cs b/tests/xharness/Harness.cs index ebf19afe642e..4706bf66aa50 100644 --- a/tests/xharness/Harness.cs +++ b/tests/xharness/Harness.cs @@ -15,14 +15,12 @@ using Microsoft.DotNet.XHarness.iOS.Shared.Listeners; using Microsoft.DotNet.XHarness.iOS.Shared.Logging; using Microsoft.DotNet.XHarness.iOS.Shared.Utilities; -using Xharness.Targets; using Xamarin.Utils; namespace Xharness { public enum HarnessAction { None, - Configure, Run, Install, Uninstall, @@ -48,8 +46,6 @@ public class HarnessConfiguration { public double TimeoutInMinutes { get; set; } = 15; public bool UseSystemXamarinIOSMac { get; set; } public int Verbosity { get; set; } - public string WatchOSAppTemplate { get; set; } - public string WatchOSContainerTemplate { get; set; } public XmlResultJargon XmlJargon { get; set; } = XmlResultJargon.NUnitV3; // This is the maccore/tests directory. @@ -157,9 +153,6 @@ bool TryGetMlaunchDotnetPath (out string value) { value = null; - if (!ENABLE_DOTNET) - return false; - ApplePlatform platform; if (INCLUDE_IOS) { platform = ApplePlatform.iOS; @@ -185,9 +178,6 @@ string MlaunchPath { if (TryGetMlaunchDotnetPath (out var mlaunch)) return mlaunch; - if (INCLUDE_XAMARIN_LEGACY && (INCLUDE_IOS || INCLUDE_TVOS)) - return Path.Combine (IOS_DESTDIR, "Library", "Frameworks", "Xamarin.iOS.framework", "Versions", "Current", "bin", "mlaunch"); - return $"Not building any mobile platform, so can't provide a location to mlaunch."; } } @@ -210,27 +200,14 @@ string GetVariable (string variable, string @default = null) public List IOSTestProjects { get; } public List MacTestProjects { get; } = new List (); - // Configure readonly bool useSystemXamarinIOSMac; // if the system XI/XM should be used, or the locally build XI/XM. readonly bool autoConf; - public string WatchOSContainerTemplate { get; private set; } - public string WatchOSAppTemplate { get; private set; } - public string WatchOSExtensionTemplate { get; private set; } - public string TodayContainerTemplate { get; private set; } - public string TodayExtensionTemplate { get; private set; } - public string MONO_PATH { get; } // Use same name as in Makefiles, so that a grep finds it. - public string TVOS_MONO_PATH { get; } // Use same name as in Makefiles, so that a grep finds it. public bool INCLUDE_IOS { get; } public bool INCLUDE_TVOS { get; } public bool INCLUDE_MAC { get; } public bool INCLUDE_MACCATALYST { get; } public string JENKINS_RESULTS_DIRECTORY { get; } // Use same name as in Makefiles, so that a grep finds it. - public string MAC_DESTDIR { get; } - public string IOS_DESTDIR { get; } - public bool ENABLE_DOTNET { get; } - public bool INCLUDE_XAMARIN_LEGACY { get; } - public string SYSTEM_MONO { get; set; } public string DOTNET_DIR { get; set; } public string DOTNET_TFM { get; set; } @@ -278,8 +255,6 @@ public Harness (IResultParser resultParser, HarnessAction action, HarnessConfigu if (!string.IsNullOrEmpty (Environment.GetEnvironmentVariable ("TESTS_USE_SYSTEM"))) useSystemXamarinIOSMac = true; Verbosity = configuration.Verbosity; - WatchOSAppTemplate = configuration.WatchOSAppTemplate; - WatchOSContainerTemplate = configuration.WatchOSContainerTemplate; XmlJargon = configuration.XmlJargon; if (configuration.Labels is not null) @@ -293,19 +268,12 @@ public Harness (IResultParser resultParser, HarnessAction action, HarnessConfigu config = ParseConfigFiles (); var src_root = Path.GetDirectoryName (Path.GetFullPath (RootDirectory)); - MONO_PATH = Path.GetFullPath (Path.Combine (src_root, "external", "mono")); - TVOS_MONO_PATH = MONO_PATH; INCLUDE_IOS = IsVariableSet (nameof (INCLUDE_IOS)); INCLUDE_TVOS = IsVariableSet (nameof (INCLUDE_TVOS)); JENKINS_RESULTS_DIRECTORY = GetVariable (nameof (JENKINS_RESULTS_DIRECTORY)); INCLUDE_MAC = IsVariableSet (nameof (INCLUDE_MAC)); INCLUDE_MACCATALYST = IsVariableSet (nameof (INCLUDE_MACCATALYST)); - MAC_DESTDIR = GetVariable (nameof (MAC_DESTDIR)); - IOS_DESTDIR = GetVariable (nameof (IOS_DESTDIR)); - ENABLE_DOTNET = IsVariableSet (nameof (ENABLE_DOTNET)); - SYSTEM_MONO = GetVariable (nameof (SYSTEM_MONO)); DOTNET_DIR = GetVariable (nameof (DOTNET_DIR)); - INCLUDE_XAMARIN_LEGACY = IsVariableSet (nameof (INCLUDE_XAMARIN_LEGACY)); DOTNET_TFM = GetVariable (nameof (DOTNET_TFM)); if (string.IsNullOrEmpty (SdkRoot)) @@ -326,9 +294,6 @@ public bool GetIncludeSystemPermissionTests (TestPlatform platform, bool device) switch (platform) { case TestPlatform.iOS: case TestPlatform.Mac: - case TestPlatform.Mac_Full: - case TestPlatform.Mac_Modern: - case TestPlatform.Mac_System: // On macOS we can't edit the TCC database easily // (it requires adding the mac has to be using MDM: https://carlashley.com/2018/09/28/tcc-round-up/) // So by default ignore any tests that would pop up permission dialogs in CI. @@ -391,7 +356,6 @@ void AutoConfigureDotNet () }; // 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) { var projectPath = projectInfo.ProjectPath; var projectName = Path.GetFileName (projectPath); @@ -403,11 +367,8 @@ void AutoConfigureDotNet () IsDotNetProject = true, SkipiOSVariation = false, SkiptvOSVariation = true, - SkipwatchOSVariation = true, - SkipTodayExtensionVariation = true, SkipDeviceVariations = false, - TestPlatform = TestPlatform.iOS_Unified, - Ignore = dotnetIgnored, + TestPlatform = TestPlatform.iOS, Configurations = projectInfo.Configurations, }); } @@ -418,12 +379,9 @@ void AutoConfigureDotNet () IsDotNetProject = true, SkipiOSVariation = true, SkiptvOSVariation = true, - SkipwatchOSVariation = true, - SkipTodayExtensionVariation = true, SkipDeviceVariations = false, GenerateVariations = false, TestPlatform = TestPlatform.tvOS, - Ignore = dotnetIgnored, Configurations = projectInfo.Configurations, }); } @@ -433,8 +391,6 @@ void AutoConfigureDotNet () Name = projectName, IsDotNetProject = true, TargetFrameworkFlavors = MacFlavors.DotNet, - Platform = "AnyCPU", - Ignore = dotnetIgnored, TestPlatform = TestPlatform.Mac, Configurations = projectInfo.Configurations, }); @@ -445,8 +401,6 @@ void AutoConfigureDotNet () Name = projectName, IsDotNetProject = true, TargetFrameworkFlavors = MacFlavors.MacCatalyst, - Platform = "AnyCPU", - Ignore = dotnetIgnored, TestPlatform = TestPlatform.MacCatalyst, Configurations = projectInfo.Configurations, }); @@ -454,152 +408,6 @@ void AutoConfigureDotNet () } } - int AutoConfigureMac (bool generate_projects) - { - int rv = 0; - - var test_suites = new [] { - new { Label = TestLabel.Linker, Directory = "linker/mac/dont link", ProjectFile = "dont link-mac", Name = "dont link", Flavors = MacFlavors.Modern | MacFlavors.Full | MacFlavors.System }, - }; - foreach (var p in test_suites) { - MacTestProjects.Add (new MacTestProject (p.Label, Path.GetFullPath (Path.Combine (RootDirectory, p.Directory, p.ProjectFile + ".csproj"))) { - Name = p.Name, - TargetFrameworkFlavors = p.Flavors, - }); - } - - MacTestProjects.Add (new MacTestProject (TestLabel.Introspection, Path.GetFullPath (Path.Combine (RootDirectory, "introspection", "Mac", "introspection-mac.csproj")), targetFrameworkFlavor: MacFlavors.Modern) { Name = "introspection" }); - MacTestProjects.Add (new MacTestProject (TestLabel.Framework, Path.GetFullPath (Path.Combine (RootDirectory, "framework-test", "macOS", "framework-test-mac.csproj")), targetFrameworkFlavor: MacFlavors.Modern) { Name = "framework-test" }); - MacTestProjects.Add (new MacTestProject (TestLabel.Xcframework, Path.GetFullPath (Path.Combine (RootDirectory, "xcframework-test", "macOS", "xcframework-test-mac.csproj")), targetFrameworkFlavor: MacFlavors.Modern) { Name = "xcframework-test" }); - - var hard_coded_test_suites = new [] { - new { Label = TestLabel.Mmp, Directory = "mmptest", ProjectFile = "mmptest", Name = "mmptest", IsNUnit = true, Configurations = (string[]) null, Platform = "x86", Flavors = MacFlavors.Console, }, - new { Label = TestLabel.Xammac, Directory = "xammac_tests", ProjectFile = "xammac_tests", Name = "xammac tests", IsNUnit = false, Configurations = new string [] { "Debug", "Release" }, Platform = "AnyCPU", Flavors = MacFlavors.Modern, }, - new { Label = TestLabel.Linker, Directory = "linker/mac/link all", ProjectFile = "link all-mac", Name = "link all", IsNUnit = false, Configurations = new string [] { "Debug", "Release" }, Platform = "x86", Flavors = MacFlavors.Modern, }, - new { Label = TestLabel.Linker, Directory = "linker/mac/link sdk", ProjectFile = "link sdk-mac", Name = "link sdk", IsNUnit = false, Configurations = new string [] { "Debug", "Release" }, Platform = "x86", Flavors = MacFlavors.Modern, }, - }; - foreach (var p in hard_coded_test_suites) { - MacTestProjects.Add (new MacTestProject (p.Label, Path.GetFullPath (Path.Combine (RootDirectory, p.Directory, p.ProjectFile + ".csproj")), targetFrameworkFlavor: p.Flavors) { - Name = p.Name, - IsNUnitProject = p.IsNUnit, - SolutionPath = Path.GetFullPath (Path.Combine (RootDirectory, "tests-mac.sln")), - Configurations = p.Configurations, - Platform = p.Platform, - Ignore = !INCLUDE_XAMARIN_LEGACY, - }); - } - - - // All test projects should be either Modern projects or NUnit/console executables at this point. - // If we need to generate Full/System variations, we do that here. - var unified_targets = new List (); - - Action configureTarget = (MacTarget target, string file, bool isNUnitProject, bool skip_generation) => { - target.TemplateProjectPath = file; - target.Harness = this; - target.IsNUnitProject = isNUnitProject; - if (!generate_projects || skip_generation) - target.ShouldSkipProjectGeneration = true; - target.Execute (); - }; - - foreach (var proj in MacTestProjects) { - var target = new MacTarget (MacFlavors.Modern); - configureTarget (target, proj.Path, proj.IsNUnitProject, true); - unified_targets.Add (target); - } - - foreach (var proj in MacTestProjects.Where ((v) => v.GenerateVariations).ToArray ()) { - var file = proj.Path; - if (!File.Exists (file)) { - Console.WriteLine ($"Can't find the project file {file}."); - rv = 1; - continue; - } - - // Generate variations if requested - if (proj.GenerateFull) { - var target = new MacTarget (MacFlavors.Full); - configureTarget (target, file, proj.IsNUnitProject, false); - unified_targets.Add (target); - - var cloned_project = (MacTestProject) proj.Clone (); - cloned_project.TargetFrameworkFlavors = MacFlavors.Full; - cloned_project.Path = target.ProjectPath; - MacTestProjects.Add (cloned_project); - } - - if (proj.GenerateSystem) { - var target = new MacTarget (MacFlavors.System); - configureTarget (target, file, proj.IsNUnitProject, false); - unified_targets.Add (target); - - var cloned_project = (MacTestProject) proj.Clone (); - cloned_project.TargetFrameworkFlavors = MacFlavors.System; - cloned_project.Path = target.ProjectPath; - MacTestProjects.Add (cloned_project); - } - - // We're done generating now - // Re-use the existing TestProject instance instead of creating a new one. - proj.TargetFrameworkFlavors = MacFlavors.Modern; // the default/template flavor is 'Modern' - } - - return rv; - } - - void AutoConfigureIOS () - { - var library_projects = new string [] { "BundledResources", "EmbeddedResources", "bindings-test2" }; - var fsharp_test_suites = new string [] { "fsharp" }; - var fsharp_library_projects = new string [] { "fsharplibrary" }; - - IOSTestProjects.Add (new iOSTestProject (TestLabel.Monotouch, Path.GetFullPath (Path.Combine (RootDirectory, "monotouch-test", "monotouch-test.csproj"))) { - Name = "monotouch-test", - }); - - foreach (var p in fsharp_test_suites) - IOSTestProjects.Add (new iOSTestProject (TestLabel.Fsharp, Path.GetFullPath (Path.Combine (RootDirectory, p + "/" + p + ".fsproj"))) { Name = p }); - foreach (var p in library_projects) - IOSTestProjects.Add (new iOSTestProject (TestLabel.LibraryProjects, Path.GetFullPath (Path.Combine (RootDirectory, p + "/" + p + ".csproj")), false) { Name = p }); - foreach (var p in fsharp_library_projects) - IOSTestProjects.Add (new iOSTestProject (TestLabel.Fsharp, Path.GetFullPath (Path.Combine (RootDirectory, p + "/" + p + ".fsproj")), false) { Name = p }); - - IOSTestProjects.Add (new iOSTestProject (TestLabel.BindingFramework, Path.GetFullPath (Path.Combine (RootDirectory, "bindings-framework-test", "iOS", "bindings-framework-test.csproj")), false) { - Name = "bindings-framework-test", - }); - IOSTestProjects.Add (new iOSTestProject (TestLabel.BindingsXcframework, Path.GetFullPath (Path.Combine (RootDirectory, "bindings-xcframework-test", "iOS", "bindings-xcframework-test.csproj")), false) { - Name = "bindings-xcframework-test", - }); - IOSTestProjects.Add (new iOSTestProject (TestLabel.Framework, Path.GetFullPath (Path.Combine (RootDirectory, "framework-test", "iOS", "framework-test-ios.csproj"))) { - Name = "framework-test", - }); - IOSTestProjects.Add (new iOSTestProject (TestLabel.Xcframework, Path.GetFullPath (Path.Combine (RootDirectory, "xcframework-test", "iOS", "xcframework-test-ios.csproj"))) { - Name = "xcframework-test", - }); - - IOSTestProjects.Add (new iOSTestProject (TestLabel.Binding, Path.GetFullPath (Path.Combine (RootDirectory, "bindings-test", "iOS", "bindings-test.csproj")), false) { Name = "bindings-test" }); - - IOSTestProjects.Add (new iOSTestProject (TestLabel.InterdependentBindingProjects, Path.GetFullPath (Path.Combine (RootDirectory, "interdependent-binding-projects", "interdependent-binding-projects.csproj"))) { Name = "interdependent-binding-projects" }); - IOSTestProjects.Add (new iOSTestProject (TestLabel.Linker, Path.GetFullPath (Path.Combine (RootDirectory, "linker", "ios", "dont link", "dont link.csproj"))) { - Configurations = new string [] { "Debug", "Release" }, - }); - IOSTestProjects.Add (new iOSTestProject (TestLabel.Linker, Path.GetFullPath (Path.Combine (RootDirectory, "linker", "ios", "link all", "link all.csproj"))) { - Configurations = new string [] { "Debug", "Release" }, - }); - IOSTestProjects.Add (new iOSTestProject (TestLabel.Linker, Path.GetFullPath (Path.Combine (RootDirectory, "linker", "ios", "link sdk", "link sdk.csproj"))) { - Configurations = new string [] { "Debug", "Release" }, - }); - - // add all the tests that are using the precompiled mono assemblies - WatchOSContainerTemplate = Path.GetFullPath (Path.Combine (RootDirectory, "templates/WatchContainer")); - WatchOSAppTemplate = Path.GetFullPath (Path.Combine (RootDirectory, "templates/WatchApp")); - WatchOSExtensionTemplate = Path.GetFullPath (Path.Combine (RootDirectory, "templates/WatchExtension")); - - TodayContainerTemplate = Path.GetFullPath (Path.Combine (RootDirectory, "templates", "TodayContainer")); - TodayExtensionTemplate = Path.GetFullPath (Path.Combine (RootDirectory, "templates", "TodayExtension")); - } - // Dictionary make_config = new Dictionary (); IEnumerable FindConfigFiles (string name) { @@ -646,92 +454,6 @@ void ParseConfigFile (string file, Dictionary configuration) } } - int Configure () - { - var rv = AutoConfigureMac (true); - if (rv != 0) - return rv; - return ConfigureIOS (); - } - - // At startup we: - // * Load a list of well-known test projects IOSTestProjects/MacTestProjects. This happens in AutoConfigureIOS/AutoConfigureMac. - // Example projects: - // * introspection - // * dont link, link all, link sdk - // * Each of these test projects can used to generate other platform variations (tvOS, watchOS, macOS full, etc), - // if the the TestProject.GenerateVariations property is true. - - int ConfigureIOS () - { - var rv = 0; - var unified_targets = new List (); - var tvos_targets = new List (); - var watchos_targets = new List (); - var today_targets = new List (); - - if (autoConf) - AutoConfigureIOS (); - - foreach (var proj in IOSTestProjects.Where ((v) => v.GenerateVariations)) { - var file = proj.Path; - - if (!File.Exists (file)) { - Console.WriteLine ($"Can't find the project file {file}."); - rv = 1; - continue; - } - - if (!proj.SkipwatchOSVariation) { - var watchos = new WatchOSTarget () { - TemplateProjectPath = file, - Harness = this, - TestProject = proj, - }; - watchos.Execute (); - watchos_targets.Add (watchos); - } - - if (!proj.SkiptvOSVariation) { - var tvos = new TVOSTarget () { - TemplateProjectPath = file, - Harness = this, - TestProject = proj, - }; - tvos.Execute (); - tvos_targets.Add (tvos); - } - - if (!proj.SkipiOSVariation) { - var unified = new UnifiedTarget () { - TemplateProjectPath = file, - Harness = this, - TestProject = proj, - ShouldSkipProjectGeneration = proj.IsDotNetProject, - }; - unified.Execute (); - unified_targets.Add (unified); - - if (!proj.SkipTodayExtensionVariation) { - var today = new TodayExtensionTarget { - TemplateProjectPath = file, - Harness = this, - TestProject = proj, - ShouldSkipProjectGeneration = proj.IsDotNetProject, - }; - today.Execute (); - today_targets.Add (today); - } - } - } - - SolutionGenerator.CreateSolution (this, watchos_targets, "watchos", DevicePlatform.watchOS); - SolutionGenerator.CreateSolution (this, tvos_targets, "tvos", DevicePlatform.tvOS); - SolutionGenerator.CreateSolution (this, today_targets, "today", DevicePlatform.iOS); - - return rv; - } - int Install () { HarnessLog ??= GetAdHocLog (); @@ -823,8 +545,6 @@ public string VSDropsUri { public int Execute () { switch (Action) { - case HarnessAction.Configure: - return Configure (); case HarnessAction.Run: return Run (); case HarnessAction.Install: @@ -842,8 +562,6 @@ int Jenkins () { if (autoConf) { AutoConfigureDotNet (); - AutoConfigureIOS (); - AutoConfigureMac (false); } var jenkins = new Jenkins.Jenkins (this, processManager, ResultParser, TunnelBore); @@ -869,16 +587,6 @@ public void Save (StringWriter doc, string path) } } - bool? disable_watchos_on_wrench; - - public bool DisableWatchOSOnWrench { - get { - if (!disable_watchos_on_wrench.HasValue) - disable_watchos_on_wrench = !string.IsNullOrEmpty (Environment.GetEnvironmentVariable ("DISABLE_WATCH_ON_WRENCH")); - return disable_watchos_on_wrench.Value; - } - } - AppRunner CreateAppRunner (TestProject project) { var rv = new AppRunner (processManager, diff --git a/tests/xharness/IAppBundleInformationParserExtensions.cs b/tests/xharness/IAppBundleInformationParserExtensions.cs index c462cf405dbe..ac25d71c2157 100644 --- a/tests/xharness/IAppBundleInformationParserExtensions.cs +++ b/tests/xharness/IAppBundleInformationParserExtensions.cs @@ -5,8 +5,6 @@ using System.IO; using System.Xml; -using Xharness.Targets; - #nullable enable namespace Xharness { @@ -56,9 +54,7 @@ public async static Task ParseFromProject2 (this IAppBundl if (!Directory.Exists (appPath)) throw new DirectoryNotFoundException ($"The app bundle directory `{appPath}` does not exist"); - var launchAppPath = target.ToRunMode () == RunMode.WatchOS - ? Directory.GetDirectories (Path.Combine (appPath, "Watch"), "*.app") [0] - : appPath; + var launchAppPath = appPath; return new AppBundleInformation ( appName, diff --git a/tests/xharness/IHarness.cs b/tests/xharness/IHarness.cs index 56d3d575a728..caca1a62d07a 100644 --- a/tests/xharness/IHarness.cs +++ b/tests/xharness/IHarness.cs @@ -25,23 +25,11 @@ public interface IHarness { string XIBuildPath { get; } List IOSTestProjects { get; } List MacTestProjects { get; } - string WatchOSContainerTemplate { get; } - string WatchOSAppTemplate { get; } - string WatchOSExtensionTemplate { get; } - string TodayContainerTemplate { get; } - string TodayExtensionTemplate { get; } - string MONO_PATH { get; } - string TVOS_MONO_PATH { get; } bool INCLUDE_IOS { get; } bool INCLUDE_TVOS { get; } bool INCLUDE_MAC { get; } bool INCLUDE_MACCATALYST { get; } string JENKINS_RESULTS_DIRECTORY { get; } - string MAC_DESTDIR { get; } - string IOS_DESTDIR { get; } - bool ENABLE_DOTNET { get; } - bool INCLUDE_XAMARIN_LEGACY { get; } - string SYSTEM_MONO { get; set; } string DOTNET_DIR { get; set; } string DOTNET_TFM { get; } string XcodeRoot { get; } @@ -59,7 +47,6 @@ public interface IHarness { bool InCI { get; } bool UseTcpTunnel { get; } string VSDropsUri { get; } - bool DisableWatchOSOnWrench { get; } #endregion diff --git a/tests/xharness/Jenkins/Jenkins.cs b/tests/xharness/Jenkins/Jenkins.cs index ae7da1490ad9..5661bc2b907a 100644 --- a/tests/xharness/Jenkins/Jenkins.cs +++ b/tests/xharness/Jenkins/Jenkins.cs @@ -106,11 +106,6 @@ public bool IsIncluded (TestProject project) return false; } - if (!project.IsDotNetProject && !TestSelection.IsEnabled (PlatformLabel.LegacyXamarin)) { - MainLog.WriteLine ($"Ignoring {project.Name} with label {project.Label} because it's a legacy Xamarin project and legacy Xamarin projects are not included."); - return false; - } - var rv = TestSelection.IsEnabled (project.Label); MainLog.WriteLine ($"Including {project.Name} with label {project.Label.ToString ()}: {rv}"); return rv; @@ -145,8 +140,7 @@ Task PopulateTasksAsync () // all factories are enumerators \o/ var testFactories = new IEnumerable [] { new MacTestTasksEnumerable (this, processManager, crashReportSnapshotFactory, testVariationsFactory), - new NUnitTestTasksEnumerable (this, processManager), - new MakeTestTaskEnumerable (this, processManager) + new NUnitTestTasksEnumerable (this, processManager) }; // add all tests defined by the factory diff --git a/tests/xharness/Jenkins/JenkinsDeviceLoader.cs b/tests/xharness/Jenkins/JenkinsDeviceLoader.cs index 4472356efe71..107b8d67c65e 100644 --- a/tests/xharness/Jenkins/JenkinsDeviceLoader.cs +++ b/tests/xharness/Jenkins/JenkinsDeviceLoader.cs @@ -31,18 +31,12 @@ public JenkinsDeviceLoader (ISimulatorLoader simulators, IHardwareDeviceLoader d static string BuildDevicesDescription (IHardwareDeviceLoader deviceLoader, string name) { var devicesTypes = new StringBuilder (); - if (deviceLoader.Connected32BitIOS.Any ()) { - devicesTypes.Append ("iOS 32 bit"); - } if (deviceLoader.Connected64BitIOS.Any ()) { - devicesTypes.Append (devicesTypes.Length == 0 ? "iOS 64 bit" : ", iOS 64 bit"); + devicesTypes.Append (devicesTypes.Length == 0 ? "iOS" : ", iOS"); } if (deviceLoader.ConnectedTV.Any ()) { devicesTypes.Append (devicesTypes.Length == 0 ? "tvOS" : ", tvOS"); } - if (deviceLoader.ConnectedWatch.Any ()) { - devicesTypes.Append (devicesTypes.Length == 0 ? "watchOS" : ", watchOS"); - } return (devicesTypes.Length == 0) ? $"{name} Listing (ok - no devices found)." : $"{name} Listing (ok). Devices types are: {devicesTypes}"; } diff --git a/tests/xharness/Jenkins/MacTestTasksEnumerable.cs b/tests/xharness/Jenkins/MacTestTasksEnumerable.cs index ce7898c4dc6c..f8df3ce234a4 100644 --- a/tests/xharness/Jenkins/MacTestTasksEnumerable.cs +++ b/tests/xharness/Jenkins/MacTestTasksEnumerable.cs @@ -75,9 +75,6 @@ public IEnumerator GetEnumerator () if (project.Ignore == true) ignored = true; - if (!jenkins.TestSelection.IsEnabled (TestLabel.Mmp) && project.Path.Contains ("mmptest")) - ignored = true; - if (!jenkins.IsIncluded (project)) ignored = true; @@ -91,7 +88,6 @@ public IEnumerator GetEnumerator () build.Platform = platform; build.CloneTestProject (jenkins.MainLog, processManager, project, HarnessConfiguration.RootDirectory); build.ProjectConfiguration = config; - build.ProjectPlatform = project.Platform; build.SpecifyPlatform = false; build.SpecifyConfiguration = build.ProjectConfiguration != "Debug"; build.Dependency = project.Dependency; diff --git a/tests/xharness/Jenkins/MakeTestTaskEnumerable.cs b/tests/xharness/Jenkins/MakeTestTaskEnumerable.cs deleted file mode 100644 index 4cc64229f87e..000000000000 --- a/tests/xharness/Jenkins/MakeTestTaskEnumerable.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using Microsoft.DotNet.XHarness.Common.Execution; -using Xharness.Jenkins.TestTasks; - -namespace Xharness.Jenkins { - class MakeTestTaskEnumerable : IEnumerable { - - readonly Jenkins jenkins; - readonly IProcessManager processManager; - - public MakeTestTaskEnumerable (Jenkins jenkins, IProcessManager processManager) - { - this.jenkins = jenkins ?? throw new ArgumentNullException (nameof (jenkins)); - this.processManager = processManager ?? throw new ArgumentNullException (nameof (processManager)); - } - - public IEnumerator GetEnumerator () - { - var run_mmp = new MakeTask (jenkins: jenkins, processManager: processManager) { - Platform = TestPlatform.Mac, - TestName = "MMP Regression Tests", - Target = "all", // -j" + Environment.ProcessorCount, - WorkingDirectory = Path.Combine (HarnessConfiguration.RootDirectory, "mmp-regression"), - Ignored = !jenkins.TestSelection.IsEnabled (TestLabel.Mmp) || !jenkins.TestSelection.IsEnabled (PlatformLabel.Mac), - Timeout = TimeSpan.FromMinutes (30), - SupportsParallelExecution = false, // Already doing parallel execution by running "make -jX" - }; - run_mmp.CompletedTask = new Task (() => { - foreach (var log in Directory.GetFiles (Path.GetFullPath (run_mmp.WorkingDirectory), "*.log", SearchOption.AllDirectories)) - run_mmp.Logs.AddFile (log, log.Substring (run_mmp.WorkingDirectory.Length + 1)); - }); - run_mmp.Environment.Add ("BUILD_REVISION", "jenkins"); // This will print "@MonkeyWrench: AddFile: " lines, which we can use to get the log filenames. - yield return run_mmp; - - var runMacBindingProject = new MakeTask (jenkins: jenkins, processManager: processManager) { - Platform = TestPlatform.Mac, - TestName = "Mac Binding Projects", - Target = "all", - WorkingDirectory = Path.Combine (HarnessConfiguration.RootDirectory, "mac-binding-project"), - Ignored = !jenkins.TestSelection.IsEnabled (TestLabel.MacBindingProject) || !jenkins.TestSelection.IsEnabled (PlatformLabel.Mac) || !jenkins.TestSelection.IsEnabled (PlatformLabel.LegacyXamarin), - Timeout = TimeSpan.FromMinutes (15), - }; - yield return runMacBindingProject; - } - - IEnumerator IEnumerable.GetEnumerator () => GetEnumerator (); - } -} diff --git a/tests/xharness/Jenkins/NUnitTestTasksEnumerable.cs b/tests/xharness/Jenkins/NUnitTestTasksEnumerable.cs index bc991bce25c2..7fdc30573980 100644 --- a/tests/xharness/Jenkins/NUnitTestTasksEnumerable.cs +++ b/tests/xharness/Jenkins/NUnitTestTasksEnumerable.cs @@ -22,9 +22,7 @@ public IEnumerator GetEnumerator () var msbuildTasksTestsProject = new TestProject (TestLabel.Msbuild, Path.GetFullPath (Path.Combine (HarnessConfiguration.RootDirectory, "msbuild", "Xamarin.MacDev.Tasks.Tests", "Xamarin.MacDev.Tasks.Tests.csproj"))) { IsDotNetProject = true, }; - var env = new Dictionary - { - { "SYSTEM_MONO", this.jenkins.Harness.SYSTEM_MONO }, + var env = new Dictionary { }; var buildiOSMSBuild = new MSBuildTask (jenkins: jenkins, testProject: msbuildTasksTestsProject, processManager: processManager) { SpecifyPlatform = false, @@ -67,44 +65,6 @@ public IEnumerator GetEnumerator () }; yield return nunitExecutioniOSMSBuildIntegration; - var buildMTouch = new MakeTask (jenkins: jenkins, processManager: processManager) { - TestProject = new TestProject (TestLabel.Mtouch, Path.GetFullPath (Path.Combine (HarnessConfiguration.RootDirectory, "mtouch", "mtouchtests.sln"))), - SpecifyPlatform = false, - SpecifyConfiguration = false, - Platform = TestPlatform.iOS, - Target = "dependencies", - WorkingDirectory = Path.GetFullPath (Path.Combine (HarnessConfiguration.RootDirectory, "mtouch")), - }; - var nunitExecutionMTouch = new NUnitExecuteTask (jenkins, buildMTouch, processManager) { - TestLibrary = Path.Combine (HarnessConfiguration.RootDirectory, "mtouch", "bin", "Debug", "mtouchtests.dll"), - TestProject = new TestProject (TestLabel.Mtouch, Path.GetFullPath (Path.Combine (HarnessConfiguration.RootDirectory, "mtouch", "mtouchtests.csproj"))), - Platform = TestPlatform.iOS, - TestName = "MTouch tests", - Timeout = TimeSpan.FromMinutes (180), - Ignored = !jenkins.TestSelection.IsEnabled (TestLabel.Mtouch) || !jenkins.TestSelection.IsEnabled (PlatformLabel.iOS), - InProcess = true, - }; - yield return nunitExecutionMTouch; - - var buildGenerator = new MakeTask (jenkins: jenkins, processManager: processManager) { - TestProject = new TestProject (TestLabel.Generator, Path.GetFullPath (Path.Combine (HarnessConfiguration.RootDirectory, "..", "src", "generator.sln"))), - SpecifyPlatform = false, - SpecifyConfiguration = false, - Platform = TestPlatform.iOS, - Target = "build-unit-tests", - WorkingDirectory = Path.GetFullPath (Path.Combine (HarnessConfiguration.RootDirectory, "generator")), - }; - var runGenerator = new NUnitExecuteTask (jenkins, buildGenerator, processManager) { - TestLibrary = Path.Combine (HarnessConfiguration.RootDirectory, "generator", "bin", "Debug", "generator-tests.dll"), - TestProject = new TestProject (TestLabel.Generator, Path.GetFullPath (Path.Combine (HarnessConfiguration.RootDirectory, "generator", "generator-tests.csproj"))), - Platform = TestPlatform.iOS, - TestName = "Generator tests", - Mode = "NUnit", - Timeout = TimeSpan.FromMinutes (10), - Ignored = !jenkins.TestSelection.IsEnabled (TestLabel.Generator) || !jenkins.Harness.INCLUDE_XAMARIN_LEGACY, - }; - yield return runGenerator; - var buildCecilTestsProject = new TestProject (TestLabel.Cecil, Path.GetFullPath (Path.Combine (HarnessConfiguration.RootDirectory, "cecil-tests", "cecil-tests.csproj"))) { IsDotNetProject = true, }; diff --git a/tests/xharness/Jenkins/Reports/HtmlReportWriter.cs b/tests/xharness/Jenkins/Reports/HtmlReportWriter.cs index b044b13583d6..ace5e7b056a3 100644 --- a/tests/xharness/Jenkins/Reports/HtmlReportWriter.cs +++ b/tests/xharness/Jenkins/Reports/HtmlReportWriter.cs @@ -172,7 +172,6 @@ public void Write (IList allTasks, StreamWriter writer)
  • All simulator tests
  • All iOS tests
  • All tvOS tests
  • -
  • All watchOS tests
  • All Mac tests
  • @@ -183,7 +182,6 @@ public void Write (IList allTasks, StreamWriter writer)
  • All simulator tests
  • All iOS tests
  • All tvOS tests
  • -
  • All watchOS tests
  • All Mac tests
  • @@ -418,11 +416,7 @@ public void Write (IList allTasks, StreamWriter writer) writer.WriteLine ($"Time Elapsed: {test.TestName} - (waiting time : {test.WaitingDuration} , running time : {test.Duration})
    "); var runDeviceTest = runTest as RunDeviceTask; if (runDeviceTest?.Device is not null) { - if (runDeviceTest.CompanionDevice is not null) { - writer.WriteLine ($"Device: {runDeviceTest.Device.Name} ({runDeviceTest.CompanionDevice.Name})
    "); - } else { - writer.WriteLine ($"Device: {runDeviceTest.Device.Name}
    "); - } + writer.WriteLine ($"Device: {runDeviceTest.Device.Name}
    "); } } else { if (test.Duration.Ticks > 0) diff --git a/tests/xharness/Jenkins/RunDeviceTasksFactory.cs b/tests/xharness/Jenkins/RunDeviceTasksFactory.cs index 1c6611949938..32833f6e34c3 100644 --- a/tests/xharness/Jenkins/RunDeviceTasksFactory.cs +++ b/tests/xharness/Jenkins/RunDeviceTasksFactory.cs @@ -29,27 +29,21 @@ public Task> CreateAsync (Jenkins jenkins, IMlaunchProces projectTasks.Clear (); bool createiOS; - bool createTodayExtension; bool createtvOS; - bool createwatchOS; if (project.GenerateVariations) { createiOS = !project.SkipiOSVariation; - createTodayExtension = !project.SkipTodayExtensionVariation; createtvOS = !project.SkiptvOSVariation; - createwatchOS = !project.SkipwatchOSVariation; } else { - createiOS = project.TestPlatform == TestPlatform.iOS_Unified; - createTodayExtension = project.TestPlatform == TestPlatform.iOS_TodayExtension64; + createiOS = project.TestPlatform == TestPlatform.iOS; createtvOS = project.TestPlatform == TestPlatform.tvOS; - createwatchOS = project.TestPlatform == TestPlatform.watchOS; } if (createiOS) { var build64 = new MSBuildTask (jenkins: jenkins, testProject: project, processManager: processManager) { ProjectConfiguration = "Debug", ProjectPlatform = "iPhone", - Platform = TestPlatform.iOS_Unified64, + Platform = TestPlatform.iOS, TestName = project.Name, }; build64.CloneTestProject (jenkins.MainLog, processManager, project, HarnessConfiguration.RootDirectory); @@ -62,26 +56,6 @@ public Task> CreateAsync (Jenkins jenkins, IMlaunchProces errorKnowledgeBase: jenkins.ErrorKnowledgeBase, useTcpTunnel: jenkins.Harness.UseTcpTunnel, candidates: jenkins.Devices.Connected64BitIOS.Where (d => project.IsSupported (d.DevicePlatform, d.ProductVersion))) { Ignored = !jenkins.TestSelection.IsEnabled (PlatformLabel.iOS) }); - - if (createTodayExtension) { - var todayProject = project.GenerateVariations ? project.AsTodayExtensionProject () : project; - var buildToday = new MSBuildTask (jenkins: jenkins, testProject: todayProject, processManager: processManager) { - ProjectConfiguration = "Debug", - ProjectPlatform = "iPhone", - Platform = TestPlatform.iOS_TodayExtension64, - TestName = project.Name, - }; - buildToday.CloneTestProject (jenkins.MainLog, processManager, todayProject, HarnessConfiguration.RootDirectory); - projectTasks.Add (new RunDeviceTask ( - jenkins: jenkins, - devices: jenkins.Devices, - buildTask: buildToday, - processManager: processManager, - tunnelBore: jenkins.TunnelBore, - errorKnowledgeBase: jenkins.ErrorKnowledgeBase, - useTcpTunnel: jenkins.Harness.UseTcpTunnel, - candidates: jenkins.Devices.Connected64BitIOS.Where (d => project.IsSupported (d.DevicePlatform, d.ProductVersion))) { Ignored = !jenkins.TestSelection.IsEnabled (PlatformLabel.iOSExtension), BuildOnly = jenkins.ForceExtensionBuildOnly }); - } } if (createtvOS) { @@ -104,27 +78,6 @@ public Task> CreateAsync (Jenkins jenkins, IMlaunchProces candidates: jenkins.Devices.ConnectedTV.Where (d => project.IsSupported (d.DevicePlatform, d.ProductVersion))) { Ignored = !jenkins.TestSelection.IsEnabled (PlatformLabel.tvOS) }); } - if (createwatchOS) { - var watchOSProject = project.GenerateVariations ? project.AsWatchOSProject () : project; - if (!project.SkipwatchOSARM64_32Variation) { - var buildWatch64_32 = new MSBuildTask (jenkins: jenkins, testProject: watchOSProject, processManager: processManager) { - ProjectConfiguration = "Release", // We don't support Debug for ARM64_32 yet. - ProjectPlatform = "iPhone", - Platform = TestPlatform.watchOS_64_32, - TestName = project.Name, - }; - buildWatch64_32.CloneTestProject (jenkins.MainLog, processManager, watchOSProject, HarnessConfiguration.RootDirectory); - projectTasks.Add (new RunDeviceTask ( - jenkins: jenkins, - devices: jenkins.Devices, - buildTask: buildWatch64_32, - processManager: processManager, - tunnelBore: jenkins.TunnelBore, - errorKnowledgeBase: jenkins.ErrorKnowledgeBase, - useTcpTunnel: jenkins.Harness.UseTcpTunnel, - candidates: jenkins.Devices.ConnectedWatch32_64.Where (d => project.IsSupported (d.DevicePlatform, d.ProductVersion))) { Ignored = !jenkins.TestSelection.IsEnabled (PlatformLabel.watchOS) }); - } - } foreach (var task in projectTasks) { task.TimeoutMultiplier = project.TimeoutMultiplier; task.BuildOnly |= project.BuildOnly; diff --git a/tests/xharness/Jenkins/RunSimulatorTasksFactory.cs b/tests/xharness/Jenkins/RunSimulatorTasksFactory.cs index b0821bfb9aa2..6555f78cf291 100644 --- a/tests/xharness/Jenkins/RunSimulatorTasksFactory.cs +++ b/tests/xharness/Jenkins/RunSimulatorTasksFactory.cs @@ -29,11 +29,9 @@ public async Task> CreateAsync (Jenkins jenkins, IMlaunch ps.Add (new Tuple (project, project.TestPlatform, ignored)); } else { if (!project.SkipiOSVariation) - ps.Add (new Tuple (project, TestPlatform.iOS_Unified, ignored)); + ps.Add (new Tuple (project, TestPlatform.iOS, ignored)); if (!project.SkiptvOSVariation) ps.Add (new Tuple (project.AsTvOSProject (), TestPlatform.tvOS, ignored)); - if (!project.SkipwatchOSVariation) - ps.Add (new Tuple (project.AsWatchOSProject (), TestPlatform.watchOS, ignored)); } var configurations = project.Configurations; @@ -44,16 +42,12 @@ public async Task> CreateAsync (Jenkins jenkins, IMlaunch var configIgnored = pair.Item3; var testPlatform = pair.Item2; switch (testPlatform) { - case TestPlatform.iOS_Unified: - case TestPlatform.iOS_TodayExtension64: + case TestPlatform.iOS: configIgnored |= !jenkins.TestSelection.IsEnabled (PlatformLabel.iOS); break; case TestPlatform.tvOS: configIgnored |= !jenkins.TestSelection.IsEnabled (PlatformLabel.tvOS); break; - case TestPlatform.watchOS: - configIgnored |= !jenkins.TestSelection.IsEnabled (PlatformLabel.watchOS); - break; default: Console.WriteLine ("Unknown test platform for ignore check: {0}", testPlatform); break; @@ -116,16 +110,8 @@ IEnumerable CreateAsync (Jenkins jenkins, IMlaunchProcessManag platforms = new TestPlatform [] { TestPlatform.tvOS }; ignored = new [] { false }; break; - case TestPlatform.watchOS: - platforms = new TestPlatform [] { TestPlatform.watchOS_32 }; - ignored = new [] { false }; - break; - case TestPlatform.iOS_Unified: - platforms = new TestPlatform [] { TestPlatform.iOS_Unified64 }; - ignored = new [] { false }; - break; - case TestPlatform.iOS_TodayExtension64: - platforms = new TestPlatform [] { TestPlatform.iOS_TodayExtension64 }; + case TestPlatform.iOS: + platforms = new TestPlatform [] { TestPlatform.iOS }; ignored = new [] { false }; break; default: diff --git a/tests/xharness/Jenkins/TestData.cs b/tests/xharness/Jenkins/TestData.cs index 423702dc0150..62606cf308eb 100644 --- a/tests/xharness/Jenkins/TestData.cs +++ b/tests/xharness/Jenkins/TestData.cs @@ -15,11 +15,9 @@ class TestData { public string Undefines; public bool? Ignored; public bool EnableSGenConc; - public bool UseThumb; public bool UseLlvm; public bool? UseMonoRuntime; public IEnumerable Candidates; - public string XamMacArch; public string RuntimeIdentifier; public string Registrar; public bool PublishAot; // NativeAOT diff --git a/tests/xharness/Jenkins/TestSelector.cs b/tests/xharness/Jenkins/TestSelector.cs index 7cb75de37de8..2df4c53e1cf5 100644 --- a/tests/xharness/Jenkins/TestSelector.cs +++ b/tests/xharness/Jenkins/TestSelector.cs @@ -20,11 +20,9 @@ class TestSelection { PlatformLabel platform = PlatformLabel.None | PlatformLabel.tvOS | - PlatformLabel.watchOS | PlatformLabel.iOS | PlatformLabel.iOSSimulator | PlatformLabel.MacCatalyst | - PlatformLabel.LegacyXamarin | PlatformLabel.Dotnet; public bool ForceExtensionBuildOnly { get; set; } @@ -263,20 +261,6 @@ public void SelectTests (TestSelection selection) selection.SetEnabled (PlatformLabel.MacCatalyst, false); } - if (!Harness.ENABLE_DOTNET) { - MainLog?.WriteLine ("The .NET build is disabled, so any .NET tests will be disabled as well."); - selection.SetEnabled (PlatformLabel.Dotnet, false); - } - - if (!Harness.INCLUDE_XAMARIN_LEGACY) { - MainLog?.WriteLine ("The legacy Xamarin build is disabled, so any legacy Xamarin tests will be disabled as well."); - selection.SetEnabled (PlatformLabel.LegacyXamarin, false); - selection.SetEnabled (PlatformLabel.watchOS, false); - selection.SetEnabled (TestLabel.Mmp, false); - selection.SetEnabled (TestLabel.Mtouch, false); - selection.SetEnabled (TestLabel.Xammac, false); - } - MainLog?.WriteLine ($"Final test selection: tests: {selection.SelectedTests} platforms: {selection.SelectedPlatforms}"); } } diff --git a/tests/xharness/Jenkins/TestServer.cs b/tests/xharness/Jenkins/TestServer.cs index 3b372eff3bae..3ae207a9a13f 100644 --- a/tests/xharness/Jenkins/TestServer.cs +++ b/tests/xharness/Jenkins/TestServer.cs @@ -153,10 +153,6 @@ IEnumerable find_tasks (StreamWriter writer, string ids) case "?all-ios": switch (task.Platform) { case TestPlatform.iOS: - case TestPlatform.iOS_TodayExtension64: - case TestPlatform.iOS_Unified: - case TestPlatform.iOS_Unified32: - case TestPlatform.iOS_Unified64: is_match = true; break; default: @@ -176,25 +172,9 @@ IEnumerable find_tasks (StreamWriter writer, string ids) break; } break; - case "?all-watchos": - switch (task.Platform) { - case TestPlatform.watchOS: - case TestPlatform.watchOS_32: - case TestPlatform.watchOS_64_32: - is_match = true; - break; - default: - if (task.Platform.ToString ().StartsWith ("watchOS", StringComparison.Ordinal)) - throw new NotImplementedException (); - break; - } - break; case "?all-mac": switch (task.Platform) { case TestPlatform.Mac: - case TestPlatform.Mac_Modern: - case TestPlatform.Mac_Full: - case TestPlatform.Mac_System: is_match = true; break; default: diff --git a/tests/xharness/Jenkins/TestTasks/AppleTestTask.cs b/tests/xharness/Jenkins/TestTasks/AppleTestTask.cs index 31c1cea5b172..135558692cd1 100644 --- a/tests/xharness/Jenkins/TestTasks/AppleTestTask.cs +++ b/tests/xharness/Jenkins/TestTasks/AppleTestTask.cs @@ -38,29 +38,12 @@ public override void SetEnvironmentVariables (Process process) switch (Platform) { case TestPlatform.iOS: - case TestPlatform.iOS_Unified: - case TestPlatform.iOS_Unified32: - case TestPlatform.iOS_Unified64: - case TestPlatform.iOS_TodayExtension64: case TestPlatform.tvOS: - case TestPlatform.watchOS: - case TestPlatform.watchOS_32: - case TestPlatform.watchOS_64_32: case TestPlatform.MacCatalyst: process.StartInfo.EnvironmentVariables ["MD_APPLE_SDK_ROOT"] = xcodeRoot; - process.StartInfo.EnvironmentVariables ["MD_MTOUCH_SDK_ROOT"] = Path.Combine (Jenkins.Harness.IOS_DESTDIR, "Library", "Frameworks", "Xamarin.iOS.framework", "Versions", "Current"); - process.StartInfo.EnvironmentVariables ["TargetFrameworkFallbackSearchPaths"] = Path.Combine (Jenkins.Harness.IOS_DESTDIR, "Library", "Frameworks", "Mono.framework", "External", "xbuild-frameworks"); - process.StartInfo.EnvironmentVariables ["MSBuildExtensionsPathFallbackPathsOverride"] = Path.Combine (Jenkins.Harness.IOS_DESTDIR, "Library", "Frameworks", "Mono.framework", "External", "xbuild"); break; case TestPlatform.Mac: - case TestPlatform.Mac_Modern: - case TestPlatform.Mac_Full: - case TestPlatform.Mac_System: process.StartInfo.EnvironmentVariables ["MD_APPLE_SDK_ROOT"] = xcodeRoot; - process.StartInfo.EnvironmentVariables ["TargetFrameworkFallbackSearchPaths"] = Path.Combine (Jenkins.Harness.MAC_DESTDIR, "Library", "Frameworks", "Mono.framework", "External", "xbuild-frameworks"); - process.StartInfo.EnvironmentVariables ["MSBuildExtensionsPathFallbackPathsOverride"] = Path.Combine (Jenkins.Harness.MAC_DESTDIR, "Library", "Frameworks", "Mono.framework", "External", "xbuild"); - process.StartInfo.EnvironmentVariables ["XamarinMacFrameworkRoot"] = Path.Combine (Jenkins.Harness.MAC_DESTDIR, "Library", "Frameworks", "Xamarin.Mac.framework", "Versions", "Current"); - process.StartInfo.EnvironmentVariables ["XAMMAC_FRAMEWORK_PATH"] = Path.Combine (Jenkins.Harness.MAC_DESTDIR, "Library", "Frameworks", "Xamarin.Mac.framework", "Versions", "Current"); break; case TestPlatform.All: // Don't set: @@ -69,9 +52,6 @@ public override void SetEnvironmentVariables (Process process) // because these values used by both XM and XI and we can't set it to two different values at the same time. // Any test that depends on these values should not be using 'TestPlatform.All' process.StartInfo.EnvironmentVariables ["MD_APPLE_SDK_ROOT"] = xcodeRoot; - process.StartInfo.EnvironmentVariables ["MD_MTOUCH_SDK_ROOT"] = Path.Combine (Jenkins.Harness.IOS_DESTDIR, "Library", "Frameworks", "Xamarin.iOS.framework", "Versions", "Current"); - process.StartInfo.EnvironmentVariables ["XamarinMacFrameworkRoot"] = Path.Combine (Jenkins.Harness.MAC_DESTDIR, "Library", "Frameworks", "Xamarin.Mac.framework", "Versions", "Current"); - process.StartInfo.EnvironmentVariables ["XAMMAC_FRAMEWORK_PATH"] = Path.Combine (Jenkins.Harness.MAC_DESTDIR, "Library", "Frameworks", "Xamarin.Mac.framework", "Versions", "Current"); break; default: throw new NotImplementedException ($"Unknown test platform: {Platform}"); diff --git a/tests/xharness/Jenkins/TestTasks/IRunXITask.cs b/tests/xharness/Jenkins/TestTasks/IRunXITask.cs index 2a4a512129e6..f2aab4b305d9 100644 --- a/tests/xharness/Jenkins/TestTasks/IRunXITask.cs +++ b/tests/xharness/Jenkins/TestTasks/IRunXITask.cs @@ -10,6 +10,5 @@ public interface IRunXITask : IRunTestTask where TDevice : class, IDevi TestTarget AppRunnerTarget { get; set; } IEnumerable Candidates { get; } TDevice Device { get; set; } - TDevice CompanionDevice { get; set; } } } diff --git a/tests/xharness/Jenkins/TestTasks/MacExecuteTask.cs b/tests/xharness/Jenkins/TestTasks/MacExecuteTask.cs index 785ce2e0e68d..16e1bd6ea469 100644 --- a/tests/xharness/Jenkins/TestTasks/MacExecuteTask.cs +++ b/tests/xharness/Jenkins/TestTasks/MacExecuteTask.cs @@ -27,14 +27,6 @@ public MacExecuteTask (Jenkins jenkins, BuildToolTask build_task, IMlaunchProces public override bool SupportsParallelExecution { get { - if (TestName.Contains ("xammac")) { - // We run the xammac tests in both Debug and Release configurations. - // These tests are not written to support parallel execution - // (there are hard coded paths used for instance), so disable - // parallel execution for these tests. - return false; - } - return base.SupportsParallelExecution; } } @@ -52,17 +44,6 @@ public override async Task RunTestAsync () if (string.Equals ("mac", name, StringComparison.OrdinalIgnoreCase)) name = System.IO.Path.GetFileName (System.IO.Path.GetDirectoryName (projectDir)); var suffix = string.Empty; - switch (Platform) { - case TestPlatform.Mac_Modern: - suffix = "-modern"; - break; - case TestPlatform.Mac_Full: - suffix = "-full"; - break; - case TestPlatform.Mac_System: - suffix = "-system"; - break; - } if (ProjectFile.EndsWith (".sln", StringComparison.Ordinal)) { Path = System.IO.Path.Combine (System.IO.Path.GetDirectoryName (ProjectFile), "bin", BuildTask.ProjectPlatform, BuildTask.ProjectConfiguration + suffix, name + ".app", "Contents", "MacOS", name); } else { diff --git a/tests/xharness/Jenkins/TestTasks/MacTask.cs b/tests/xharness/Jenkins/TestTasks/MacTask.cs index a7037c9d5652..3a51f44b5850 100644 --- a/tests/xharness/Jenkins/TestTasks/MacTask.cs +++ b/tests/xharness/Jenkins/TestTasks/MacTask.cs @@ -12,13 +12,7 @@ public override string Mode { get { switch (Platform) { case TestPlatform.Mac: - return TestProject?.IsDotNetProject == true ? "Mac [dotnet]" : "Mac"; - case TestPlatform.Mac_Modern: - return "Mac Modern"; - case TestPlatform.Mac_Full: - return "Mac Full"; - case TestPlatform.Mac_System: - return "Mac System"; + return "Mac [dotnet]"; case TestPlatform.MacCatalyst: return "Mac Catalyst [dotnet]"; default: diff --git a/tests/xharness/Jenkins/TestTasks/RunDevice.cs b/tests/xharness/Jenkins/TestTasks/RunDevice.cs index 751eeb928ee0..dcf107c59dfb 100644 --- a/tests/xharness/Jenkins/TestTasks/RunDevice.cs +++ b/tests/xharness/Jenkins/TestTasks/RunDevice.cs @@ -58,22 +58,11 @@ public RunDevice (IRunDeviceTask testTask, switch (testTask.BuildTask.Platform) { case TestPlatform.iOS: - case TestPlatform.iOS_Unified: - case TestPlatform.iOS_Unified32: - case TestPlatform.iOS_Unified64: - testTask.AppRunnerTarget = TestTarget.Device_iOS; - break; - case TestPlatform.iOS_TodayExtension64: testTask.AppRunnerTarget = TestTarget.Device_iOS; break; case TestPlatform.tvOS: testTask.AppRunnerTarget = TestTarget.Device_tvOS; break; - case TestPlatform.watchOS: - case TestPlatform.watchOS_32: - case TestPlatform.watchOS_64_32: - testTask.AppRunnerTarget = TestTarget.Device_watchOS; - break; } } @@ -86,8 +75,6 @@ public async Task RunTestAsync () try { // Set the device we acquired. testTask.Device = testTask.Candidates.First ((d) => d.UDID == device_resource.Resource.Name); - if (testTask.Device.DevicePlatform == DevicePlatform.watchOS) - testTask.CompanionDevice = await devices.FindCompanionDevice (deviceLoadLog, testTask.Device); mainLog.WriteLine ("Acquired device '{0}' for '{1}'", testTask.Device.Name, testTask.ProjectFile); ITunnelBore tunnelBore = null; @@ -115,7 +102,6 @@ public async Task RunTestAsync () logs: new Logs (testTask.LogDirectory ?? defaultLogDirectory), buildConfiguration: testTask.ProjectConfiguration, deviceName: testTask.Device.Name, - companionDeviceName: testTask.CompanionDevice?.Name, timeoutMultiplier: testTask.TimeoutMultiplier, variation: testTask.Variation, buildTask: testTask.BuildTask); @@ -172,45 +158,7 @@ public async Task RunTestAsync () mainLog.WriteLine ($"Test run has a known failure: '{testTask.KnownFailure}'"); } - if (testTask.Runner.Result == TestExecutingResult.Succeeded && testTask.Platform == TestPlatform.iOS_TodayExtension64) { - // For the today extension, the main app is just a single test. - // This is because running the today extension will not wake up the device, - // nor will it close & reopen the today app (but launching the main app - // will do both of these things, preparing the device for launching the today extension). - - AppRunner todayRunner = new AppRunner (testTask.ProcessManager, - new AppBundleInformationParser (testTask.ProcessManager, testTask.Harness.AppBundleLocator), - new SimulatorLoaderFactory (testTask.ProcessManager), - new SimpleListenerFactory (tunnelBore), - new DeviceLoaderFactory (testTask.ProcessManager), - new CrashSnapshotReporterFactory (testTask.ProcessManager), - new CaptureLogFactory (), - new DeviceLogCapturerFactory (testTask.ProcessManager), - new TestReporterFactory (testTask.ProcessManager), - testTask.AppRunnerTarget, - testTask.Harness, - projectFilePath: testTask.ProjectFile, - mainLog: testTask.Logs.Create ($"extension-run-{testTask.Device.UDID}-{Harness.Helpers.Timestamp}.log", "Extension run log"), - logs: new Logs (testTask.LogDirectory ?? defaultLogDirectory), - buildConfiguration: testTask.ProjectConfiguration, - deviceName: testTask.Device.Name, - companionDeviceName: testTask.CompanionDevice?.Name, - timeoutMultiplier: testTask.TimeoutMultiplier, - variation: testTask.Variation, - buildTask: testTask.BuildTask); - await todayRunner.InitializeAsync (); - - testTask.AdditionalRunner = todayRunner; - await todayRunner.RunAsync (); - foreach (var log in todayRunner.Logs.Where ((v) => !v.Description.StartsWith ("Extension ", StringComparison.Ordinal))) - log.Description = "Extension " + log.Description [0].ToString ().ToLower () + log.Description.Substring (1); - testTask.ExecutionResult = todayRunner.Result; - - if (!string.IsNullOrEmpty (todayRunner.FailureMessage)) - testTask.FailureMessage = todayRunner.FailureMessage; - } else { - testTask.ExecutionResult = testTask.Runner.Result; - } + testTask.ExecutionResult = testTask.Runner.Result; } } finally { // Uninstall again, so that we don't leave junk behind and fill up the device. diff --git a/tests/xharness/Jenkins/TestTasks/RunDeviceTask.cs b/tests/xharness/Jenkins/TestTasks/RunDeviceTask.cs index 2ede0e1b8598..19788fbefd1c 100644 --- a/tests/xharness/Jenkins/TestTasks/RunDeviceTask.cs +++ b/tests/xharness/Jenkins/TestTasks/RunDeviceTask.cs @@ -18,14 +18,14 @@ public override string ProgressMessage { if (log is null) return base.ProgressMessage; - var percent_complete = log.CopyingApp ? log.AppPercentComplete : log.WatchAppPercentComplete; - var bytes = log.CopyingApp ? log.AppBytes : log.WatchAppBytes; - var total_bytes = log.CopyingApp ? log.AppTotalBytes : log.WatchAppTotalBytes; - var elapsed = log.CopyingApp ? log.AppCopyDuration : log.WatchAppCopyDuration; + var percent_complete = log.AppPercentComplete; + var bytes = log.AppBytes; + var total_bytes = log.AppTotalBytes; + var elapsed = log.AppCopyDuration; var speed_bps = elapsed.Ticks == 0 ? -1 : bytes / elapsed.TotalSeconds; var estimated_left = TimeSpan.FromSeconds ((total_bytes - bytes) / speed_bps); var transfer_percent = 100 * (double) bytes / total_bytes; - var str = log.CopyingApp ? "App" : "Watch App"; + var str = "App"; var rv = $"{str} installation: {percent_complete}% done.\n" + $"\tApp size: {total_bytes:N0} bytes ({total_bytes / 1024.0 / 1024.0:N2} MB)\n" + $"\tTransferred: {bytes:N0} bytes ({bytes / 1024.0 / 1024.0:N2} MB)\n" + diff --git a/tests/xharness/Jenkins/TestTasks/RunSimulator.cs b/tests/xharness/Jenkins/TestTasks/RunSimulator.cs index 802149ef7863..3ca44c032ae6 100644 --- a/tests/xharness/Jenkins/TestTasks/RunSimulator.cs +++ b/tests/xharness/Jenkins/TestTasks/RunSimulator.cs @@ -21,11 +21,10 @@ public class RunSimulator { public IEnumerable Simulators { get { - if (testTask.Device is null) return Array.Empty (); - else if (testTask.CompanionDevice is null) { - return new ISimulatorDevice [] { testTask.Device }; + if (testTask.Device is null) { + return Array.Empty (); } else { - return new ISimulatorDevice [] { testTask.Device, testTask.CompanionDevice }; + return new ISimulatorDevice [] { testTask.Device }; } } } @@ -43,9 +42,8 @@ public RunSimulator (IRunSimulatorTask testTask, this.simulatorLoadLog = simulatorLoadLog ?? throw new ArgumentNullException (nameof (simulatorLoadLog)); var project = Path.GetFileNameWithoutExtension (testTask.ProjectFile); - if (project.EndsWith ("-tvos", StringComparison.Ordinal)) testTask.AppRunnerTarget = TestTarget.Simulator_tvOS; - else if (project.EndsWith ("-watchos", StringComparison.Ordinal)) { - testTask.AppRunnerTarget = TestTarget.Simulator_watchOS; + if (project.EndsWith ("-tvos", StringComparison.Ordinal)) { + testTask.AppRunnerTarget = TestTarget.Simulator_tvOS; } else { testTask.AppRunnerTarget = TestTarget.Simulator_iOS64; } @@ -66,8 +64,6 @@ public async Task FindSimulatorAsync () testTask.FailureMessage = "No applicable devices found."; } else { testTask.Device = testTask.Candidates.First (); - if (testTask.Platform == TestPlatform.watchOS) - testTask.CompanionDevice = await simulators.FindCompanionDevice (simulatorLoadLog, testTask.Device); } } catch (Exception e) { testTask.ExecutionResult = TestExecutingResult.DeviceNotFound; @@ -87,7 +83,7 @@ public async Task SelectSimulatorAsync () await FindSimulatorAsync (); - var clean_state = false;//Platform == TestPlatform.watchOS; + var clean_state = false; testTask.Runner = new AppRunner (testTask.ProcessManager, new AppBundleInformationParser (testTask.ProcessManager, testTask.Harness.AppBundleLocator), new SimulatorLoaderFactory (testTask.ProcessManager), @@ -107,8 +103,7 @@ public async Task SelectSimulatorAsync () timeoutMultiplier: testTask.TimeoutMultiplier, variation: testTask.Variation, buildTask: testTask.BuildTask, - simulator: testTask.Device, - companionSimulator: testTask.CompanionDevice); + simulator: testTask.Device); await testTask.Runner.InitializeAsync (); } diff --git a/tests/xharness/Jenkins/TestTasks/RunXITask.cs b/tests/xharness/Jenkins/TestTasks/RunXITask.cs index a58db1ae76f5..24e1f513d10f 100644 --- a/tests/xharness/Jenkins/TestTasks/RunXITask.cs +++ b/tests/xharness/Jenkins/TestTasks/RunXITask.cs @@ -45,20 +45,9 @@ public override string Mode { switch (Platform) { case TestPlatform.tvOS: - case TestPlatform.watchOS: return Platform.ToString () + " - " + XIMode; - case TestPlatform.watchOS_32: - return "watchOS 32-bits - " + XIMode; - case TestPlatform.watchOS_64_32: - return "watchOS 64-bits (ARM64_32) - " + XIMode; - case TestPlatform.iOS_Unified32: - return "iOS Unified 32-bits - " + XIMode; - case TestPlatform.iOS_Unified64: - return "iOS Unified 64-bits - " + XIMode; - case TestPlatform.iOS_TodayExtension64: - return "iOS Unified Today Extension 64-bits - " + XIMode; - case TestPlatform.iOS_Unified: - return "iOS Unified - " + XIMode; + case TestPlatform.iOS: + return "iOS - " + XIMode; default: throw new NotImplementedException (); } diff --git a/tests/xharness/Jenkins/TestTasks/TestTask.cs b/tests/xharness/Jenkins/TestTasks/TestTask.cs index 0aac8a450fc9..758dbb66ae08 100644 --- a/tests/xharness/Jenkins/TestTasks/TestTask.cs +++ b/tests/xharness/Jenkins/TestTasks/TestTask.cs @@ -142,20 +142,9 @@ public virtual string TestName { switch (Platform) { case TestPlatform.Mac: return rv; - case TestPlatform.Mac_Modern: - return rv;//.Substring (0, rv.Length - "-unified".Length); - case TestPlatform.Mac_Full: - return rv.Substring (0, rv.Length - "-full".Length); - case TestPlatform.Mac_System: - return rv.Substring (0, rv.Length - "-system".Length); default: - if (rv.EndsWith ("-watchos", StringComparison.Ordinal)) return rv.Substring (0, rv.Length - 8); - else if (rv.EndsWith ("-tvos", StringComparison.Ordinal)) { + if (rv.EndsWith ("-tvos", StringComparison.Ordinal)) { return rv.Substring (0, rv.Length - 5); - } else if (rv.EndsWith ("-unified", StringComparison.Ordinal)) { - return rv.Substring (0, rv.Length - 8); - } else if (rv.EndsWith ("-today", StringComparison.Ordinal)) { - return rv.Substring (0, rv.Length - 6); } else { return rv; } diff --git a/tests/xharness/Jenkins/TestVariationsFactory.cs b/tests/xharness/Jenkins/TestVariationsFactory.cs index 946116e9759e..3b8c2d1165a6 100644 --- a/tests/xharness/Jenkins/TestVariationsFactory.cs +++ b/tests/xharness/Jenkins/TestVariationsFactory.cs @@ -30,8 +30,8 @@ IEnumerable GetTestData (RunTestTask test) // This function returns additional test configurations (in addition to the default one) for the specific test // 32-bit interpreter doesn't work yet: https://github.com/mono/mono/issues/9871 - var supports_interpreter = test.Platform != TestPlatform.iOS_Unified32; - var supports_dynamic_registrar_on_device = test.Platform == TestPlatform.iOS_Unified64 || test.Platform == TestPlatform.tvOS; + var supports_interpreter = true; + var supports_dynamic_registrar_on_device = true; var ignore = test.TestProject.Ignore; var mac_supports_arm64 = Harness.CanRunArm64; var arm64_runtime_identifier = string.Empty; @@ -49,8 +49,6 @@ IEnumerable GetTestData (RunTestTask test) x64_runtime_identifier = "maccatalyst-x64"; break; case TestPlatform.iOS: - case TestPlatform.iOS_Unified: - case TestPlatform.iOS_Unified64: arm64_sim_runtime_identifier = "iossimulator-arm64"; x64_sim_runtime_identifier = "iossimulator-x64"; break; @@ -62,22 +60,9 @@ IEnumerable GetTestData (RunTestTask test) switch (test.ProjectPlatform) { case "iPhone": - // arm64_32 is only supported for Release builds for now. - // arm32 bits too big for debug builds - https://github.com/xamarin/maccore/issues/2080 - var supports_debug = test.Platform != TestPlatform.watchOS_64_32 && !(test.TestName == "dont link" && test.Platform == TestPlatform.iOS_Unified32); - - /* we don't add --assembly-build-target=@all=staticobject because that's the default in all our test projects */ - if (supports_debug && !test.TestProject.IsDotNetProject) { - yield return new TestData { Variation = "AssemblyBuildTarget: dylib (debug)", AppBundleExtraOptions = $"--assembly-build-target=@all=dynamiclibrary", Debug = true, Profiling = false, Ignored = ignore }; - yield return new TestData { Variation = "AssemblyBuildTarget: SDK framework (debug)", AppBundleExtraOptions = $"--assembly-build-target=@sdk=framework=Xamarin.Sdk --assembly-build-target=@all=staticobject", Debug = true, Profiling = false, Ignored = ignore }; - yield return new TestData { Variation = "AssemblyBuildTarget: dylib (debug, profiling)", AppBundleExtraOptions = $"--assembly-build-target=@all=dynamiclibrary", Debug = true, Profiling = true, Ignored = ignore }; - yield return new TestData { Variation = "AssemblyBuildTarget: SDK framework (debug, profiling)", AppBundleExtraOptions = $"--assembly-build-target=@sdk=framework=Xamarin.Sdk --assembly-build-target=@all=staticobject", Debug = true, Profiling = true, Ignored = ignore }; - } - + var supports_debug = true; if (test.ProjectConfiguration.Contains ("Debug")) yield return new TestData { Variation = "Release", Debug = false, Profiling = false }; - if (test.Platform == TestPlatform.iOS_Unified32 && !test.TestProject.IsDotNetProject) - yield return new TestData { Variation = "Release: UseThumb", Debug = false, Profiling = false, UseThumb = true }; // Disable this by default for tvOS/Release because the app ends up being too big (https://github.com/xamarin/maccore/issues/2282) var sdk_release_skip = test.Platform == TestPlatform.tvOS && test.TestName == "dont link"; @@ -125,9 +110,6 @@ IEnumerable GetTestData (RunTestTask test) } break; case "iPhoneSimulator": - if (test.Platform == TestPlatform.iOS_Unified32) - ignore = true; - switch (test.TestName) { case "monotouch-test": // The default is to run monotouch-test with the dynamic registrar (in the simulator), so that's already covered @@ -162,6 +144,8 @@ IEnumerable GetTestData (RunTestTask test) break; case "AnyCPU": case "x86": + case "": + case null: switch (test.TestName) { case "monotouch-test": if (test.TestProject.IsDotNetProject) { @@ -192,18 +176,6 @@ IEnumerable GetTestData (RunTestTask test) } } break; - case "xammac tests": - switch (test.ProjectConfiguration) { - case "Release": - yield return new TestData { Variation = "Release (all optimizations)", AppBundleExtraOptions = "--optimize:all", Registrar = "static", Debug = false, LinkMode = "Full", Defines = "OPTIMIZEALL" }; - yield return new TestData { Variation = "Release (ARM64)", XamMacArch = "ARM64", Debug = false, Ignored = !mac_supports_arm64 || !jenkins.TestSelection.IsEnabled (TestLabel.Xammac) || !jenkins.TestSelection.IsEnabled (PlatformLabel.Mac) }; - break; - case "Debug": - yield return new TestData { Variation = "Debug (all optimizations)", AppBundleExtraOptions = "--optimize:all,-remove-uithread-checks", Registrar = "static", Debug = true, LinkMode = "Full", Defines = "OPTIMIZEALL", Ignored = !(jenkins.TestSelection.IsEnabled (TestLabel.All) && jenkins.TestSelection.IsEnabled (PlatformLabel.Mac)) }; - yield return new TestData { Variation = "Debug (ARM64)", XamMacArch = "ARM64", Debug = true, Ignored = !mac_supports_arm64 || !jenkins.TestSelection.IsEnabled (TestLabel.Xammac) || !jenkins.TestSelection.IsEnabled (PlatformLabel.Mac) }; - break; - } - break; } break; default: @@ -236,7 +208,6 @@ public IEnumerable CreateTestVariations (IEnumerable tests, Func CreateTestVariations (IEnumerable tests, Func CreateTestVariations (IEnumerable tests, Func TestPlatform.Mac, - MacFlavors.Full => TestPlatform.Mac_Full, - MacFlavors.Modern => TestPlatform.Mac_Modern, - MacFlavors.System => TestPlatform.Mac_System, MacFlavors.DotNet => TestPlatform.Mac, MacFlavors.MacCatalyst => TestPlatform.MacCatalyst, - (MacFlavors.Full | MacFlavors.Modern) => (TestPlatform.Mac | TestPlatform.Mac_Modern), _ => throw new NotImplementedException (flavor.ToString ()), }; } diff --git a/tests/xharness/MacTestProject.cs b/tests/xharness/MacTestProject.cs index 6857d3d03076..5e9d78798d87 100644 --- a/tests/xharness/MacTestProject.cs +++ b/tests/xharness/MacTestProject.cs @@ -3,10 +3,7 @@ namespace Xharness { [Flags] public enum MacFlavors { - Modern = 1, // Xamarin.Mac/Modern app - Full = 2, // Xamarin.Mac/Full app - System = 4, // Xamarin.Mac/System app - Console = 8, // Console executable + None = 0, DotNet = 16, MacCatalyst = 32, } @@ -14,38 +11,29 @@ public enum MacFlavors { public class MacTestProject : TestProject { public MacFlavors TargetFrameworkFlavors; - public bool GenerateFull => GenerateVariations && (TargetFrameworkFlavors & MacFlavors.Full) == MacFlavors.Full; - public bool GenerateSystem => GenerateVariations && (TargetFrameworkFlavors & MacFlavors.System) == MacFlavors.System; - public override bool GenerateVariations { get { - if (IsDotNetProject) - return false; - - // If a bitwise combination of flavors, then we're generating variations - return TargetFrameworkFlavors != MacFlavors.Modern && TargetFrameworkFlavors != MacFlavors.Full && TargetFrameworkFlavors != MacFlavors.System && TargetFrameworkFlavors != MacFlavors.Console; + return false; } set { throw new Exception ("This value is read-only"); } } - public string Platform = "x86"; - - public MacTestProject (TestLabel label, string path, bool isExecutableProject = true, MacFlavors targetFrameworkFlavor = MacFlavors.Full | MacFlavors.Modern) : base (label, path, isExecutableProject) + public MacTestProject (TestLabel label, string path) + : base (label, path, true) { - TargetFrameworkFlavors = targetFrameworkFlavor; } public override TestProject Clone () { - return CompleteClone (new MacTestProject (Label, Path, IsExecutableProject, TargetFrameworkFlavors)); + return CompleteClone (new MacTestProject (Label, Path)); } protected override TestProject CompleteClone (TestProject project) { var rv = (MacTestProject) project; - rv.Platform = Platform; + rv.TargetFrameworkFlavors = TargetFrameworkFlavors; return base.CompleteClone (rv); } diff --git a/tests/xharness/Program.cs b/tests/xharness/Program.cs index b2b88d5471ed..1991d170b51d 100644 --- a/tests/xharness/Program.cs +++ b/tests/xharness/Program.cs @@ -12,22 +12,22 @@ public static int Main (string [] args) xcode: Xamarin.SdkVersions.Xcode, osx: Xamarin.SdkVersions.OSX, iOS: Xamarin.SdkVersions.iOS, - watchOS: Xamarin.SdkVersions.WatchOS, + watchOS: "99.99", tVOS: Xamarin.SdkVersions.TVOS, minOSX: Xamarin.SdkVersions.MinOSX, miniOS: Xamarin.SdkVersions.MiniOS, - minWatchOS: Xamarin.SdkVersions.LegacyMinWatchOS, + minWatchOS: "99.99", minTVOS: Xamarin.SdkVersions.MinTVOS, miniOSSimulator: Xamarin.SdkVersions.MiniOSSimulator, - minWatchOSSimulator: Xamarin.SdkVersions.MinWatchOSSimulator, - minWatchOSCompanionSimulator: Xamarin.SdkVersions.MinWatchOSCompanionSimulator, + minWatchOSSimulator: "99.99", + minWatchOSCompanionSimulator: "99.99", minTVOSSimulator: Xamarin.SdkVersions.MinTVOSSimulator, maxiOSSimulator: Xamarin.SdkVersions.MaxiOSSimulator, - maxWatchOSSimulator: Xamarin.SdkVersions.MaxWatchOSSimulator, - maxWatchOSCompanionSimulator: Xamarin.SdkVersions.MaxWatchOSCompanionSimulator, + maxWatchOSSimulator: "99.99", + maxWatchOSCompanionSimulator: "99.99", maxTVOSSimulator: Xamarin.SdkVersions.MaxTVOSSimulator, maxiOSDeploymentTarget: Xamarin.SdkVersions.MaxiOSDeploymentTarget, - maxWatchDeploymentTarget: Xamarin.SdkVersions.MaxWatchDeploymentTarget, + maxWatchDeploymentTarget: "99.99", maxTVOSDeploymentTarget: Xamarin.SdkVersions.MaxTVOSDeploymentTarget); Action showHelp = null; @@ -39,13 +39,9 @@ public static int Main (string [] args) { "h|?|help", "Displays the help", (v) => showHelp () }, { "v|verbose", "Show verbose output", (v) => configuration.Verbosity++ }, { "use-system:", "Use the system version of Xamarin.iOS/Xamarin.Mac or the locally build version. Default: the locally build version.", (v) => configuration.UseSystemXamarinIOSMac = v == "1" || v == "true" || string.IsNullOrEmpty (v) }, - // Configure - { "configure", "Creates project files and makefiles.", (v) => action = HarnessAction.Configure }, { "autoconf", "Automatically decide what to configure.", (v) => configuration.AutoConf = true }, { "rootdir=", "The root directory for the tests.", (v) => HarnessConfiguration.RootDirectory = v }, { "project=", "Add a project file to process. This can be specified multiple times.", (v) => configuration.IOSTestProjects.Add (new iOSTestProject (TestLabel.None, v)) }, - { "watchos-container-template=", "The directory to use as a template for a watchos container app.", (v) => configuration.WatchOSContainerTemplate = v }, - { "watchos-app-template=", "The directory to use as a template for a watchos app.", (v) => configuration.WatchOSAppTemplate = v }, // Run { "run=", "Executes a project.", (v) => { @@ -66,8 +62,7 @@ public static int Main (string [] args) } }, { "sdkroot=", "Where Xcode is", (v) => configuration.SdkRoot = v }, - { "sdkroot94=", "Where Xcode 9.4 is", (v) => Console.WriteLine ("--sdkroot94 is deprecated"), true }, - { "target=", "Where to run the project ([ios|watchos|tvos]-[device|simulator|simulator-32|simulator-64]).", (v) => configuration.Target = v.ParseAsAppRunnerTarget () }, + { "target=", "Where to run the project ([ios|tvos]-[device|simulator).", (v) => configuration.Target = v.ParseAsAppRunnerTarget () }, { "configuration=", "Which configuration to run (defaults to Debug).", (v) => configuration.BuildConfiguration = v }, { "logdirectory=", "Where to store logs.", (v) => configuration.LogDirectory = v }, { "logfile=", "Where to store the log.", (v) => Console.WriteLine("The logfile option is deprecated. Please use logdirectory."), true }, diff --git a/tests/xharness/SimulatorLoaderFactory.cs b/tests/xharness/SimulatorLoaderFactory.cs index 65f5ffebad83..e23979a7ce63 100644 --- a/tests/xharness/SimulatorLoaderFactory.cs +++ b/tests/xharness/SimulatorLoaderFactory.cs @@ -28,7 +28,6 @@ public override string GetDeviceType (TestTargetOs target, bool minVersion) return target.Platform switch { TestTarget.Simulator_iOS64 => GetiOSDeviceType (Version.Parse (target.OSVersion!)), TestTarget.Simulator_tvOS => "com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p", - TestTarget.Simulator_watchOS => GetWatchOSDeviceType (Version.Parse (target.OSVersion!)), _ => throw new Exception (string.Format ("Invalid simulator target: {0}", target)) }; } @@ -47,25 +46,10 @@ string GetiOSDeviceType (Version iOSVersion) return "com.apple.CoreSimulator.SimDeviceType.iPhone-14"; } - string GetWatchOSDeviceType (Version watchOSVersion) - { - if (watchOSVersion.Major < 7) - return "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-38mm"; - if (watchOSVersion.Major < 8) - return "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-4-40mm"; - return "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-7-41mm"; - } - public override void GetCompanionRuntimeAndDeviceType (TestTargetOs target, bool minVersion, out string? companionRuntime, out string? companionDeviceType) { companionRuntime = null; companionDeviceType = null; - - if (target.Platform == TestTarget.Simulator_watchOS) { - var companionVersion = minVersion ? Xamarin.SdkVersions.MinWatchOSCompanionSimulator : Xamarin.SdkVersions.MaxWatchOSCompanionSimulator; - companionRuntime = "com.apple.CoreSimulator.SimRuntime.iOS-" + companionVersion.Replace ('.', '-'); - companionDeviceType = GetiOSDeviceType (Version.Parse (companionVersion)); - } } } } diff --git a/tests/xharness/SolutionGenerator.cs b/tests/xharness/SolutionGenerator.cs deleted file mode 100644 index 8b885f46056d..000000000000 --- a/tests/xharness/SolutionGenerator.cs +++ /dev/null @@ -1,166 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; -using System.Text; -using Microsoft.DotNet.XHarness.iOS.Shared.Hardware; -using Microsoft.DotNet.XHarness.iOS.Shared.Utilities; -using Xharness.Targets; - -namespace Xharness { - public static class SolutionGenerator { - static void AddProjectToSolution (IHarness harness, string sln_path, TextWriter solution, string project_path, out string configurations) - { - var project = new XmlDocument (); - project.LoadWithoutNetworkAccess (project_path); - var guid = project.GetProjectGuid (); - solution.WriteLine ("Project(\"{3}\") = \"{0}\", \"{1}\", \"{2}\"", Path.GetFileNameWithoutExtension (project_path), FixProjectPath (sln_path, project_path), guid, project_path.EndsWith (".csproj") ? Target.CSharpGuid : Target.FSharpGuid); - solution.WriteLine ("EndProject"); - - configurations = string.Format ( - "\t\t{0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n" + - "\t\t{0}.Debug|Any CPU.Build.0 = Debug|Any CPU\n" + - "\t\t{0}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n" + - "\t\t{0}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU\n" + - "\t\t{0}.Debug|iPhone.ActiveCfg = Debug|Any CPU\n" + - "\t\t{0}.Debug|iPhone.Build.0 = Debug|Any CPU\n" + - "\t\t{0}.Release|Any CPU.ActiveCfg = Release|Any CPU\n" + - "\t\t{0}.Release|Any CPU.Build.0 = Release|Any CPU\n" + - "\t\t{0}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\n" + - "\t\t{0}.Release|iPhoneSimulator.Build.0 = Release|Any CPU\n" + - "\t\t{0}.Release|iPhone.ActiveCfg = Release|Any CPU\n" + - "\t\t{0}.Release|iPhone.Build.0 = Release|Any CPU\n", guid); - } - - static string FixProjectPath (string sln_path, string project_path) - { - var sln_dir = Path.GetDirectoryName (sln_path); - if (project_path.StartsWith (sln_dir + Path.PathSeparator, StringComparison.OrdinalIgnoreCase)) - project_path = project_path.Substring (sln_dir.Length + 1); - project_path = project_path.Replace ('/', '\\'); - return project_path; - } - - public static void CreateSolution (IHarness harness, IEnumerable targets, string infix, DevicePlatform testPlatform) - { - CreateSolution (harness, targets, null, infix, testPlatform); - } - - public static void CreateSolution (IHarness harness, IEnumerable targets, Target exeTarget, string infix, DevicePlatform testPlatform) - { - var folders = new StringBuilder (); - - var srcDirectory = Path.Combine (HarnessConfiguration.RootDirectory, "..", "src"); - var sln_path = exeTarget is null ? Path.Combine (HarnessConfiguration.RootDirectory, "tests-" + infix + ".sln") : Path.Combine (Path.GetDirectoryName (exeTarget.ProjectPath), Path.GetFileNameWithoutExtension (exeTarget.ProjectPath) + ".sln"); - - using (var writer = new StringWriter ()) { - writer.WriteLine (); - writer.WriteLine ("Microsoft Visual Studio Solution File, Format Version 11.00"); - writer.WriteLine ("# Visual Studio 2010"); - foreach (var target in targets) { - var relatedProjects = target.GetRelatedProjects (); - var hasRelatedProjects = relatedProjects is not null; - var folderGuid = string.Empty; - var useFolders = hasRelatedProjects && target.IsExe && exeTarget is null; - - if (hasRelatedProjects && target.IsExe) { - if (exeTarget is null) { - CreateSolution (harness, targets, target, infix, testPlatform); // create a solution for just this test project as well - } else if (exeTarget != target) { - continue; - } - } - - if (useFolders) { - folderGuid = Guid.NewGuid ().ToString ().ToUpperInvariant (); - writer.WriteLine ("Project(\"{{2150E333-8FDC-42A3-9474-1A3956D46DE8}}\") = \"{0}\", \"{0}\", \"{{{1}}}\"", target.Name, folderGuid); - writer.WriteLine ("EndProject"); - } - - writer.WriteLine ("Project(\"{3}\") = \"{0}\", \"{1}\", \"{2}\"", Path.GetFileNameWithoutExtension (target.ProjectPath), FixProjectPath (sln_path, Path.GetFullPath (target.ProjectPath)), target.ProjectGuid, target.LanguageGuid); - writer.WriteLine ("EndProject"); - - if (hasRelatedProjects && target.IsExe) { - foreach (var rp in relatedProjects) { - writer.WriteLine ("Project(\"{3}\") = \"{0}\", \"{1}\", \"{2}\"", Path.GetFileNameWithoutExtension (rp.ProjectPath), FixProjectPath (sln_path, Path.GetFullPath (rp.ProjectPath)), rp.Guid, target.LanguageGuid); - writer.WriteLine ("EndProject"); - } - } - - if (useFolders) { - folders.AppendFormat ("\t\t{0} = {{{1}}}\n", target.ProjectGuid, folderGuid); - foreach (var rp in relatedProjects) - folders.AppendFormat ("\t\t{0} = {{{1}}}\n", rp.Guid, folderGuid); - } - } - - // Add reference to the Touch.Client project - string configuration; - var proj_path = Path.GetFullPath (Path.Combine (srcDirectory, "..", "external", "Touch.Unit", "Touch.Client", testPlatform.AsString (), "Touch.Client-" + testPlatform.AsString () + ".csproj")); - AddProjectToSolution (harness, sln_path, writer, proj_path, out configuration); - - writer.WriteLine ("Global"); - - writer.WriteLine ("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution"); - writer.WriteLine ("\t\tDebug|iPhoneSimulator = Debug|iPhoneSimulator"); - writer.WriteLine ("\t\tRelease|iPhoneSimulator = Release|iPhoneSimulator"); - writer.WriteLine ("\t\tDebug|iPhone = Debug|iPhone"); - writer.WriteLine ("\t\tRelease|iPhone = Release|iPhone"); - writer.WriteLine ("\t\tDebug|Any CPU = Debug|Any CPU"); - writer.WriteLine ("\t\tRelease|Any CPU = Release|Any CPU"); - writer.WriteLine ("\tEndGlobalSection"); - - writer.WriteLine ("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution"); - var exePlatforms = new string [] { "iPhone", "iPhoneSimulator" }; - var configurations = new string [] { "Debug", "Release" }; - foreach (var target in targets) { - if (target.IsExe && exeTarget is not null && target != exeTarget) - continue; - - foreach (var conf in configurations) { - if (target.IsExe) { - foreach (var platform in exePlatforms) { - writer.WriteLine ("\t\t{0}.{1}|{2}.ActiveCfg = {1}|{2}", target.ProjectGuid, conf, platform); - writer.WriteLine ("\t\t{0}.{1}|{2}.Build.0 = {1}|{2}", target.ProjectGuid, conf, platform); - - } - } else { - foreach (var platform in new string [] { "Any CPU", "iPhone", "iPhoneSimulator" }) { - writer.WriteLine ("\t\t{0}.{1}|{2}.ActiveCfg = {1}|Any CPU", target.ProjectGuid, conf, platform); - writer.WriteLine ("\t\t{0}.{1}|{2}.Build.0 = {1}|Any CPU", target.ProjectGuid, conf, platform); - } - } - } - - if (target.IsExe) { - var relatedProjects = target.GetRelatedProjects (); - if (relatedProjects is not null) { - foreach (var rp in relatedProjects) { - foreach (var conf in configurations) { - foreach (var platform in exePlatforms) { - writer.WriteLine ("\t\t{0}.{1}|{2}.ActiveCfg = {1}|{2}", rp.Guid, conf, platform); - writer.WriteLine ("\t\t{0}.{1}|{2}.Build.0 = {1}|{2}", rp.Guid, conf, platform); - } - } - } - } - - } - - } - writer.Write (configuration); - writer.WriteLine ("\tEndGlobalSection"); - - if (folders.Length > 0) { - writer.WriteLine ("\tGlobalSection(NestedProjects) = preSolution"); - writer.Write (folders.ToString ()); - writer.WriteLine ("\tEndGlobalSection"); - } - - writer.WriteLine ("EndGlobal"); - - harness.Save (writer, sln_path); - } - } - } -} diff --git a/tests/xharness/Targets/MacTarget.cs b/tests/xharness/Targets/MacTarget.cs deleted file mode 100644 index b6dae3e64b7e..000000000000 --- a/tests/xharness/Targets/MacTarget.cs +++ /dev/null @@ -1,186 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Microsoft.DotNet.XHarness.iOS.Shared.Hardware; -using Microsoft.DotNet.XHarness.iOS.Shared.Utilities; - -namespace Xharness.Targets { - public class MacTarget : Target { - public MacFlavors Flavor { get; private set; } - public bool Modern => Flavor == MacFlavors.Modern; - public bool System => Flavor == MacFlavors.System; - public bool Full => Flavor == MacFlavors.Full; - - public MacTarget (MacFlavors flavor) - { - Flavor = flavor; - } - - public override string Suffix { - get { - switch (Flavor) { - case MacFlavors.Modern: - return string.Empty; - case MacFlavors.Full: - return "-full"; - case MacFlavors.System: - return "-system"; - default: - throw new NotImplementedException ($"Suffix for {Flavor}"); - } - } - } - - public override string MakefileWhereSuffix { - get { - switch (Flavor) { - case MacFlavors.Modern: - return "modern"; - case MacFlavors.Full: - return "full"; - case MacFlavors.System: - return "system"; - default: - throw new NotImplementedException ($"Suffix for {Flavor}"); - } - } - } - - protected override string ProjectTypeGuids { - get { - return "{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};" + LanguageGuid; - } - } - - protected override string BindingsProjectTypeGuids { - get { - return "{810C163F-4746-4721-8B8E-88A3673A62EA}"; - } - } - - protected override string TargetFrameworkIdentifier { - get { - return "Xamarin.Mac"; - } - } - - protected override string Imports { - get { - return IsFSharp ? "Mac\\Xamarin.Mac.FSharp.targets" : "Mac\\Xamarin.Mac.CSharp.targets"; - } - } - - protected override string BindingsImports { - get { - return "Mac\\Xamarin.Mac.ObjcBinding.CSharp"; - } - } - - protected override string AdditionalDefines { - get { - var rv = ""; - - if (Full) - rv += "XAMMAC_4_5"; - - return rv; - } - } - - protected override string RemoveDefines { - get { - var rv = string.Empty; - - if (!Modern) - rv += ";XAMMAC;MOBILE"; - - return rv; - } - } - - public override string Platform { - get { - return "mac"; - } - } - - public override string DotNetSdk => "Microsoft.macOS.Sdk"; - public override string RuntimeIdentifier => "osx-x64"; - public override DevicePlatform ApplePlatform => DevicePlatform.macOS; - public override string TargetFramework => DotNetTfm + "-macos"; - public override string TargetFrameworkForNuGet => "xamarinmac10"; - - protected override bool FixProjectReference (string include, string subdir, string suffix, out string fixed_include) - { - var fn = Path.GetFileName (include); - - switch (fn) { - case "Touch.Client-macOS-mobile.csproj": - switch (Flavor) { - case MacFlavors.Full: - case MacFlavors.System: - var dir = Path.GetDirectoryName (include); - var parentDir = Path.GetDirectoryName (dir); - dir = Path.Combine (parentDir, "full"); - fixed_include = Path.Combine (dir, fn.Replace ("-mobile", "-full")); - return true; - case MacFlavors.Modern: - default: - break; - } - break; - } - - return base.FixProjectReference (include, subdir, suffix, out fixed_include); - } - - public string SimplifiedName { - get { - return Name.EndsWith ("-mac", StringComparison.Ordinal) ? Name.Substring (0, Name.Length - 4) : Name; - } - } - - public override string DefaultAssemblyReference { get { return "Xamarin.Mac"; } } - - public override IEnumerable ReferenceToRemove { get { yield return "System.Drawing"; } } - - public override bool ShouldSetTargetFrameworkIdentifier { get { return Modern; } } - - public override Dictionary NewPropertiesToAdd { - get { - var props = new Dictionary (); - - - if (System) { - props.Add ("TargetFrameworkVersion", "v4.7.1"); - props.Add ("AppBundleExtraOptions", "--embed-mono=no"); - } else if (Modern) { - props.Add ("TargetFrameworkVersion", "v2.0"); - } else { - props.Add ("TargetFrameworkVersion", "v4.5"); - props.Add ("UseXamMacFullFramework", "true"); - } - - props.Add ("XamMacArch", "x86_64"); - return props; - } - } - - public override HashSet PropertiesToRemove { - get { - if (!ShouldSetTargetFrameworkIdentifier) - return new HashSet { "TargetFrameworkIdentifier" }; - return null; - } - } - - protected override void PostProcessExecutableProject () - { - base.PostProcessExecutableProject (); - - ProjectGuid = "{" + Xharness.Harness.Helpers.GenerateStableGuid ().ToString ().ToUpper () + "}"; - inputProject.SetProjectGuid (ProjectGuid); - inputProject.ResolveAllPaths (TemplateProjectPath); - } - } -} diff --git a/tests/xharness/Targets/TVOSTarget.cs b/tests/xharness/Targets/TVOSTarget.cs deleted file mode 100644 index b3bf5c5de289..000000000000 --- a/tests/xharness/Targets/TVOSTarget.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using System.Xml; -using Microsoft.DotNet.XHarness.iOS.Shared.Utilities; -using Microsoft.DotNet.XHarness.iOS.Shared.Hardware; -using Microsoft.DotNet.XHarness.iOS.Shared; - -namespace Xharness.Targets { - public class TVOSTarget : iOSTarget { - public override string Suffix { - get { - return "-tvos"; - } - } - - public override string ExtraLinkerDefsSuffix { - get { - return "-tvos"; - } - } - - protected override string BindingsProjectTypeGuids { - get { - return "{4A1ED743-3331-459B-915A-4B17C7B6DBB6}"; - } - } - - protected override string ProjectTypeGuids { - get { - return "{06FA79CB-D6CD-4721-BB4B-1BD202089C55}"; - } - } - - protected override string TargetFrameworkIdentifier { - get { - return "Xamarin.TVOS"; - } - } - - protected override string Imports { - get { - return IsFSharp ? "TVOS\\Xamarin.TVOS.FSharp.targets" : "TVOS\\Xamarin.TVOS.CSharp.targets"; - } - } - - protected override string BindingsImports { - get { - return IsFSharp ? "TVOS\\Xamarin.TVOS.ObjCBinding.FSharp.targets" : "TVOS\\Xamarin.TVOS.ObjCBinding.CSharp.targets"; - } - } - - public override string SimulatorArchitectures { - get { - return "x86_64"; - } - } - - public override string DeviceArchitectures { - get { - return "ARM64"; - } - } - - protected override string GetMinimumOSVersion (string templateMinimumOSVersion) - { - return Xamarin.SdkVersions.MinTVOS; - } - - protected override int [] UIDeviceFamily { - get { - return new int [] { 3 }; - } - } - - protected override string AdditionalDefines { - get { - return "XAMCORE_3_0;MONOTOUCH_TV;"; - } - } - - public override string Platform { - get { - return "tvos"; - } - } - - public override string DotNetSdk => "Microsoft.tvOS.Sdk"; - public override string RuntimeIdentifier => "tvossimulator-x64"; - public override DevicePlatform ApplePlatform => DevicePlatform.tvOS; - public override string TargetFramework => DotNetTfm + "-tvos"; - public override string TargetFrameworkForNuGet => "xamarintvos10"; - - static Dictionary project_guids = new Dictionary (); - - protected override void ProcessProject () - { - base.ProcessProject (); - - var srcDirectory = Path.Combine (HarnessConfiguration.RootDirectory, "..", "src"); - - inputProject.AddExtraMtouchArgs ("--bitcode:asmonly", "iPhone", "Release"); - inputProject.SetMtouchUseLlvm (true, "iPhone", "Release"); - inputProject.ResolveAllPaths (TemplateProjectPath); - - // Remove bitcode from executables, since we don't need it for testing, and it makes test apps bigger (and the Apple TV might refuse to install them). - var configurations = new string [] { "Debug", "Release" }; - foreach (var c in configurations) { - inputProject.AddExtraMtouchArgs ($"--gcc_flags=-fembed-bitcode-marker", "iPhone", c); - } - } - } -} diff --git a/tests/xharness/Targets/Target.cs b/tests/xharness/Targets/Target.cs index 3d62d717fcc1..088f2b673de1 100644 --- a/tests/xharness/Targets/Target.cs +++ b/tests/xharness/Targets/Target.cs @@ -1,284 +1,5 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Xml; -using Microsoft.DotNet.XHarness.iOS.Shared.Hardware; -using Microsoft.DotNet.XHarness.iOS.Shared.Utilities; -using Microsoft.DotNet.XHarness.iOS.Shared; - namespace Xharness.Targets { public abstract class Target { - public IHarness Harness; - - protected XmlDocument inputProject; - protected string OriginalInfoPListInclude { get; private set; } - string outputType; - string bundleIdentifier; - string targetDirectory; - - public string Name { get; protected set; } - public string ProjectGuid { get; protected set; } - public string ProjectPath { get; protected set; } - - public string ProjectFileExtension { get { return IsFSharp ? "fsproj" : "csproj"; } } - public bool IsFSharp { get { return (ProjectPath ?? TemplateProjectPath).EndsWith (".fsproj", StringComparison.Ordinal); } } - - public string TemplateProjectPath { get; set; } - - bool? is_dotnet_project; - public bool IsDotNetProject { get { return is_dotnet_project ?? (is_dotnet_project = inputProject.IsDotNetProject ()).Value; } } - public string OutputType { get { return outputType; } } - public string TargetDirectory { get { return targetDirectory; } } - public bool IsLibrary { get { return outputType == "Library"; } } - public bool IsExe { get { return outputType == "Exe"; } } - public bool IsBindingProject { get; private set; } - public bool IsNUnitProject { get; set; } - - public string BundleIdentifier { get { return bundleIdentifier; } protected set { bundleIdentifier = value; } } - - public virtual string Suffix { get { throw new NotImplementedException (); } } - public virtual string MakefileWhereSuffix { get { return string.Empty; } } - public virtual string ProjectFileSuffix { get { return Suffix; } } - public virtual string ExtraLinkerDefsSuffix { get { return Suffix; } } - protected virtual string ProjectTypeGuids { get { throw new NotImplementedException (); } } - protected virtual string BindingsProjectTypeGuids { get { throw new NotImplementedException (); } } - protected virtual string TargetFrameworkIdentifier { get { throw new NotImplementedException (); } } - protected virtual string Imports { get { throw new NotImplementedException (); } } - protected virtual string BindingsImports { get { throw new NotImplementedException (); } } - public virtual bool IsMultiArchitecture { get { return false; } } - public virtual string SimulatorArchitectures { get { throw new NotImplementedException (); } } - public virtual string DeviceArchitectures { get { throw new NotImplementedException (); } } - protected virtual string GetMinimumOSVersion (string templateMinimumOSVersion) { throw new NotImplementedException (); } - protected virtual int [] UIDeviceFamily { get { throw new NotImplementedException (); } } - protected virtual string AdditionalDefines { get { return string.Empty; } } - protected virtual string RemoveDefines { get { return string.Empty; } } - public virtual string Platform { get { throw new NotImplementedException (); } } - - public bool ShouldSkipProjectGeneration { get; set; } - public virtual bool ShouldSetTargetFrameworkIdentifier { get { return true; } } - public virtual string DefaultAssemblyReference { get { return "Xamarin.iOS"; } } - public virtual IEnumerable ReferenceToRemove { get { return Enumerable.Empty (); } } - public virtual Dictionary NewPropertiesToAdd { get { return new Dictionary (); } } - public virtual HashSet PropertiesToRemove { get { return null; } } - - public const string FSharpGuid = "{F2A71F9B-5D33-465A-A702-920D77279786}"; - public const string CSharpGuid = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"; - public string DotNetTfm => Harness.DOTNET_TFM; - - public string LanguageGuid { get { return IsFSharp ? FSharpGuid : CSharpGuid; } } - - public abstract string DotNetSdk { get; } - public abstract string RuntimeIdentifier { get; } - public abstract DevicePlatform ApplePlatform { get; } - public abstract string TargetFramework { get; } - public abstract string TargetFrameworkForNuGet { get; } - public static string ProjectsDir { get { return "generated-projects"; } } - protected string GetTargetSpecificDir (string customSuffix = null) - { - string rv; - if (string.IsNullOrEmpty (customSuffix)) { - rv = Suffix; - } else { - rv = Suffix + "-" + customSuffix; - } - if (IsDotNetProject) - rv += "-dotnet"; - return rv.TrimStart ('-'); - } - - public virtual string PlatformString { - get { - return ApplePlatform.AsString (); - } - } - - protected virtual bool FixProjectReference (string include, string subdir, string suffix, out string fixed_include) - { - var fn = Path.GetFileName (include); - - switch (fn) { - case "Touch.Client-iOS.dotnet.csproj": - case "Touch.Client-iOS.csproj": - var dir = Path.GetDirectoryName (include); - var parentDir = Path.GetFileName (dir); - if (parentDir == "iOS") - dir = Path.Combine (Path.GetDirectoryName (dir), PlatformString); - fixed_include = Path.Combine (dir, fn.Replace ("-iOS", "-" + PlatformString)); - break; - default: - include = include.Replace (".csproj", suffix + ".csproj"); - include = include.Replace (".fsproj", suffix + ".fsproj"); - - if (!string.IsNullOrEmpty (subdir)) - include = Path.Combine (Path.GetDirectoryName (include), subdir, Path.GetFileName (include)); - - fixed_include = include; - break; - } - - return true; - } - - protected virtual void ProcessDotNetProject () - { - inputProject.SetSdk (DotNetSdk); - inputProject.SetRuntimeIdentifier (RuntimeIdentifier); - inputProject.FixProjectReferences (Path.Combine (ProjectsDir, GetTargetSpecificDir ()), Suffix, FixProjectReference); - inputProject.SetNode ("TargetFramework", TargetFramework); - var fixedAssetTargetFallback = inputProject.GetAssetTargetFallback ()?.Replace ("xamarinios10", TargetFrameworkForNuGet); - if (fixedAssetTargetFallback is not null) - inputProject.SetAssetTargetFallback (fixedAssetTargetFallback); - inputProject.ResolveAllPaths (TemplateProjectPath); - } - - protected virtual void ProcessProject () - { - inputProject.SetOutputPath ("bin\\$(Platform)\\$(Configuration)" + Suffix); - inputProject.SetIntermediateOutputPath ("obj\\$(Platform)\\$(Configuration)" + Suffix); - - if (ShouldSetTargetFrameworkIdentifier) - inputProject.SetTargetFrameworkIdentifier (TargetFrameworkIdentifier); - - inputProject.SetAssemblyReference (DefaultAssemblyReference, TargetFrameworkIdentifier); - - foreach (var r in ReferenceToRemove) - inputProject.RemoveReferences (r); - - var newProperties = NewPropertiesToAdd; - foreach (var k in newProperties.Keys) - inputProject.SetTopLevelPropertyGroupValue (k, newProperties [k]); - - var removedProperties = PropertiesToRemove; - if (removedProperties is not null) { - foreach (var p in removedProperties) - inputProject.RemoveNode (p, false); - } - - inputProject.FixProjectReferences (Path.Combine (ProjectsDir, GetTargetSpecificDir ()), Suffix, FixProjectReference); - inputProject.SetAssemblyReference ("OpenTK", "OpenTK-1.0"); - inputProject.SetProjectTypeGuids (IsBindingProject ? BindingsProjectTypeGuids : ProjectTypeGuids); - inputProject.SetImport ("$(MSBuildExtensionsPath)\\Xamarin\\" + (IsBindingProject ? BindingsImports : Imports)); - inputProject.FixTestLibrariesReferences (Platform); - if (!string.IsNullOrEmpty (AdditionalDefines)) - inputProject.AddAdditionalDefines (AdditionalDefines); - if (!string.IsNullOrEmpty (RemoveDefines)) - inputProject.RemoveDefines (RemoveDefines); - } - - protected void CreateExecutableProject () - { - ProcessProject (); - PostProcessExecutableProject (); - inputProject.Save (ProjectPath, Harness); - - UpdateInfoPList (); - } - - protected virtual void PostProcessExecutableProject () - { - } - - protected virtual void UpdateInfoPList () - { - } - - protected void CreateLibraryProject () - { - ProcessProject (); - inputProject.ResolveAllPaths (TemplateProjectPath); - inputProject.Save (ProjectPath, Harness); - - ProjectGuid = inputProject.GetProjectGuid (); - } - - protected virtual void CreateDotNetProject () - { - ProcessDotNetProject (); - inputProject.Save (ProjectPath, Harness); - UpdateInfoPList (); - } - - protected virtual void ExecuteInternal () - { - if (IsDotNetProject) { - CreateDotNetProject (); - return; - } - switch (OutputType) { - case "Exe": - CreateExecutableProject (); - break; - case "Library": - CreateLibraryProject (); - break; - default: - throw new Exception (string.Format ("Unknown OutputType: {0}", OutputType)); - } - } - - protected virtual void CalculateName () - { - Name = Path.GetFileName (targetDirectory); - if (string.Equals (Name, "ios", StringComparison.OrdinalIgnoreCase) || string.Equals (Name, "mac", StringComparison.OrdinalIgnoreCase)) - Name = Path.GetFileName (Path.GetDirectoryName (targetDirectory)); - } - - public void Execute () - { - targetDirectory = Path.GetDirectoryName (TemplateProjectPath); - CalculateName (); - - var templateName = Path.GetFileName (TemplateProjectPath); - if (templateName.EndsWith (".template", StringComparison.OrdinalIgnoreCase)) - templateName = Path.GetFileNameWithoutExtension (templateName); - templateName = Path.GetFileNameWithoutExtension (templateName); - - if (!ShouldSkipProjectGeneration) { - inputProject = new XmlDocument (); - inputProject.LoadWithoutNetworkAccess (TemplateProjectPath); - OriginalInfoPListInclude = inputProject.GetInfoPListInclude ()?.Replace ('\\', '/'); - - ProjectPath = Path.Combine (targetDirectory, ProjectsDir, GetTargetSpecificDir (), templateName + ProjectFileSuffix + "." + ProjectFileExtension); - - outputType = inputProject.GetOutputType (); - - if (inputProject.IsDotNetProject ()) { - IsBindingProject = string.Equals (inputProject.GetIsBindingProject (), "true", StringComparison.OrdinalIgnoreCase); - } else { - switch (inputProject.GetImport ()) { - case "$(MSBuildExtensionsPath)\\Xamarin\\iOS\\Xamarin.iOS.CSharp.targets": - case "$(MSBuildExtensionsPath)\\Xamarin\\iOS\\Xamarin.iOS.FSharp.targets": - case "$(MSBuildExtensionsPath)\\Xamarin\\Mac\\Xamarin.Mac.CSharp.targets": - case "$(MSBuildExtensionsPath": - case "$(MSBuildBinPath)\\Microsoft.CSharp.targets": - IsBindingProject = false; - break; - case "$(MSBuildExtensionsPath)\\Xamarin\\iOS\\Xamarin.iOS.ObjCBinding.CSharp.targets": - case "$(MSBuildExtensionsPath)\\Xamarin\\iOS\\Xamarin.iOS.ObjCBinding.FSharp.targets": - case "$(MSBuildExtensionsPath)\\Xamarin\\Mac\\Xamarin.Mac.ObjcBinding.CSharp": - IsBindingProject = true; - break; - default: - throw new Exception (string.Format ("Unknown Imports: {0} in {1}", inputProject.GetImport (), TemplateProjectPath)); - } - } - - ExecuteInternal (); - } else { - ProjectPath = TemplateProjectPath; - } - } - - public virtual IEnumerable GetRelatedProjects () - { - return null; - } - } - - public class RelatedProject { - public string ProjectPath; - public string Guid; } } diff --git a/tests/xharness/Targets/TodayExtensionTarget.cs b/tests/xharness/Targets/TodayExtensionTarget.cs deleted file mode 100644 index 262f053b466f..000000000000 --- a/tests/xharness/Targets/TodayExtensionTarget.cs +++ /dev/null @@ -1,142 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; -using Microsoft.DotNet.XHarness.iOS.Shared.Utilities; -using Microsoft.DotNet.XHarness.iOS.Shared.Hardware; -using Microsoft.DotNet.XHarness.iOS.Shared; - -namespace Xharness.Targets { - public class TodayExtensionTarget : UnifiedTarget { - public string AppName { get; private set; } - public string ExtensionName { get; private set; } - - public string TodayContainerGuid { get; private set; } - public string TodayExtensionGuid { get; private set; } - - public string TodayContainerProjectPath { get; private set; } - public string TodayExtensionProjectPath { get; private set; } - - public override string Suffix { - get { - return "-today"; - } - } - - public override string ExtraLinkerDefsSuffix { - get { - return "-today"; - } - } - - public override string ProjectFileSuffix { - get { - return "-today"; - } - } - - void CreateTodayContainerProject () - { - var csproj = new XmlDocument (); - var suffix = Suffix; - csproj.LoadWithoutNetworkAccess (Path.Combine (Harness.TodayContainerTemplate, "TodayContainer.csproj")); - csproj.SetOutputPath ("bin\\$(Platform)\\$(Configuration)" + suffix, false); - csproj.SetIntermediateOutputPath ("obj\\$(Platform)\\$(Configuration)" + suffix); - csproj.SetProjectReferenceValue ("TodayExtension.csproj", "Name", Path.GetFileNameWithoutExtension (TodayExtensionProjectPath)); - csproj.SetProjectReferenceValue ("TodayExtension.csproj", "Project", TodayExtensionGuid); - csproj.SetProjectReferenceInclude ("TodayExtension.csproj", TodayExtensionProjectPath.Replace ('/', '\\')); - csproj.FixCompileInclude ("Main.cs", Path.Combine (Harness.TodayContainerTemplate, "Main.cs").Replace ('/', '\\')); - csproj.FixInfoPListInclude (suffix, Path.GetDirectoryName (TemplateProjectPath)); - TodayContainerGuid = "{" + Xharness.Harness.Helpers.GenerateStableGuid ().ToString ().ToUpper () + "}"; - ProjectGuid = TodayContainerGuid; - csproj.SetProjectGuid (TodayContainerGuid); - csproj.ResolveAllPaths (Harness.TodayContainerTemplate); - csproj.Save (TodayContainerProjectPath, Harness); - - XmlDocument info_plist = new XmlDocument (); - var target_info_plist = Path.Combine (TargetDirectory, $"Info{suffix}.plist"); - info_plist.LoadWithoutNetworkAccess (Path.Combine (Harness.TodayContainerTemplate, "Info.plist")); - info_plist.SetCFBundleIdentifier (BundleIdentifier); - info_plist.SetCFBundleName (Name); - info_plist.SetMinimumOSVersion (GetMinimumOSVersion (Xamarin.SdkVersions.MiniOS)); - info_plist.Save (target_info_plist, Harness); - } - - void CreateTodayExtensionProject () - { - var csproj = inputProject; - var suffix = Suffix + "-extension"; - csproj.SetProjectTypeGuids ("{EE2C853D-36AF-4FDB-B1AD-8E90477E2198};" + LanguageGuid); - csproj.SetOutputPath ("bin\\$(Platform)\\$(Configuration)" + suffix); - csproj.SetIntermediateOutputPath ("obj\\$(Platform)\\$(Configuration)" + suffix); - csproj.SetImport (IsFSharp ? "$(MSBuildExtensionsPath)\\Xamarin\\iOS\\Xamarin.iOS.AppExtension.FSharp.targets" : "$(MSBuildExtensionsPath)\\Xamarin\\iOS\\Xamarin.iOS.AppExtension.CSharp.targets"); - csproj.FixInfoPListInclude (suffix, Path.GetDirectoryName (TemplateProjectPath)); - csproj.SetOutputType ("Library"); - csproj.AddAdditionalDefines ("XAMCORE_3_0;TODAY_EXTENSION"); - var ext = IsFSharp ? "fs" : "cs"; - csproj.AddCompileInclude ("TodayExtensionMain." + ext, Path.Combine (Harness.TodayExtensionTemplate, "TodayExtensionMain." + ext), true); - csproj.AddInterfaceDefinition (Path.Combine (Harness.TodayExtensionTemplate, "TodayView.storyboard").Replace ('/', '\\')); - csproj.SetExtraLinkerDefs ("extra-linker-defs" + ExtraLinkerDefsSuffix + ".xml"); - csproj.FixProjectReferences (Path.Combine (ProjectsDir, GetTargetSpecificDir ()), "-today", FixProjectReference); - csproj.ResolveAllPaths (TemplateProjectPath); - csproj.Save (TodayExtensionProjectPath, Harness); - - TodayExtensionGuid = csproj.GetProjectGuid (); - - XmlDocument info_plist = new XmlDocument (); - var target_info_plist = Path.Combine (TargetDirectory, $"Info{suffix}.plist"); - var original_info_plist_include = HarnessConfiguration.EvaluateRootTestsDirectory (OriginalInfoPListInclude); - info_plist.LoadWithoutNetworkAccess (Path.Combine (TargetDirectory, original_info_plist_include)); - BundleIdentifier = info_plist.GetCFBundleIdentifier () + "-today"; - info_plist.SetCFBundleIdentifier (BundleIdentifier + ".todayextension"); - info_plist.SetMinimumOSVersion (GetMinimumOSVersion (Xamarin.SdkVersions.MiniOS)); - info_plist.AddPListStringValue ("CFBundlePackageType", "XPC!"); - info_plist.SetCFBundleDisplayName (Name); - info_plist.AddPListKeyValuePair ("NSExtension", "dict", -@" - NSExtensionMainStoryboard - TodayView - NSExtensionPointIdentifier - com.apple.widget-extension - "); - info_plist.Save (target_info_plist, Harness); - } - - protected override void ExecuteInternal () - { - ExtensionName = Name + " Today Extension"; - AppName = Name + " Today"; - - var templateName = Path.GetFileName (TemplateProjectPath); - if (templateName.EndsWith (".template", StringComparison.OrdinalIgnoreCase)) - templateName = Path.GetFileNameWithoutExtension (templateName); - templateName = Path.GetFileNameWithoutExtension (templateName); - - switch (OutputType) { - case "Exe": - TodayExtensionProjectPath = Path.Combine (TargetDirectory, ProjectsDir, GetTargetSpecificDir ("extension"), templateName + Suffix + "-extension." + ProjectFileExtension); - TodayContainerProjectPath = Path.Combine (TargetDirectory, ProjectsDir, GetTargetSpecificDir (), templateName + Suffix + "." + ProjectFileExtension); - CreateTodayExtensionProject (); - CreateTodayContainerProject (); - break; - case "Library": - CreateLibraryProject (); - break; - default: - throw new Exception (string.Format ("Unknown OutputType: {0}", OutputType)); - } - } - - protected override string GetMinimumOSVersion (string templateMinimumOSVersion) - { - return templateMinimumOSVersion; - } - - public override IEnumerable GetRelatedProjects () - { - return new RelatedProject [] { - new RelatedProject { Guid = TodayExtensionGuid, ProjectPath = TodayExtensionProjectPath }, - }; - } - } -} diff --git a/tests/xharness/Targets/UnifiedTarget.cs b/tests/xharness/Targets/UnifiedTarget.cs deleted file mode 100644 index e5d6c138abda..000000000000 --- a/tests/xharness/Targets/UnifiedTarget.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.IO; -using System.Xml; -using Microsoft.DotNet.XHarness.iOS.Shared; -using Microsoft.DotNet.XHarness.iOS.Shared.Hardware; -using Microsoft.DotNet.XHarness.iOS.Shared.Utilities; - -namespace Xharness.Targets { - public class UnifiedTarget : iOSTarget { - public override string Suffix { - get { - return "-ios"; - } - } - - public override string ExtraLinkerDefsSuffix { - get { - return string.Empty; - } - } - - protected override string ProjectTypeGuids { - get { - return "{FEACFBD2-3405-455C-9665-78FE426C6842};" + LanguageGuid; - } - } - - protected override string BindingsProjectTypeGuids { - get { - return "{8FFB629D-F513-41CE-95D2-7ECE97B6EEEC}"; - } - } - - protected override string TargetFrameworkIdentifier { - get { - return "Xamarin.iOS"; - } - } - - protected override string Imports { - get { - return IsFSharp ? "iOS\\Xamarin.iOS.FSharp.targets" : "iOS\\Xamarin.iOS.CSharp.targets"; - } - } - - protected override string BindingsImports { - get { - return IsFSharp ? "iOS\\Xamarin.iOS.ObjCBinding.FSharp.targets" : "iOS\\Xamarin.iOS.ObjCBinding.CSharp.targets"; - } - } - - public override string SimulatorArchitectures { - get { - return "x86_64"; - } - } - - public override string DeviceArchitectures { - get { - return "ARM64"; - } - } - - protected override string GetMinimumOSVersion (string templateMinimumOSVersion) - { - return templateMinimumOSVersion; - } - - protected override int [] UIDeviceFamily { - get { - return new int [] { 1, 2 }; - } - } - - protected override string AdditionalDefines { - get { - return ""; - } - } - - public override bool IsMultiArchitecture { - get { - return true; - } - } - - public override string Platform { - get { - return "ios"; - } - } - - public override string ProjectFileSuffix { - get { - return string.Empty; - } - } - - public override string DotNetSdk => "Microsoft.iOS.Sdk"; - public override string RuntimeIdentifier => "iossimulator-x64"; - public override DevicePlatform ApplePlatform => DevicePlatform.iOS; - public override string TargetFramework => DotNetTfm + "-ios"; - public override string TargetFrameworkForNuGet => "xamarinios10"; - } -} diff --git a/tests/xharness/Targets/WatchOSTarget.cs b/tests/xharness/Targets/WatchOSTarget.cs deleted file mode 100644 index b1490c0df9da..000000000000 --- a/tests/xharness/Targets/WatchOSTarget.cs +++ /dev/null @@ -1,249 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; -using Microsoft.DotNet.XHarness.iOS.Shared; -using Microsoft.DotNet.XHarness.iOS.Shared.Hardware; -using Microsoft.DotNet.XHarness.iOS.Shared.Utilities; - -namespace Xharness.Targets { - public class WatchOSTarget : iOSTarget { - public string AppName { get; private set; } - public string ExtensionName { get; private set; } - - public string WatchOSAppGuid { get; private set; } - public string WatchOSExtensionGuid { get; private set; } - public string WatchOSGuid { get { return ProjectGuid; } private set { ProjectGuid = value; } } - - public string WatchOSAppProjectPath { get; private set; } - public string WatchOSExtensionProjectPath { get; private set; } - public string WatchOSProjectPath { get { return ProjectPath; } private set { ProjectPath = value; } } - - public override string SimulatorArchitectures { - get { return "x86_64"; } - } - - public override string DeviceArchitectures { - get { return "ARM64_32"; } - } - - public override string DotNetSdk => "Microsoft.watchOS.Sdk"; - public override string RuntimeIdentifier => throw new NotImplementedException (); - public override DevicePlatform ApplePlatform => DevicePlatform.watchOS; - public override string TargetFramework => DotNetTfm + "-watchos"; - public override string TargetFrameworkForNuGet => "xamarinwatch10"; - - void CreateWatchOSAppProject () - { - var csproj = new XmlDocument (); - var suffix = Suffix + "-app"; - csproj.LoadWithoutNetworkAccess (Path.Combine (Harness.WatchOSAppTemplate, "App.csproj")); - csproj.FindAndReplace ("%WATCHAPP_PATH%", Path.GetFullPath (Harness.WatchOSAppTemplate).Replace ('/', '\\') + "\\"); - csproj.FindAndReplace ("%WATCHEXTENSION_CSPROJ%", WatchOSExtensionProjectPath); - csproj.SetProjectReferenceValue (WatchOSExtensionProjectPath, "Project", WatchOSExtensionGuid); - csproj.SetProjectReferenceValue (WatchOSExtensionProjectPath, "Name", Path.GetFileNameWithoutExtension (WatchOSExtensionProjectPath)); - WatchOSAppGuid = "{" + Xharness.Harness.Helpers.GenerateStableGuid ().ToString ().ToUpper () + "}"; - csproj.SetProjectGuid (WatchOSAppGuid); - csproj.FixInfoPListInclude (suffix, Path.GetDirectoryName (TemplateProjectPath)); - csproj.ResolveAllPaths (TemplateProjectPath); - csproj.Save (WatchOSAppProjectPath, Harness); - - XmlDocument info_plist = new XmlDocument (); - var target_info_plist = Path.Combine (TargetDirectory, $"Info{Suffix}-app.plist"); - info_plist.LoadWithoutNetworkAccess (Path.Combine (Harness.WatchOSAppTemplate, "Info.plist")); - info_plist.SetCFBundleIdentifier (BundleIdentifier + ".watchkitapp"); - info_plist.SetPListStringValue ("WKCompanionAppBundleIdentifier", BundleIdentifier); - info_plist.SetPListStringValue ("CFBundleName", Name); - info_plist.SetMinimumOSVersion (GetMinimumOSVersion (info_plist.GetMinimumOSVersion ())); - info_plist.Save (target_info_plist, Harness); - } - - void CreateWatchOSContainerProject () - { - var csproj = new XmlDocument (); - csproj.LoadWithoutNetworkAccess (Path.Combine (Harness.WatchOSContainerTemplate, "Container.csproj")); - - csproj.FindAndReplace ("%CONTAINER_PATH%", Path.GetFullPath (Harness.WatchOSContainerTemplate).Replace ('/', '\\') + "\\"); - csproj.FindAndReplace ("%WATCHAPP_CSPROJ%", WatchOSAppProjectPath); - csproj.SetProjectReferenceValue (WatchOSAppProjectPath, "Name", Path.GetFileNameWithoutExtension (WatchOSAppProjectPath)); - WatchOSGuid = "{" + Xharness.Harness.Helpers.GenerateStableGuid ().ToString ().ToUpper () + "}"; - csproj.SetProjectGuid (WatchOSGuid); - csproj.FixInfoPListInclude (Suffix, Path.GetDirectoryName (TemplateProjectPath)); - csproj.ResolveAllPaths (TemplateProjectPath); - csproj.Save (WatchOSProjectPath, Harness); - - XmlDocument info_plist = new XmlDocument (); - var target_info_plist = Path.Combine (TargetDirectory, $"Info{Suffix}.plist"); - info_plist.LoadWithoutNetworkAccess (Path.Combine (Harness.WatchOSContainerTemplate, "Info.plist")); - info_plist.SetCFBundleIdentifier (BundleIdentifier); - info_plist.SetCFBundleName (Name); - info_plist.SetMinimumOSVersion (Xamarin.SdkVersions.MiniOS); - info_plist.Save (target_info_plist, Harness); - } - - void CreateWatchOSExtensionProject () - { - var csproj = inputProject; - var suffix = Suffix + "-extension"; - - csproj.FixArchitectures (SimulatorArchitectures, DeviceArchitectures, "iPhoneSimulator", "Debug"); - csproj.FixArchitectures (SimulatorArchitectures, DeviceArchitectures, "iPhoneSimulator", "Release"); - csproj.FixArchitectures (SimulatorArchitectures, DeviceArchitectures, "iPhone", "Debug"); - csproj.FixArchitectures (SimulatorArchitectures, DeviceArchitectures, "iPhone", "Release"); - - csproj.SetProjectTypeGuids ("{1E2E965C-F6D2-49ED-B86E-418A60C69EEF};" + LanguageGuid); - csproj.SetOutputPath ("bin\\$(Platform)\\$(Configuration)" + suffix); - csproj.SetIntermediateOutputPath ("obj\\$(Platform)\\$(Configuration)" + suffix); - csproj.RemoveTargetFrameworkIdentifier (); - csproj.SetPlatformAssembly ("Xamarin.WatchOS"); - csproj.SetImport (IsFSharp ? "$(MSBuildExtensionsPath)\\Xamarin\\WatchOS\\Xamarin.WatchOS.AppExtension.FSharp.targets" : "$(MSBuildExtensionsPath)\\Xamarin\\WatchOS\\Xamarin.WatchOS.AppExtension.CSharp.targets"); - csproj.FixProjectReferences (Path.Combine (ProjectsDir, GetTargetSpecificDir ()), "-watchos", FixProjectReference); - - csproj.FixInfoPListInclude (suffix, Path.GetDirectoryName (TemplateProjectPath)); - csproj.SetOutputType ("Library"); - csproj.AddAdditionalDefines ("XAMCORE_3_0;FEATURE_NO_BSD_SOCKETS;MONOTOUCH_WATCH;"); - csproj.RemoveReferences ("OpenTK-1.0"); - csproj.RemovePackageReference ("MonoTouch.Dialog"); - var ext = IsFSharp ? "fs" : "cs"; - csproj.AddCompileInclude ("InterfaceController." + ext, Path.Combine (Harness.WatchOSExtensionTemplate, "InterfaceController." + ext)); - csproj.SetExtraLinkerDefs ("extra-linker-defs" + ExtraLinkerDefsSuffix + ".xml"); - csproj.SetMtouchUseBitcode (true, "iPhone", "Release"); - csproj.SetMtouchUseLlvm (true, "iPhone", "Release"); - csproj.ResolveAllPaths (TemplateProjectPath); - - // Not linking a watch extensions requires passing -Os to the native compiler. - // https://github.com/mono/mono/issues/9867 - var configurations = new string [] { "Debug", "Release" }; - foreach (var c in configurations) { - var flags = "-fembed-bitcode-marker"; - if (csproj.GetMtouchLink ("iPhone", c) == "None") - flags += " -Os"; - - csproj.AddExtraMtouchArgs ($"--gcc_flags='{flags}'", "iPhone", c); - } - - csproj.Save (WatchOSExtensionProjectPath, Harness); - - WatchOSExtensionGuid = csproj.GetProjectGuid (); - - XmlDocument info_plist = new XmlDocument (); - var target_info_plist = Path.Combine (TargetDirectory, $"Info{Suffix}-extension.plist"); - var original_info_plist_include = HarnessConfiguration.EvaluateRootTestsDirectory (OriginalInfoPListInclude); - info_plist.LoadWithoutNetworkAccess (Path.Combine (TargetDirectory, original_info_plist_include)); - BundleIdentifier = info_plist.GetCFBundleIdentifier () + "_watch"; - if (BundleIdentifier.Length >= 58) - BundleIdentifier = BundleIdentifier.Substring (0, 57); // If the main app's bundle id is 58 characters (or sometimes more), then the watch extension crashes at launch. radar #29847128. - info_plist.SetCFBundleIdentifier (BundleIdentifier + ".watchkitapp.watchkitextension"); - info_plist.SetMinimumOSVersion (GetMinimumOSVersion (Xamarin.SdkVersions.LegacyMinWatchOS)); - info_plist.SetUIDeviceFamily (4); - info_plist.AddPListStringValue ("RemoteInterfacePrincipleClass", "InterfaceController"); - info_plist.AddPListKeyValuePair ("NSExtension", "dict", string.Format ( -@" - NSExtensionAttributes - - WKAppBundleIdentifier - {0}.watchkitapp - - NSExtensionPointIdentifier - com.apple.watchkit -", BundleIdentifier)); - if (!info_plist.ContainsKey ("NSAppTransportSecurity")) { - info_plist.AddPListKeyValuePair ("NSAppTransportSecurity", "dict", - @" - NSAllowsArbitraryLoads - - "); - } - info_plist.Save (target_info_plist, Harness); - } - - protected override string Imports { - get { - return IsFSharp ? "$(MSBuildExtensionsPath)\\Xamarin\\WatchOS\\Xamarin.WatchOS.FSharp.targets" : "$(MSBuildExtensionsPath)\\Xamarin\\WatchOS\\Xamarin.WatchOS.CSharp.targets"; - } - } - - protected override string BindingsImports { - get { - return IsFSharp ? "$(MSBuildExtensionsPath)\\Xamarin\\WatchOS\\Xamarin.WatchOS.ObjCBinding.FSharp.targets" : "$(MSBuildExtensionsPath)\\Xamarin\\WatchOS\\Xamarin.WatchOS.ObjCBinding.CSharp.targets"; - } - } - - void CreateWatchOSLibraryProject () - { - var csproj = inputProject; - csproj.SetProjectTypeGuids ("{FC940695-DFE0-4552-9F25-99AF4A5619A1};" + LanguageGuid); - csproj.SetOutputPath ("bin\\$(Platform)\\$(Configuration)" + Suffix); - csproj.SetIntermediateOutputPath ("obj\\$(Platform)\\$(Configuration)" + Suffix); - csproj.RemoveTargetFrameworkIdentifier (); - csproj.SetPlatformAssembly ("Xamarin.WatchOS"); - csproj.SetImport (IsBindingProject ? BindingsImports : Imports); - csproj.AddAdditionalDefines ("XAMCORE_3_0;MONOTOUCH_WATCH;"); - csproj.FixProjectReferences (Path.Combine (ProjectsDir, GetTargetSpecificDir ()), Suffix, FixProjectReference); - csproj.RemovePackageReference ("MonoTouch.Dialog"); - csproj.SetExtraLinkerDefs ("extra-linker-defs" + ExtraLinkerDefsSuffix + ".xml"); - csproj.FixTestLibrariesReferences (Platform); - csproj.ResolveAllPaths (TemplateProjectPath); - csproj.Save (WatchOSProjectPath, Harness); - - WatchOSGuid = csproj.GetProjectGuid (); - } - - protected override void ExecuteInternal () - { - ExtensionName = Name + " Extension"; - AppName = Name + " App"; - - var templateName = Path.GetFileName (TemplateProjectPath); - if (templateName.EndsWith (".template", StringComparison.OrdinalIgnoreCase)) - templateName = Path.GetFileNameWithoutExtension (templateName); - templateName = Path.GetFileNameWithoutExtension (templateName); - - switch (OutputType) { - case "Exe": - WatchOSExtensionProjectPath = Path.Combine (TargetDirectory, ProjectsDir, GetTargetSpecificDir ("extension"), templateName + Suffix + "-extension.csproj"); - WatchOSAppProjectPath = Path.Combine (TargetDirectory, ProjectsDir, GetTargetSpecificDir ("app"), templateName + Suffix + "-app.csproj"); - CreateWatchOSExtensionProject (); - CreateWatchOSAppProject (); - CreateWatchOSContainerProject (); - break; - case "Library": - CreateWatchOSLibraryProject (); - break; - default: - throw new Exception (string.Format ("Unknown OutputType: {0}", OutputType)); - } - } - - protected override string GetMinimumOSVersion (string templateMinimumOSVersion) - { - return templateMinimumOSVersion; - } - - public override string Suffix { - get { - return "-watchos"; - } - } - - public override string ExtraLinkerDefsSuffix { - get { - return "-watchos"; - } - } - - public override string Platform { - get { - return "watchos"; - } - } - - public override IEnumerable GetRelatedProjects () - { - return new RelatedProject [] { - new RelatedProject { Guid = WatchOSExtensionGuid, ProjectPath = WatchOSExtensionProjectPath }, - new RelatedProject { Guid = WatchOSAppGuid, ProjectPath = WatchOSAppProjectPath }, - }; - } - } -} diff --git a/tests/xharness/Targets/iOSTarget.cs b/tests/xharness/Targets/iOSTarget.cs deleted file mode 100644 index 208c88a815d3..000000000000 --- a/tests/xharness/Targets/iOSTarget.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.IO; -using System.Xml; -using Microsoft.DotNet.XHarness.iOS.Shared; -using Microsoft.DotNet.XHarness.iOS.Shared.Utilities; - -namespace Xharness.Targets { - // iOS here means Xamarin.iOS, not iOS as opposed to tvOS/watchOS. - public abstract class iOSTarget : Target { - public iOSTestProject TestProject; - - protected override void PostProcessExecutableProject () - { - base.PostProcessExecutableProject (); - - inputProject.FixArchitectures (SimulatorArchitectures, DeviceArchitectures); - inputProject.FixInfoPListInclude (Suffix); - inputProject.SetExtraLinkerDefs ("extra-linker-defs" + ExtraLinkerDefsSuffix + ".xml"); - - ProjectGuid = inputProject.GetProjectGuid (); - } - - protected override void UpdateInfoPList () - { - XmlDocument info_plist = new XmlDocument (); - var target_info_plist = Path.Combine (TargetDirectory, "Info" + Suffix + ".plist"); - var original_info_plist_include = HarnessConfiguration.EvaluateRootTestsDirectory (OriginalInfoPListInclude); - info_plist.LoadWithoutNetworkAccess (Path.Combine (TargetDirectory, original_info_plist_include)); - BundleIdentifier = info_plist.GetCFBundleIdentifier (); - info_plist.SetMinimumOSVersion (GetMinimumOSVersion (info_plist.GetMinimumOSVersion ())); - info_plist.SetUIDeviceFamily (UIDeviceFamily); - info_plist.Save (target_info_plist, Harness); - } - } -} diff --git a/tests/xharness/TestLabel.cs b/tests/xharness/TestLabel.cs index de55a4774f0f..22514fa3e325 100644 --- a/tests/xharness/TestLabel.cs +++ b/tests/xharness/TestLabel.cs @@ -51,23 +51,19 @@ public enum TestLabel : Int64 { Linker = 1 << 15, [Label ("library-projects")] LibraryProjects = 1 << 16, - [Label ("mac-binding-project")] - MacBindingProject = 1 << 17, - [Label ("mmp")] - Mmp = 1 << 18, + // 1 << 17 is unused + // 1 << 18 is unused // 1 << 19 is unused [Label ("monotouch")] Monotouch = 1 << 20, [Label ("msbuild")] Msbuild = 1 << 21, - [Label ("mtouch")] - Mtouch = 1 << 22, + // 1 << 22 is unused [Label ("sampletester")] SampleTester = 1 << 23, [Label ("system-permission")] SystemPermission = 1 << 24, - [Label ("xammac")] - Xammac = 1 << 25, + // 1 << 25 is unused [Label ("xcframework")] Xcframework = 1 << 26, [Label ("xtro")] @@ -100,12 +96,10 @@ public enum PlatformLabel : uint { OldiOSSimulator = 1 << 9, [Label ("tvos")] tvOS = 1 << 10, - [Label ("watchos")] - watchOS = 1 << 11, + // 1 << 11 is unused [Label ("dotnet")] Dotnet = 1 << 12, - [Label ("legacy-xamarin")] - LegacyXamarin = 1 << 13, + // 1 << 13 is unused [Label ("all")] All = 0xFFFFFFFF, } diff --git a/tests/xharness/TestPlatform.cs b/tests/xharness/TestPlatform.cs index c205266a1514..00d45ed9d64c 100644 --- a/tests/xharness/TestPlatform.cs +++ b/tests/xharness/TestPlatform.cs @@ -4,19 +4,8 @@ public enum TestPlatform { All, iOS, - iOS_Unified, - iOS_Unified32, - iOS_Unified64, - iOS_TodayExtension64, tvOS, - watchOS, - watchOS_32, - watchOS_64_32, MacCatalyst, - Mac, - Mac_Modern, - Mac_Full, - Mac_System, } } diff --git a/tests/xharness/TestPlatformExtensions.cs b/tests/xharness/TestPlatformExtensions.cs index 8687615ab3b6..0b062a0e839c 100644 --- a/tests/xharness/TestPlatformExtensions.cs +++ b/tests/xharness/TestPlatformExtensions.cs @@ -8,17 +8,9 @@ public static string GetSimulatorMinVersion (this TestPlatform platform) { switch (platform) { case TestPlatform.iOS: - case TestPlatform.iOS_Unified: - case TestPlatform.iOS_TodayExtension64: - case TestPlatform.iOS_Unified32: - case TestPlatform.iOS_Unified64: return "iOS " + Xamarin.SdkVersions.MiniOSSimulator; case TestPlatform.tvOS: return "tvOS " + Xamarin.SdkVersions.MinTVOSSimulator; - case TestPlatform.watchOS: - case TestPlatform.watchOS_32: - case TestPlatform.watchOS_64_32: - return "watchOS " + Xamarin.SdkVersions.MinWatchOSSimulator; default: throw new NotImplementedException (platform.ToString ()); } @@ -28,9 +20,6 @@ public static bool IsMac (this TestPlatform platform) { switch (platform) { case TestPlatform.Mac: - case TestPlatform.Mac_Modern: - case TestPlatform.Mac_Full: - case TestPlatform.Mac_System: return true; default: return false; @@ -41,10 +30,6 @@ public static bool CanSymlink (this TestPlatform platform) { switch (platform) { case TestPlatform.iOS: - case TestPlatform.iOS_TodayExtension64: - case TestPlatform.iOS_Unified: - case TestPlatform.iOS_Unified32: - case TestPlatform.iOS_Unified64: return true; default: return false; @@ -56,23 +41,12 @@ public static string ToPlatformName (this TestPlatform platform) { switch (platform) { case TestPlatform.iOS: - case TestPlatform.iOS_Unified: - case TestPlatform.iOS_Unified32: - case TestPlatform.iOS_Unified64: - case TestPlatform.iOS_TodayExtension64: return "iOS"; case TestPlatform.tvOS: return "tvOS"; - case TestPlatform.watchOS: - case TestPlatform.watchOS_32: - case TestPlatform.watchOS_64_32: - return "watchOS"; case TestPlatform.MacCatalyst: return "MacCatalyst"; case TestPlatform.Mac: - case TestPlatform.Mac_Modern: - case TestPlatform.Mac_Full: - case TestPlatform.Mac_System: return "macOS"; default: return null; diff --git a/tests/xharness/TestProject.cs b/tests/xharness/TestProject.cs index a645531746c4..e749522c3df9 100644 --- a/tests/xharness/TestProject.cs +++ b/tests/xharness/TestProject.cs @@ -112,22 +112,11 @@ async Task CreateCopyAsync (ILog log, IProcessManager processManager, ITestTask if (test.ProjectPlatform == "iPhone") { switch (test.Platform) { case TestPlatform.iOS: - case TestPlatform.iOS_Unified: - case TestPlatform.iOS_Unified64: - case TestPlatform.iOS_TodayExtension64: doc.SetTopLevelPropertyGroupValue ("RuntimeIdentifier", "ios-arm64"); break; - case TestPlatform.iOS_Unified32: - doc.SetTopLevelPropertyGroupValue ("RuntimeIdentifier", "ios-arm"); - break; case TestPlatform.tvOS: doc.SetTopLevelPropertyGroupValue ("RuntimeIdentifier", "tvos-arm64"); break; - case TestPlatform.watchOS: - case TestPlatform.watchOS_32: - case TestPlatform.watchOS_64_32: - doc.SetTopLevelPropertyGroupValue ("RuntimeIdentifier", "watchos-arm"); - break; } } diff --git a/tests/xharness/TestProjectExtensions.cs b/tests/xharness/TestProjectExtensions.cs index 4190d0becb59..1ebe17f92289 100644 --- a/tests/xharness/TestProjectExtensions.cs +++ b/tests/xharness/TestProjectExtensions.cs @@ -19,31 +19,5 @@ public static TestProject AsTvOSProject (this TestProject self) clone.Path = Path.Combine (Path.GetDirectoryName (self.Path), Target.ProjectsDir, "tvos" + suffix, Path.GetFileNameWithoutExtension (self.Path) + "-tvos" + Path.GetExtension (self.Path)); return clone; } - - public static TestProject AsWatchOSProject (this TestProject self) - { - var clone = self.Clone (); - var fileName = Path.GetFileNameWithoutExtension (self.Path); - clone.Path = Path.Combine (Path.GetDirectoryName (self.Path), Target.ProjectsDir, "watchos", fileName + (fileName.Contains ("-watchos") ? "" : "-watchos") + Path.GetExtension (self.Path)); - return clone; - } - - public static TestProject AsTodayExtensionProject (this TestProject self) - { - var clone = self.Clone (); - clone.Path = Path.Combine (Path.GetDirectoryName (self.Path), Target.ProjectsDir, "today", Path.GetFileNameWithoutExtension (self.Path) + "-today" + Path.GetExtension (self.Path)); - return clone; - } - - // Get the referenced today extension project (if any) - public static TestProject GetTodayExtension (this TestProject self) - { - var extensions = self.Xml.GetExtensionProjectReferences ().ToArray (); - if (!extensions.Any ()) - return null; - if (extensions.Count () != 1) - throw new NotImplementedException (); - return new TestProject (self.Label, Path.GetFullPath (Path.Combine (Path.GetDirectoryName (self.Path), Target.ProjectsDir, "today-extension", extensions.First ().Replace ('\\', '/')))); - } } } diff --git a/tests/xharness/TestTargetExtensions.cs b/tests/xharness/TestTargetExtensions.cs index 08f86dd0fe77..1d5eadab3d21 100644 --- a/tests/xharness/TestTargetExtensions.cs +++ b/tests/xharness/TestTargetExtensions.cs @@ -10,16 +10,7 @@ public static TestTarget [] GetAppRunnerTargets (this TestPlatform platform) switch (platform) { case TestPlatform.tvOS: return new TestTarget [] { TestTarget.Simulator_tvOS }; - case TestPlatform.watchOS: - case TestPlatform.watchOS_32: - case TestPlatform.watchOS_64_32: - return new TestTarget [] { TestTarget.Simulator_watchOS }; - case TestPlatform.iOS_Unified: - return new TestTarget [] { TestTarget.Simulator_iOS64 }; - case TestPlatform.iOS_Unified32: - throw new NotSupportedException ($"32-bit simulators aren't supported anymore."); - case TestPlatform.iOS_Unified64: - case TestPlatform.iOS_TodayExtension64: + case TestPlatform.iOS: return new TestTarget [] { TestTarget.Simulator_iOS64 }; default: throw new NotImplementedException (platform.ToString ()); @@ -31,7 +22,6 @@ public static TestTargetOs GetTargetOs (this TestTarget target, bool minVersion) return target switch { TestTarget.Simulator_iOS64 => new TestTargetOs (target, minVersion ? Xamarin.SdkVersions.MiniOSSimulator : Xamarin.SdkVersions.MaxiOSSimulator), TestTarget.Simulator_tvOS => new TestTargetOs (target, minVersion ? Xamarin.SdkVersions.MinTVOSSimulator : Xamarin.SdkVersions.MaxTVOSSimulator), - TestTarget.Simulator_watchOS => new TestTargetOs (target, minVersion ? Xamarin.SdkVersions.MinWatchOSSimulator : Xamarin.SdkVersions.MaxWatchOSSimulator), _ => throw new Exception (string.Format ("Invalid simulator target: {0}", target)) }; diff --git a/tests/xharness/Xharness.Tests/Jenkins/JenkinsDeviceLoadterTests.cs b/tests/xharness/Xharness.Tests/Jenkins/JenkinsDeviceLoadterTests.cs index c631410a3ff2..f6cd6d2c5ebd 100644 --- a/tests/xharness/Xharness.Tests/Jenkins/JenkinsDeviceLoadterTests.cs +++ b/tests/xharness/Xharness.Tests/Jenkins/JenkinsDeviceLoadterTests.cs @@ -27,7 +27,6 @@ public static IEnumerable GetDeviceTestCases { devices.Setup (d => d.Connected32BitIOS).Returns (Array.Empty ()); devices.Setup (d => d.Connected64BitIOS).Returns (Array.Empty ()); devices.Setup (d => d.ConnectedTV).Returns (Array.Empty ()); - devices.Setup (d => d.ConnectedWatch).Returns (Array.Empty ()); yield return new TestCaseData (simulators.Object, devices.Object, $"Device Listing (ok - no devices found)."); @@ -36,7 +35,6 @@ public static IEnumerable GetDeviceTestCases { devices.Setup (d => d.Connected32BitIOS).Returns (new IHardwareDevice [] { aDevice.Object }); devices.Setup (d => d.Connected64BitIOS).Returns (Array.Empty ()); devices.Setup (d => d.ConnectedTV).Returns (Array.Empty ()); - devices.Setup (d => d.ConnectedWatch).Returns (Array.Empty ()); yield return new TestCaseData (simulators.Object, devices.Object, $"Device Listing (ok). Devices types are: iOS 32 bit"); @@ -44,7 +42,6 @@ public static IEnumerable GetDeviceTestCases { devices.Setup (d => d.Connected32BitIOS).Returns (new IHardwareDevice [] { aDevice.Object }); devices.Setup (d => d.Connected64BitIOS).Returns (new IHardwareDevice [] { aDevice.Object }); devices.Setup (d => d.ConnectedTV).Returns (Array.Empty ()); - devices.Setup (d => d.ConnectedWatch).Returns (Array.Empty ()); yield return new TestCaseData (simulators.Object, devices.Object, $"Device Listing (ok). Devices types are: iOS 32 bit, iOS 64 bit"); @@ -52,15 +49,13 @@ public static IEnumerable GetDeviceTestCases { devices.Setup (d => d.Connected32BitIOS).Returns (new IHardwareDevice [] { aDevice.Object }); devices.Setup (d => d.Connected64BitIOS).Returns (new IHardwareDevice [] { aDevice.Object }); devices.Setup (d => d.ConnectedTV).Returns (new IHardwareDevice [] { aDevice.Object }); - devices.Setup (d => d.ConnectedWatch).Returns (Array.Empty ()); yield return new TestCaseData (simulators.Object, devices.Object, $"Device Listing (ok). Devices types are: iOS 32 bit, iOS 64 bit, tvOS"); devices = new Mock (); devices.Setup (d => d.Connected32BitIOS).Returns (new IHardwareDevice [] { aDevice.Object }); devices.Setup (d => d.Connected64BitIOS).Returns (new IHardwareDevice [] { aDevice.Object }); devices.Setup (d => d.ConnectedTV).Returns (new IHardwareDevice [] { aDevice.Object }); - devices.Setup (d => d.ConnectedWatch).Returns (new IHardwareDevice [] { aDevice.Object }); - yield return new TestCaseData (simulators.Object, devices.Object, $"Device Listing (ok). Devices types are: iOS 32 bit, iOS 64 bit, tvOS, watchOS"); + yield return new TestCaseData (simulators.Object, devices.Object, $"Device Listing (ok). Devices types are: iOS 32 bit, iOS 64 bit, tvOS"); } } diff --git a/tests/xharness/Xharness.Tests/Jenkins/MakeTestTaskEnumerableTests.cs b/tests/xharness/Xharness.Tests/Jenkins/MakeTestTaskEnumerableTests.cs deleted file mode 100644 index ddd6a76df976..000000000000 --- a/tests/xharness/Xharness.Tests/Jenkins/MakeTestTaskEnumerableTests.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Linq; -using Microsoft.DotNet.XHarness.iOS.Shared; -using Microsoft.DotNet.XHarness.iOS.Shared.Execution; -using Microsoft.DotNet.XHarness.iOS.Shared.Listeners; -using Moq; -using NUnit.Framework; -using Xharness.Jenkins; - -namespace Xharness.Tests.Jenkins { - - [TestFixture] - public class MakeTestTaskEnumerableTests { - - Mock processManager; - Mock resultParser; - Mock tunnel; - - Harness harness; - HarnessConfiguration configuration; - Xharness.Jenkins.Jenkins jenkins; - MakeTestTaskEnumerable factory; - - [SetUp] - public void SetUp () - { - processManager = new Mock (); - resultParser = new Mock (); - tunnel = new Mock (); - configuration = new HarnessConfiguration (); - harness = new Harness (resultParser.Object, HarnessAction.Jenkins, configuration); - jenkins = new Xharness.Jenkins.Jenkins (harness, processManager.Object, resultParser.Object, tunnel.Object); - - factory = new MakeTestTaskEnumerable (jenkins, processManager.Object); - } - - [TearDown] - public void TearDown () - { - processManager = null; - resultParser = null; - configuration = null; - harness = null; - jenkins = null; - factory = null; - } - - [TestCase ("MMP Regression Tests")] - [TestCase ("Mac Binding Projects")] - [TestCase ("Documentation")] - public void ContainsTest (string testName) - => Assert.True (factory.Select (t => t.TestName == testName).Any (), testName); - - [Test] - public void CountTest () - => Assert.AreEqual (3, factory.Count (), "Added or removed tests?"); - } -} diff --git a/tests/xharness/Xharness.Tests/Jenkins/TestSelectionTests.cs b/tests/xharness/Xharness.Tests/Jenkins/TestSelectionTests.cs index a1158a88d1c7..900cda0407a4 100644 --- a/tests/xharness/Xharness.Tests/Jenkins/TestSelectionTests.cs +++ b/tests/xharness/Xharness.Tests/Jenkins/TestSelectionTests.cs @@ -34,9 +34,6 @@ public void DefaultSelectionTest () Assert.IsTrue (selection.SelectedPlatforms.HasFlag (PlatformLabel.tvOS), "tvos"); Assert.IsTrue (selection.IsEnabled (PlatformLabel.tvOS), "IsEnabled (tvOS)"); - Assert.IsTrue (selection.SelectedPlatforms.HasFlag (PlatformLabel.watchOS), "watchOS"); - Assert.IsTrue (selection.IsEnabled (PlatformLabel.watchOS), "IsEnabled (watchOS)"); - Assert.IsTrue (selection.SelectedPlatforms.HasFlag (PlatformLabel.iOS), "iOS"); Assert.IsTrue (selection.IsEnabled (PlatformLabel.iOS), "IsEnabled (iOS)"); diff --git a/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/AssemblyLocatorTest.cs b/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/AssemblyLocatorTest.cs index 9262469a9ca6..98933167fb6d 100644 --- a/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/AssemblyLocatorTest.cs +++ b/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/AssemblyLocatorTest.cs @@ -5,7 +5,7 @@ namespace Xharness.Tests.TestImporter.Xamarin.Tests { - // very simple class, but we want to make sure that iOS, tvOS, watchOS get the iosDownload and the mac + // very simple class, but we want to make sure that iOS, tvOS get the iosDownload and the mac // versions get the mac download [TestFixture] public class AssemblyLocatorTest { @@ -19,18 +19,7 @@ public class AssemblyLocatorTest { [TestCase (Platform.iOS, iOSPath)] [TestCase (Platform.TvOS, iOSPath)] - [TestCase (Platform.WatchOS, iOSPath)] - [TestCase (Platform.MacOSFull, macOSPath)] - [TestCase (Platform.MacOSModern, macOSPath)] public void GetAssembliesRootLocationTest (Platform platform, string expected) => Assert.AreEqual (expected, assemblyLocator.GetAssembliesRootLocation (platform)); - - [TestCase (Platform.iOS, iOSPath, "ios-bcl", "monotouch", "tests")] - [TestCase (Platform.TvOS, iOSPath, "ios-bcl", "monotouch_tv", "tests")] - [TestCase (Platform.WatchOS, iOSPath, "ios-bcl", "monotouch_watch", "tests")] - [TestCase (Platform.MacOSFull, macOSPath, "mac-bcl", "xammac_net_4_5", "tests")] - public void GetAssembliesLocation (Platform platform, params string [] expected) - => Assert.AreEqual (Path.Combine (expected), assemblyLocator.GetAssembliesLocation (platform)); - } } diff --git a/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/XamariniOSTemplateTest.cs b/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/XamariniOSTemplateTest.cs index 4eab2c86148e..c58af8e9e845 100644 --- a/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/XamariniOSTemplateTest.cs +++ b/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/XamariniOSTemplateTest.cs @@ -42,10 +42,7 @@ public void TearDown () template = null; } [TestCase ("iOSProject", Platform.iOS, "iOSProject.csproj")] - [TestCase ("WatchOSProject", Platform.WatchOS, "WatchOSProject-watchos.csproj")] [TestCase ("TvOSProject", Platform.TvOS, "TvOSProject-tvos.csproj")] - [TestCase ("macOSProject", Platform.MacOSFull, "macOSProject-mac-full.csproj")] - [TestCase ("macOSProject", Platform.MacOSModern, "macOSProject-mac-modern.csproj")] public void GetProjectPathTest (string projectName, Platform platform, string expectedName) { // ignore the fact that all params are the same, we do not care @@ -53,34 +50,14 @@ public void GetProjectPathTest (string projectName, Platform platform, string ex Assert.AreEqual (Path.Combine (template.OutputDirectoryPath, "generated", platform.ToString (), projectName, expectedName), path); } - [TestCase ("WatchApp", WatchAppType.App, "WatchApp-watchos-app.csproj")] - [TestCase ("WatchExtension", WatchAppType.Extension, "WatchExtension-watchos-extension.csproj")] - public void GetProjectPathWatchOSTest (string projectName, WatchAppType appType, string expectedName) - { - // ignore the fact that all params are the same, we do not care - var path = template.GetProjectPath (projectName, appType); - Assert.AreEqual (Path.Combine (template.OutputDirectoryPath, "generated", Platform.WatchOS.ToString (), projectName, appType.ToString ().ToLowerInvariant (), expectedName), path); - } - [TestCase ("/usr/path", Platform.iOS, "Info.plist")] [TestCase ("/usr/second/path", Platform.TvOS, "Info-tvos.plist")] - [TestCase ("/usr/other/path", Platform.WatchOS, "Info-watchos.plist")] - [TestCase ("/usr/other/path", Platform.MacOSFull, "Info-mac.plist")] - [TestCase ("/usr/other/path", Platform.MacOSModern, "Info-mac.plist")] public void GetPListPathTest (string rootDir, Platform platform, string expectedName) { var path = XamariniOSTemplate.GetPListPath (rootDir, platform); Assert.AreEqual (Path.Combine (rootDir, expectedName), path); } - [TestCase ("/usr/bin", WatchAppType.App, "Info-watchos-app.plist")] - [TestCase ("/usr/local", WatchAppType.Extension, "Info-watchos-extension.plist")] - public void GetPListPathWatchOSTest (string rootDir, WatchAppType appType, string expectedName) - { - var path = XamariniOSTemplate.GetPListPath (rootDir, appType); - Assert.AreEqual (Path.Combine (rootDir, expectedName), path); - } - [TestCase ("System.Xml.dll")] [TestCase ("MyAssembly.dll")] public void GetReferenceNodeNullHintTest (string assembly) diff --git a/tests/xharness/Xharness.Tests/Tests/MacFlavorsExtensionsTests.cs b/tests/xharness/Xharness.Tests/Tests/MacFlavorsExtensionsTests.cs deleted file mode 100644 index b9def59cd83d..000000000000 --- a/tests/xharness/Xharness.Tests/Tests/MacFlavorsExtensionsTests.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.DotNet.XHarness.iOS.Shared; -using NUnit.Framework; - -namespace Xharness.Tests.Tests { - - [TestFixture] - public class MacFlavorsExtensionsTests { - - [TestCase (MacFlavors.Console, TestPlatform.Mac)] - [TestCase (MacFlavors.Full, TestPlatform.Mac_Full)] - [TestCase (MacFlavors.Modern, TestPlatform.Mac_Modern)] - [TestCase (MacFlavors.System, TestPlatform.Mac_System)] - public void ToTestPlatformTest (MacFlavors flavor, TestPlatform expected) - => Assert.AreEqual (flavor.ToTestPlatform (), expected); - } -} diff --git a/tests/xharness/Xharness.Tests/Tests/TestPlatformExtensionsTests.cs b/tests/xharness/Xharness.Tests/Tests/TestPlatformExtensionsTests.cs index d925fd696742..f18dcf10b3d6 100644 --- a/tests/xharness/Xharness.Tests/Tests/TestPlatformExtensionsTests.cs +++ b/tests/xharness/Xharness.Tests/Tests/TestPlatformExtensionsTests.cs @@ -10,19 +10,10 @@ public class TestPlatformExtensionsTests { public class TestCasesData { public static IEnumerable GetSimulatorTestCases { get { - foreach (var platform in new [] { TestPlatform.iOS, - TestPlatform.iOS_Unified, - TestPlatform.iOS_TodayExtension64, - TestPlatform.iOS_Unified32, - TestPlatform.iOS_Unified64,}) { + foreach (var platform in new [] { TestPlatform.iOS }) { yield return new TestCaseData (platform).Returns ("iOS " + Xamarin.SdkVersions.MiniOSSimulator); } yield return new TestCaseData (TestPlatform.tvOS).Returns ("tvOS " + Xamarin.SdkVersions.MinTVOSSimulator); - foreach (var platform in new [] { TestPlatform.watchOS, - TestPlatform.watchOS_32, - TestPlatform.watchOS_64_32}) { - yield return new TestCaseData (platform).Returns ("watchOS " + Xamarin.SdkVersions.MinWatchOSSimulator); - } } } @@ -32,21 +23,11 @@ public static IEnumerable IsMacTestCases { foreach (var platform in new [] { TestPlatform.None, TestPlatform.All, TestPlatform.iOS, - TestPlatform.iOS_Unified, - TestPlatform.iOS_Unified32, - TestPlatform.iOS_Unified64, - TestPlatform.iOS_TodayExtension64, - TestPlatform.tvOS, - TestPlatform.watchOS, - TestPlatform.watchOS_32, - TestPlatform.watchOS_64_32 }) { + TestPlatform.tvOS }) { yield return new TestCaseData (platform).Returns (false); } - foreach (var platform in new [] { TestPlatform.Mac, - TestPlatform.Mac_Modern, - TestPlatform.Mac_Full, - TestPlatform.Mac_System }) { + foreach (var platform in new [] { TestPlatform.Mac }) { yield return new TestCaseData (platform).Returns (true); } } @@ -54,24 +35,14 @@ public static IEnumerable IsMacTestCases { public static IEnumerable CanSymlinkTestCases { get { - foreach (var platform in new [] { TestPlatform.iOS, - TestPlatform.iOS_TodayExtension64, - TestPlatform.iOS_Unified, - TestPlatform.iOS_Unified32, - TestPlatform.iOS_Unified64 }) { + foreach (var platform in new [] { TestPlatform.iOS }) { yield return new TestCaseData (platform).Returns (true); } foreach (var platform in new [] {TestPlatform.None, TestPlatform.tvOS, - TestPlatform.watchOS, - TestPlatform.watchOS_32, - TestPlatform.watchOS_64_32, - TestPlatform.Mac, - TestPlatform.Mac_Modern, - TestPlatform.Mac_Full, - TestPlatform.Mac_System}) { + TestPlatform.Mac }) { yield return new TestCaseData (platform).Returns (false); } } diff --git a/tests/xharness/Xharness.Tests/Tests/TestTargetExtensionsTests.cs b/tests/xharness/Xharness.Tests/Tests/TestTargetExtensionsTests.cs index 0722b6fb4c39..64efc73be642 100644 --- a/tests/xharness/Xharness.Tests/Tests/TestTargetExtensionsTests.cs +++ b/tests/xharness/Xharness.Tests/Tests/TestTargetExtensionsTests.cs @@ -9,12 +9,6 @@ namespace Xharness.Tests.Tests { public class TestTargetExtensionsTests { [TestCase (TestPlatform.tvOS, new [] { TestTarget.Simulator_tvOS })] - [TestCase (TestPlatform.watchOS, new [] { TestTarget.Simulator_watchOS })] - [TestCase (TestPlatform.watchOS_32, new [] { TestTarget.Simulator_watchOS })] - [TestCase (TestPlatform.watchOS_64_32, new [] { TestTarget.Simulator_watchOS })] - [TestCase (TestPlatform.iOS_Unified, new [] { TestTarget.Simulator_iOS64 })] - [TestCase (TestPlatform.iOS_Unified64, new [] { TestTarget.Simulator_iOS64 })] - [TestCase (TestPlatform.iOS_TodayExtension64, new [] { TestTarget.Simulator_iOS64 })] public void GetAppRunnerTargetsTest (TestPlatform platform, TestTarget [] expectedTargets) { var targets = platform.GetAppRunnerTargets (); diff --git a/tests/xharness/Xharness.Tests/Xharness.Tests.csproj b/tests/xharness/Xharness.Tests/Xharness.Tests.csproj index c443b6eff265..aa9e19d2f69c 100644 --- a/tests/xharness/Xharness.Tests/Xharness.Tests.csproj +++ b/tests/xharness/Xharness.Tests/Xharness.Tests.csproj @@ -16,8 +16,6 @@ - - diff --git a/tests/xharness/iOSTestProject.cs b/tests/xharness/iOSTestProject.cs index 6d8a9cf2c214..ec6f171726a4 100644 --- a/tests/xharness/iOSTestProject.cs +++ b/tests/xharness/iOSTestProject.cs @@ -4,15 +4,12 @@ namespace Xharness { public class iOSTestProject : TestProject { public bool SkipiOSVariation; - public bool SkipwatchOSVariation; // skip both - public bool SkipwatchOSARM64_32Variation; public bool SkiptvOSVariation; - public bool SkipTodayExtensionVariation; public bool SkipDeviceVariations; public bool BuildOnly; - public iOSTestProject (TestLabel label, string path, bool isExecutableProject = true) - : base (label, path, isExecutableProject) + public iOSTestProject (TestLabel label, string path) + : base (label, path, true) { Name = System.IO.Path.GetFileNameWithoutExtension (path); } @@ -24,17 +21,14 @@ public bool IsSupported (DevicePlatform devicePlatform, string productVersion) public override TestProject Clone () { - return CompleteClone (new iOSTestProject (Label, Path, IsExecutableProject)); + return CompleteClone (new iOSTestProject (Label, Path)); } protected override TestProject CompleteClone (TestProject project) { var rv = (iOSTestProject) project; rv.SkipiOSVariation = SkipiOSVariation; - rv.SkipwatchOSVariation = SkipwatchOSVariation; - rv.SkipwatchOSARM64_32Variation = SkipwatchOSARM64_32Variation; rv.SkiptvOSVariation = SkiptvOSVariation; - rv.SkipTodayExtensionVariation = SkipTodayExtensionVariation; rv.SkipDeviceVariations = SkipDeviceVariations; rv.BuildOnly = BuildOnly; return base.CompleteClone (rv); diff --git a/tests/xharness/xharness.csproj b/tests/xharness/xharness.csproj index 1fb000b19799..7899035397d6 100644 --- a/tests/xharness/xharness.csproj +++ b/tests/xharness/xharness.csproj @@ -26,15 +26,11 @@ Project - --verbose --jenkins --autoconf --rootdir .. --label=skip-mac-tests,skip-ios-simulator-tests,skip-ios-msbuild-tests,skip-system-permission-tests,run-ios-device-tests,run-ios-extensions-tests --markdown-summary=../TestSummary.md --label=run-watchos-tests + --verbose --jenkins --autoconf --rootdir .. --label=skip-mac-tests,skip-ios-simulator-tests,skip-ios-msbuild-tests,skip-system-permission-tests,run-ios-device-tests,run-ios-extensions-tests --markdown-summary=../TestSummary.md - - Project - --configure --autoconf --rootdir ../../../.. - @@ -56,7 +52,6 @@ - @@ -108,14 +103,7 @@ - - - - - - - diff --git a/tools/devops/automation/scripts/TestConfiguration.Tests.ps1 b/tools/devops/automation/scripts/TestConfiguration.Tests.ps1 index 92078785fa09..b60750abc45c 100644 --- a/tools/devops/automation/scripts/TestConfiguration.Tests.ps1 +++ b/tools/devops/automation/scripts/TestConfiguration.Tests.ps1 @@ -153,6 +153,7 @@ Describe 'Get-TestConfiguration' { "TEST_PREFIX": "test-prefix_monotouchtest_tvos", "TEST_PLATFORM": "tvOS", "TEST_FILTER": "Category != MultiPlatform" + } } "@ @@ -195,6 +196,7 @@ Describe 'Get-TestConfiguration' { "TEST_PREFIX": "test-prefix_monotouchtest_ios", "TEST_PLATFORM": "iOS", "TEST_FILTER": "Category != MultiPlatform" + } } "@ @@ -219,6 +221,7 @@ Describe 'Get-TestConfiguration' { "STATUS_CONTEXT": "status-context - cecil", "TEST_PREFIX": "test-prefix_cecil", "TEST_PLATFORM": "" + } } "@ } @@ -306,6 +309,7 @@ Describe 'Get-TestConfiguration' { "TEST_PREFIX": "test-prefix_monotouchtest_maccatalyst", "TEST_PLATFORM": "MacCatalyst", "TEST_FILTER": "Category != MultiPlatform" + } } "@ } diff --git a/tools/devops/automation/scripts/TestResults.Tests.ps1 b/tools/devops/automation/scripts/TestResults.Tests.ps1 index f73f03020875..bf9c580358be 100644 --- a/tools/devops/automation/scripts/TestResults.Tests.ps1 +++ b/tools/devops/automation/scripts/TestResults.Tests.ps1 @@ -18,7 +18,7 @@ Describe "TestResults tests" { { "dotnettests_ios": { "LABEL": "dotnettests", - "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-watchos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-legacy-xamarin-tests,run-dotnettests-tests", + "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-dotnettests-tests", "LABEL_WITH_PLATFORM": "dotnettests_iOS", "STATUS_CONTEXT": "VSTS: simulator tests - dotnettests - iOS", "TEST_simulator_tests": "simulator_dotnettests_ios", @@ -27,7 +27,7 @@ Describe "TestResults tests" { }, "dotnettests_tvos": { "LABEL": "dotnettests", - "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-watchos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-legacy-xamarin-tests,run-dotnettests-tests", + "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-dotnettests-tests", "LABEL_WITH_PLATFORM": "dotnettests_tvOS", "STATUS_CONTEXT": "VSTS: simulator tests - dotnettests - tvOS", "TEST_simulator_tests": "simulator_dotnettests_tvos", @@ -36,7 +36,7 @@ Describe "TestResults tests" { }, "dotnettests_maccatalyst": { "LABEL": "dotnettests", - "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-watchos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-legacy-xamarin-tests,run-dotnettests-tests", + "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-dotnettests-tests", "LABEL_WITH_PLATFORM": "dotnettests_MacCatalyst", "STATUS_CONTEXT": "VSTS: simulator tests - dotnettests - MacCatalyst", "TEST_simulator_tests": "simulator_dotnettests_maccatalyst", @@ -45,7 +45,7 @@ Describe "TestResults tests" { }, "dotnettests_macos": { "LABEL": "dotnettests", - "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-watchos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-legacy-xamarin-tests,run-dotnettests-tests", + "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-dotnettests-tests", "LABEL_WITH_PLATFORM": "dotnettests_macOS", "STATUS_CONTEXT": "VSTS: simulator tests - dotnettests - macOS", "TEST_simulator_tests": "simulator_dotnettests_macos", @@ -54,7 +54,7 @@ Describe "TestResults tests" { }, "dotnettests_multiple": { "LABEL": "dotnettests", - "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-watchos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-legacy-xamarin-tests,run-dotnettests-tests", + "TESTS_LABELS": "--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-dotnettests-tests", "LABEL_WITH_PLATFORM": "dotnettests_Multiple", "STATUS_CONTEXT": "VSTS: simulator tests - dotnettests - Multiple", "TEST_simulator_tests": "simulator_dotnettests_multiple", @@ -64,7 +64,7 @@ Describe "TestResults tests" { "cecil": { "LABEL": "cecil", - "TESTS_LABELS": "--label=skip-all-tests,run-ios-64-tests,run-ios-simulator-tests,run-tvos-tests,run-watchos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-legacy-xamarin-tests,run-cecil-tests", + "TESTS_LABELS": "--label=skip-all-tests,run-ios-64-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-cecil-tests", "LABEL_WITH_PLATFORM": "cecil", "STATUS_CONTEXT": "VSTS: simulator tests - cecil", "TEST_simulator_tests": "simulator_cecil", diff --git a/tools/devops/automation/scripts/VSTS.psm1 b/tools/devops/automation/scripts/VSTS.psm1 index 716e2f070986..440929afe300 100644 --- a/tools/devops/automation/scripts/VSTS.psm1 +++ b/tools/devops/automation/scripts/VSTS.psm1 @@ -488,7 +488,7 @@ class BuildConfiguration { # if xamarin legacy has been included, check if we need to include the xamarin sdk for each of the platforms, otherewise it will be # false for all - $xamarinPlatforms = @("ios", "macos", "tvos", "watchos", "maccatalyst") + $xamarinPlatforms = @("ios", "macos", "tvos", "maccatalyst") if ($configuration.INCLUDE_XAMARIN_LEGACY -eq "true") { foreach ($platform in $xamarinPlatforms) { $variableName = "INCLUDE_LEGACY_$($platform.ToUpper())" diff --git a/tools/devops/automation/templates/api-diff-stage.yml b/tools/devops/automation/templates/api-diff-stage.yml index 3fb0a7a00cb9..33496b6eb59a 100644 --- a/tools/devops/automation/templates/api-diff-stage.yml +++ b/tools/devops/automation/templates/api-diff-stage.yml @@ -67,7 +67,7 @@ stages: parameters: repositoryAlias: ${{ parameters.repositoryAlias }} commit: ${{ parameters.commit }} - testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-watchos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-legacy-xamarin-tests' + testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests' statusContext: 'VSTS: simulator tests' uploadArtifacts: true use1ES: false diff --git a/tools/devops/automation/templates/main-stage.yml b/tools/devops/automation/templates/main-stage.yml index 9a53e3f0e5de..1481d120804c 100644 --- a/tools/devops/automation/templates/main-stage.yml +++ b/tools/devops/automation/templates/main-stage.yml @@ -228,7 +228,7 @@ stages: commit: ${{ parameters.commit }} testConfigurations: ${{ parameters.testConfigurations }} supportedPlatforms: ${{ parameters.supportedPlatforms }} - testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-watchos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-legacy-xamarin-tests' + testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests' statusContext: 'VSTS: simulator tests' uploadArtifacts: true use1ES: true diff --git a/tools/devops/automation/templates/pipelines/run-api-scan.yml b/tools/devops/automation/templates/pipelines/run-api-scan.yml index 14f6ae850785..3b493eb6a157 100644 --- a/tools/devops/automation/templates/pipelines/run-api-scan.yml +++ b/tools/devops/automation/templates/pipelines/run-api-scan.yml @@ -119,7 +119,7 @@ stages: commit: HEAD testConfigurations: ${{ parameters.testConfigurations }} supportedPlatforms: ${{ parameters.supportedPlatforms }} - testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-watchos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-legacy-xamarin-tests' + testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests' statusContext: 'VSTS: simulator tests' uploadArtifacts: true diff --git a/tools/devops/automation/templates/pipelines/run-macos-tests-pipeline.yml b/tools/devops/automation/templates/pipelines/run-macos-tests-pipeline.yml index 30aefb1eabde..c596c8ebdab9 100644 --- a/tools/devops/automation/templates/pipelines/run-macos-tests-pipeline.yml +++ b/tools/devops/automation/templates/pipelines/run-macos-tests-pipeline.yml @@ -238,7 +238,7 @@ stages: commit: ${{ parameters.commit }} testConfigurations: ${{ parameters.testConfigurations }} supportedPlatforms: ${{ parameters.supportedPlatforms }} - testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-watchos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-legacy-xamarin-tests' + testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests' statusContext: 'VSTS: simulator tests' uploadArtifacts: true diff --git a/tools/devops/automation/templates/tests-stage.yml b/tools/devops/automation/templates/tests-stage.yml index 8916e575cf35..f9f4eca20bb1 100644 --- a/tools/devops/automation/templates/tests-stage.yml +++ b/tools/devops/automation/templates/tests-stage.yml @@ -202,7 +202,7 @@ stages: commit: ${{ parameters.commit }} testConfigurations: ${{ parameters.testConfigurations }} supportedPlatforms: ${{ parameters.supportedPlatforms }} - testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-watchos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests,run-legacy-xamarin-tests' + testsLabels: '--label=skip-all-tests,run-ios-tests,run-ios-simulator-tests,run-tvos-tests,run-mac-tests,run-maccatalyst-tests,run-dotnet-tests,run-system-permission-tests' statusContext: 'VSTS: simulator tests' uploadArtifacts: true