public static void Apply(Engine engine) { if (engine == null) { throw new ArgumentNullException("engine"); } engine.AllowedSecondsInKernel = 120; // If you want to test only specific platforms, add them to the list, like next line. By default, all platforms are ran. // engine.RunTargets.Add(RunTargetEnum.Bochs); // if you're working on the compiler (or other lower parts), you can choose to run the compiler in process // 1 thing to keep in mind though, is that this only works with 1 kernel at a time! engine.RunIL2CPUInProcess = false; engine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location); engine.AddKernel(typeof(SimpleStructsAndArraysTest.Kernel).Assembly.Location); engine.AddKernel(typeof(VGACompilerCrash.Kernel).Assembly.Location); engine.AddKernel(typeof(BoxingTests.Kernel).Assembly.Location); // known bugs, therefor disabled for now: // end of known bugs // double check: this check is in the engine, but lets put it here as well if (engine.RunIL2CPUInProcess) { if (engine.KernelsToRun.Count() > 1) { throw new InvalidOperationException("Can only run 1 kernel if IL2CPU is ran in-process!"); } } }
public static void Apply(Engine engine) { if (engine == null) { throw new ArgumentNullException("engine"); } // Sets the time before an error is registered. For example if set to 60 then if a kernel runs for more than 60 seconds then // that kernel will be marked as a failiure and terminated engine.AllowedSecondsInKernel = 1800; // If you want to test only specific platforms, add them to the list, like next line. By default, all platforms are run. engine.RunTargets.Add(RunTargetEnum.Bochs); // If you're working on the compiler (or other lower parts), you can choose to run the compiler in process // one thing to keep in mind though, is that this only works with 1 kernel at a time! //engine.RunIL2CPUInProcess = true; engine.TraceAssembliesLevel = TraceAssemblies.User; engine.EnableStackCorruptionChecks = true; engine.StackCorruptionChecksLevel = StackCorruptionDetectionLevel.AllInstructions; //engine.RunWithGDB = true; //engine.StartBochsDebugGui = true; // Select kernels to be tested by adding them to the engine foreach (var xType in TestKernelSets.GetStableKernelTypes()) { engine.AddKernel(xType.Assembly.Location); } //engine.AddKernel(typeof(VGACompilerCrash.Kernel).Assembly.Location); //engine.AddKernel(typeof(Cosmos.Compiler.Tests.Bcl.Kernel).Assembly.Location); //engine.AddKernel(typeof(Cosmos.Compiler.Tests.SingleEchoTest.Kernel).Assembly.Location); //engine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location); //engine.AddKernel(typeof(SimpleStructsAndArraysTest.Kernel).Assembly.Location); //engine.AddKernel(typeof(Cosmos.Compiler.Tests.Exceptions.Kernel).Assembly.Location); //engine.AddKernel(typeof(Cosmos.Compiler.Tests.MethodTests.Kernel).Assembly.Location); // Known bugs, therefore disabled for now: //engine.AddKernel(typeof(BoxingTests.Kernel).Assembly.Location); //engine.AddKernel(typeof(Cosmos.Compiler.Tests.MultidimensionalArrays.Kernel).Assembly.Location); // Experimental stuff: engine.AddKernel(typeof(Cosmos.Kernel.Tests.Fat.Kernel).Assembly.Location); // end of known bugs // double check: this check is in the engine, but lets put it here as well if (engine.RunIL2CPUInProcess) { if (engine.KernelsToRun.Count() > 1 || engine.RunTargets.Count == 0 || engine.RunTargets.Count > 1) { throw new InvalidOperationException("Can only run 1 kernel if IL2CPU is ran in-process!"); } } }
public static void Apply(Engine engine) { if (engine == null) { throw new ArgumentNullException("engine"); } engine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location); engine.AddKernel(typeof(SimpleStructsAndArraysTest.Kernel).Assembly.Location); engine.AddKernel(typeof(VGACompilerCrash.Kernel).Assembly.Location); // known bugs, therefor disabled for now: }
static void Main(string[] args) { var xEngine = new Engine(); xEngine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location); xEngine.AddKernel(typeof(SimpleStructsAndArraysTest.Kernel).Assembly.Location); xEngine.AddKernel(typeof(VGACompilerCrash.Kernel).Assembly.Location); // known bugs, therefor disabled for now: xEngine.OutputHandler = new OutputHandlerXml(@"c:\data\CosmosTests.xml"); //xEngine.OutputHandler = new OutputHandlerConsole(); xEngine.Execute(); }
public static void Apply(Engine engine) { if (engine == null) { throw new ArgumentNullException("engine"); } engine.AllowedSecondsInKernel = 300; engine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location); engine.AddKernel(typeof(SimpleStructsAndArraysTest.Kernel).Assembly.Location); engine.AddKernel(typeof(VGACompilerCrash.Kernel).Assembly.Location); // known bugs, therefor disabled for now: }
public void Test([ValueSource(typeof(MySource), nameof(MySource.ProvideData))] Type kernelToRun) { var xEngine = new Engine(); // Sets the time before an error is registered. For example if set to 60 then if a kernel runs for more than 60 seconds then // that kernel will be marked as a failiure and terminated xEngine.AllowedSecondsInKernel = 1800; // If you want to test only specific platforms, add them to the list, like next line. By default, all platforms are run. xEngine.RunTargets.Add(RunTargetEnum.Bochs); // If you're working on the compiler (or other lower parts), you can choose to run the compiler in process // one thing to keep in mind though, is that this only works with 1 kernel at a time! xEngine.RunIL2CPUInProcess = false; xEngine.TraceAssembliesLevel = TraceAssemblies.User; xEngine.EnableStackCorruptionChecks = true; xEngine.StackCorruptionChecksLevel = StackCorruptionDetectionLevel.AllInstructions; // Select kernels to be tested by adding them to the engine xEngine.AddKernel(kernelToRun.Assembly.Location); xEngine.OutputHandler = new TestOutputHandler(); Assert.IsTrue(xEngine.Execute()); }
public static void Apply(Engine engine) { if (engine == null) { throw new ArgumentNullException("engine"); } engine.AllowedSecondsInKernel = 120; // If you want to test only specific platforms, add them to the list, like next line. By default, all platforms are ran. engine.RunTargets.Add(RunTargetEnum.Bochs); // if you're working on the compiler (or other lower parts), you can choose to run the compiler in process // 1 thing to keep in mind though, is that this only works with 1 kernel at a time! engine.RunIL2CPUInProcess = false; engine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location); //engine.AddKernel(typeof(SimpleStructsAndArraysTest.Kernel).Assembly.Location); //engine.AddKernel(typeof(VGACompilerCrash.Kernel).Assembly.Location); // engine.AddKernel(typeof(BoxingTests.Kernel).Assembly.Location); // known bugs, therefor disabled for now: // end of known bugs // double check: this check is in the engine, but lets put it here as well if (engine.RunIL2CPUInProcess) { if (engine.KernelsToRun.Count() > 1) { throw new InvalidOperationException("Can only run 1 kernel if IL2CPU is ran in-process!"); } } }
public void Test(Type kernelToRun) { try { Environment.CurrentDirectory = Path.GetDirectoryName(typeof(RunKernels).Assembly.Location); var xEngine = new Engine(); // Sets the time before an error is registered. For example if set to 60 then if a kernel runs for more than 60 seconds then // that kernel will be marked as a failure and terminated xEngine.AllowedSecondsInKernel = 1200; // If you want to test only specific platforms, add them to the list, like next line. By default, all platforms are run. xEngine.RunTargets.Add(RunTargetEnum.Bochs); //xEngine.StartBochsDebugGui = false; //xEngine.RunWithGDB = true; // If you're working on the compiler (or other lower parts), you can choose to run the compiler in process // one thing to keep in mind though, is that this only works with 1 kernel at a time! //xEngine.RunIL2CPUInProcess = true; xEngine.TraceAssembliesLevel = TraceAssemblies.User; xEngine.EnableStackCorruptionChecks = true; xEngine.StackCorruptionChecksLevel = StackCorruptionDetectionLevel.AllInstructions; // Select kernels to be tested by adding them to the engine xEngine.AddKernel(kernelToRun.Assembly.Location); xEngine.OutputHandler = new TestOutputHandler(); Assert.IsTrue(xEngine.Execute()); } catch (AssertionException) { throw; } catch(Exception E) { Console.WriteLine("Exception occurred: " + E.ToString()); Assert.Fail(); } }
public static void Apply(Engine engine) { if (engine == null) { throw new ArgumentNullException("engine"); } engine.AllowedSecondsInKernel = 120; // If you want to exclude a testing platform, modify uncomment and modify the following line engine.RunTargets.Remove(RunTargetEnum.Bochs); // if you're working on the compiler (or other lower parts), you can choose to run the compiler in process // 1 thing to keep in mind though, is that this only works with 1 kernel at a time! engine.RunIL2CPUInProcess = true; engine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location); //engine.AddKernel(typeof(SimpleStructsAndArraysTest.Kernel).Assembly.Location); //engine.AddKernel(typeof(VGACompilerCrash.Kernel).Assembly.Location); // known bugs, therefor disabled for now: }