Beispiel #1
2
        static void Main(string[] args)
        {
            var xEngine = new Engine();

            DefaultEngineConfiguration.Apply(xEngine);

            var xOutputXml = new OutputHandlerXml();
            xEngine.OutputHandler = new MultiplexingOutputHandler(
                xOutputXml,
                new OutputHandlerFullConsole());

            xEngine.Execute();

            global::System.Console.WriteLine("Do you want to save test run details?");
            global::System.Console.Write("Type yes, or nothing to just exit: ");
            var xResult = global::System.Console.ReadLine();
            if (xResult != null && xResult.Equals("yes", StringComparison.OrdinalIgnoreCase))
            {
                var xSaveDialog = new SaveFileDialog();
                xSaveDialog.Filter = "XML documents|*.xml";
                if (xSaveDialog.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                xOutputXml.SaveToFile(xSaveDialog.FileName);
            }
        }
Beispiel #2
0
        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());

        }
Beispiel #3
0
        static void Main(string[] args)
        {
            var xEngine = new Engine();

            DefaultEngineConfiguration.Apply(xEngine);

            xEngine.OutputHandler = new OutputHandlerXml(@"c:\data\CosmosTests.xml");
            //xEngine.OutputHandler = new OutputHandlerConsole();
            xEngine.Execute();
        }
        private void TestEngineThreadMain()
        {
            var xEngine = new Engine();

            DefaultEngineConfiguration.Apply(xEngine);

            var xOutputXml = new OutputHandlerXml();
            xEngine.OutputHandler = new MultiplexingOutputHandler(
                xOutputXml,
                this);

            xEngine.Execute();
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            var xEngine = new Engine();

            xEngine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location);
            //xEngine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location);

            // known bugs, therefor disabled for now:
            //xEngine.AddKernel(typeof(Cosmos.Compiler.Tests.Interfaces.Kernel.Kernel).Assembly.Location);

            xEngine.OutputHandler = new OutputHandlerXml(@"c:\data\CosmosTests.xml");
            //xEngine.OutputHandler = new OutputHandlerConsole();
            xEngine.Execute();
        }
Beispiel #6
0
        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();
            }
        }