Cosmos/Tests/Cosmos.TestRunner.Core/DefaultEngineConfiguration.cs
Matthijs ter Woord bf2a02caa6 Ongoing work
2015-08-10 12:43:36 -04:00

44 lines
1.8 KiB
C#
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Linq;
namespace Cosmos.TestRunner.Core
{
public static class DefaultEngineConfiguration
{
public static void Apply(Engine engine)
{
if (engine == null)
{
throw new ArgumentNullException("engine");
}
engine.AllowedSecondsInKernel = 180;
// 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 = true;
engine.RunWithGDB = 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(Cosmos.Compiler.Tests.SingleEchoTest.Kernel).Assembly.Location);
// known bugs, therefor disabled for now:
//engine.AddKernel(typeof(BoxingTests.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!");
}
}
}
}
}