private static void GenerateJitSettings(XmlDocument xmlDocument, XmlNode runtimeElement, EnvMode envMode)
 {
     if (envMode.HasValue(EnvMode.JitCharacteristic))
     {
         string useLegacyJit = envMode.Jit == Jit.RyuJit ? "0" : "1";
         CreateNodeWithAttribute(xmlDocument, runtimeElement, "useLegacyJit", "enabled", useLegacyJit);
     }
 }
Ejemplo n.º 2
0
        public static void Test06CharacteristicHacks()
        {
            var j = new Job();

            Equal(j.Run.TargetCount, 0);

            RunMode.TargetCountCharacteristic[j] = 123;
            Equal(j.Run.TargetCount, 123);

            var old = j.Run;

            Job.RunCharacteristic[j] = new RunMode();
            Equal(j.Run.TargetCount, 0);

            Job.RunCharacteristic[j] = old;
            old.TargetCount          = 234;
            Equal(j.Run.TargetCount, 234);
            Equal(RunMode.TargetCountCharacteristic[j], 234);

            Characteristic a = Job.RunCharacteristic;

            // will not throw:
            a[j] = new RunMode();
            Throws <ArgumentNullException>(() => a[j] = null);                    // nulls for job nodes are not allowed;
            Throws <ArgumentNullException>(() => a[j] = Characteristic.EmptyValue);
            Throws <ArgumentException>(() => a[j]     = new EnvMode());           // not assignable;
            Throws <ArgumentException>(() => a[j]     = new CharacteristicSet()); // not assignable;
            Throws <ArgumentException>(() => a[j]     = 123);                     // not assignable;

            a = InfrastructureMode.ToolchainCharacteristic;
            // will not throw:
            a[j] = CsProjClassicNetToolchain.Net46;
            a[j] = null;
            a[j] = Characteristic.EmptyValue;
            Throws <ArgumentException>(() => a[j] = new EnvMode());           // not assignable;
            Throws <ArgumentException>(() => a[j] = new CharacteristicSet()); // not assignable;
            Throws <ArgumentException>(() => a[j] = 123);                     // not assignable;
        }
Ejemplo n.º 3
0
 private static void GenerateJitSettings(XmlDocument xmlDocument, XmlNode runtimeElement, EnvMode envMode)
 {
     if (envMode.HasValue(EnvMode.JitCharacteristic))
     {
         string useLegacyJit = envMode.Jit == Jit.RyuJit ? "0" : "1";
         CreateNodeWithAttribute(xmlDocument, runtimeElement, "useLegacyJit", "enabled", useLegacyJit);
     }
 }
Ejemplo n.º 4
0
        public static void Test06CharacteristicHacks()
        {
            var j = new Job();
            Equal(j.Run.TargetCount, 0);

            RunMode.TargetCountCharacteristic[j] = 123;
            Equal(j.Run.TargetCount, 123);

            var old = j.Run;
            Job.RunCharacteristic[j] = new RunMode();
            Equal(j.Run.TargetCount, 0);

            Job.RunCharacteristic[j] = old;
            old.TargetCount = 234;
            Equal(j.Run.TargetCount, 234);
            Equal(RunMode.TargetCountCharacteristic[j], 234);

            Characteristic a = Job.RunCharacteristic;
            // will not throw:
            a[j] = new RunMode();
            Throws<ArgumentNullException>(() => a[j] = null); // nulls for job nodes are not allowed;
            Throws<ArgumentNullException>(() => a[j] = Characteristic.EmptyValue);
            Throws<ArgumentException>(() => a[j] = new EnvMode()); // not assignable;
            Throws<ArgumentException>(() => a[j] = new CharacteristicSet()); // not assignable;
            Throws<ArgumentException>(() => a[j] = 123); // not assignable;

            a = InfrastructureMode.ToolchainCharacteristic;
            // will not throw:
            a[j] = ClassicToolchain.Instance;
            a[j] = null;
            a[j] = Characteristic.EmptyValue;
            Throws<ArgumentException>(() => a[j] = new EnvMode()); // not assignable;
            Throws<ArgumentException>(() => a[j] = new CharacteristicSet()); // not assignable;
            Throws<ArgumentException>(() => a[j] = 123); // not assignable;
        }