xamarin-macios/tests/xharness/TestPlatformExtensions.cs

55 строки
1.3 KiB
C#

using System;
using Microsoft.DotNet.XHarness.iOS.Shared;
namespace Xharness {
public static class TestPlatformExtensions {
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 " + SdkVersions.MiniOSSimulator;
case TestPlatform.tvOS:
return "tvOS " + SdkVersions.MinTVOSSimulator;
case TestPlatform.watchOS:
case TestPlatform.watchOS_32:
case TestPlatform.watchOS_64_32:
return "watchOS " + SdkVersions.MinWatchOSSimulator;
default:
throw new NotImplementedException (platform.ToString ());
}
}
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;
}
}
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;
}
}
}
}