Skip to content
Quajak edited this page Sep 7, 2020 · 7 revisions

Test Runner

The test runner is used for testing kernels in Cosmos, it is used primarily as an "Auto-Tester". The TestRunner can test multiple kernels and will report all failures after testing is done. The configuration for the TestRunner can be found in Cosmos.TestRunner.Core.DefaultEngineConfiguration and the list of kernels to test can be found in Cosmos.TestRunner.Core.TestKernelSets.

Configuration Options

To configure the TestRunner, open Cosmos.TestRunner.Core.DefaultEngineConfiguration.cs.

Time Out

To set the period before the TestRunner registers an error, change the line: engine.AllowedSecondsInKernel = 1800; This means that, in this case, if the Kernel runs for more that 30 minutes then it will register a failure.

Adding a Kernel

To add a kernel to the TestRunner, open the TestKernelSets file and add a line to GetStableKernelTypes() like this line:

yield return typeof(Cosmos.Kernel.Tests.Fat.Kernel);

Note: This can be used to test your own kernel for debug purposes. Simply add a reference to your kernel csproj to Cosmos.TestRunner.Full and add it to TestKernelSets.

Running

  1. With the Cosmos solution opened, set one of the test runner project as startup project, either Cosmos.TestRunner(console) or Cosmos.TestRunner.UI(WPF UI).

  2. The Bochs x86 emulator is recommended, but you can use other run target, like VMWare.

  3. Comment the tests that you don't want to test in Cosmos.TestRunner.Core.TestKernelSets.

  4. Start the project, the test runner will open and the tests will be run.

  5. In the end, you can save the tests results.

Clone this wiki locally