internal static Runtime GetCurrentRuntime()
        {
            //do not change the order of conditions because it may cause incorrect determination of runtime
            if (IsMono)
            {
                return(MonoRuntime.Default);
            }
            if (IsFullFramework)
            {
                return(ClrRuntime.GetCurrentVersion());
            }
            if (IsWasm)
            {
                return(WasmRuntime.Default);
            }
            if (IsNetCore)
            {
                return(CoreRuntime.GetCurrentVersion());
            }
            if (IsCoreRT)
            {
                return(CoreRtRuntime.GetCurrentVersion());
            }

            throw new NotSupportedException("Unknown .NET Runtime");
        }
        public void LatestCoreRtVersionIsSupported()
        {
            if (!RuntimeInformation.Is64BitPlatform()) // CoreRT does not support 32bit yet
            {
                return;
            }

            var config = ManualConfig.CreateEmpty()
                         .AddJob(Job.Dry
                                 .WithRuntime(CoreRtRuntime.GetCurrentVersion())); // we test against latest version for current TFM to make sure we avoid issues like #1055

            CanExecute <CoreRtBenchmark>(config);
        }
예제 #3
0
        public void LatestCoreRtVersionIsSupported()
        {
            if (!RuntimeInformation.Is64BitPlatform()) // CoreRT does not support 32bit yet
            {
                return;
            }

            var config = ManualConfig.CreateEmpty()
                         .AddJob(Job.Dry
                                 .WithRuntime(CoreRtRuntime.GetCurrentVersion())
                                 .WithToolchain(CoreRtToolchain.CreateBuilder()
                                                .UseCoreRtNuGet(microsoftDotNetILCompilerVersion: "1.0.0-alpha-*") // we test against latest version to make sure we support latest version and avoid issues like #1055
                                                .ToToolchain()));

            CanExecute <CoreRtBenchmark>(config);
        }
 public DryCoreRtJobAttribute() : base(Job.Dry.WithRuntime(CoreRtRuntime.GetCurrentVersion()))
 {
 }
 public CoreRtJobAttribute() : base(Job.Default.WithRuntime(CoreRtRuntime.GetCurrentVersion()))
 {
 }