mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-26 21:42:11 +00:00
Enable kernel execution.
This commit is contained in:
parent
5dc5170a6d
commit
d34e66899b
4 changed files with 13 additions and 6 deletions
|
|
@ -17,8 +17,9 @@ namespace Cosmos.TestRunner.Core
|
||||||
public int AllowedSecondsInKernel = 30;
|
public int AllowedSecondsInKernel = 30;
|
||||||
public List<RunTargetEnum> RunTargets = new List<RunTargetEnum>();
|
public List<RunTargetEnum> RunTargets = new List<RunTargetEnum>();
|
||||||
|
|
||||||
private void ExecuteKernel(string assemblyFileName, RunConfiguration configuration)
|
private bool ExecuteKernel(string assemblyFileName, RunConfiguration configuration)
|
||||||
{
|
{
|
||||||
|
var xResult = true;
|
||||||
OutputHandler.ExecuteKernelStart(assemblyFileName);
|
OutputHandler.ExecuteKernelStart(assemblyFileName);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -58,17 +59,21 @@ namespace Cosmos.TestRunner.Core
|
||||||
if (!mKernelResultSet)
|
if (!mKernelResultSet)
|
||||||
{
|
{
|
||||||
OutputHandler.SetKernelTestResult(false, e.ToString());
|
OutputHandler.SetKernelTestResult(false, e.ToString());
|
||||||
|
mKernelResult = false;
|
||||||
}
|
}
|
||||||
if (e is TaskFailedException)
|
if (e is TaskFailedException)
|
||||||
{
|
{
|
||||||
return;
|
return mKernelResult;
|
||||||
}
|
}
|
||||||
OutputHandler.UnhandledException(e);
|
OutputHandler.UnhandledException(e);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
OutputHandler.ExecuteKernelEnd(assemblyFileName);
|
OutputHandler.ExecuteKernelEnd(assemblyFileName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
xResult = mKernelResult;
|
||||||
|
return xResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@ namespace Cosmos.TestRunner.Core
|
||||||
}
|
}
|
||||||
|
|
||||||
private volatile bool mKernelResultSet;
|
private volatile bool mKernelResultSet;
|
||||||
|
private volatile bool mKernelResult;
|
||||||
private int mSucceededAssertions;
|
private int mSucceededAssertions;
|
||||||
|
|
||||||
private void ChannelPacketReceived(byte arg1, byte arg2, byte[] arg3)
|
private void ChannelPacketReceived(byte arg1, byte arg2, byte[] arg3)
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ namespace Cosmos.TestRunner.Core
|
||||||
|
|
||||||
public OutputHandlerBasic OutputHandler;
|
public OutputHandlerBasic OutputHandler;
|
||||||
|
|
||||||
public void Execute()
|
public bool Execute()
|
||||||
{
|
{
|
||||||
if (OutputHandler == null)
|
if (OutputHandler == null)
|
||||||
{
|
{
|
||||||
|
|
@ -62,6 +62,7 @@ namespace Cosmos.TestRunner.Core
|
||||||
OutputHandler.RunConfigurationStart(xConfig);
|
OutputHandler.RunConfigurationStart(xConfig);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
var xResult = true;
|
||||||
foreach (var xAssemblyFile in mKernelsToRun)
|
foreach (var xAssemblyFile in mKernelsToRun)
|
||||||
{
|
{
|
||||||
mBaseWorkingDirectory = Path.Combine(Path.GetDirectoryName(typeof(Engine).Assembly.Location), "WorkingDirectory");
|
mBaseWorkingDirectory = Path.Combine(Path.GetDirectoryName(typeof(Engine).Assembly.Location), "WorkingDirectory");
|
||||||
|
|
@ -71,8 +72,9 @@ namespace Cosmos.TestRunner.Core
|
||||||
}
|
}
|
||||||
Directory.CreateDirectory(mBaseWorkingDirectory);
|
Directory.CreateDirectory(mBaseWorkingDirectory);
|
||||||
|
|
||||||
ExecuteKernel(xAssemblyFile, xConfig);
|
xResult &= ExecuteKernel(xAssemblyFile, xConfig);
|
||||||
}
|
}
|
||||||
|
return xResult;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,8 @@ namespace DebugCompiler
|
||||||
xEngine.KernelsToRun.Add(kernelToRun.Assembly.Location);
|
xEngine.KernelsToRun.Add(kernelToRun.Assembly.Location);
|
||||||
xEngine.OutputHandler = new TestOutputHandler();
|
xEngine.OutputHandler = new TestOutputHandler();
|
||||||
|
|
||||||
|
Assert.IsTrue(xEngine.Execute());
|
||||||
|
|
||||||
Assert.IsNotNull(kernelToRun);
|
|
||||||
Assert.Fail("Cannot run kernel '" + kernelToRun.FullName + "'!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestOutputHandler: OutputHandlerFullTextBase
|
private class TestOutputHandler: OutputHandlerFullTextBase
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue