mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Make integration tests fail when logging console errors (#4747)
* Make tests fail when logging console errors * Add log convenience property
This commit is contained in:
@@ -12,6 +12,7 @@ using System.Threading.Tasks;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Robust.Client;
|
||||
using Robust.Client.Console;
|
||||
using Robust.Client.GameStates;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Client.Timing;
|
||||
@@ -271,6 +272,7 @@ namespace Robust.UnitTesting
|
||||
public IGameTiming Timing { get; private set; } = default!;
|
||||
public IMapManager MapMan { get; private set; } = default!;
|
||||
public IConsoleHost ConsoleHost { get; private set; } = default!;
|
||||
public ISawmill Log { get; private set; } = default!;
|
||||
|
||||
protected virtual void ResolveIoC(IDependencyCollection deps)
|
||||
{
|
||||
@@ -281,6 +283,7 @@ namespace Robust.UnitTesting
|
||||
Timing = deps.Resolve<IGameTiming>();
|
||||
MapMan = deps.Resolve<IMapManager>();
|
||||
ConsoleHost = deps.Resolve<IConsoleHost>();
|
||||
Log = deps.Resolve<ILogManager>().GetSawmill("test");
|
||||
}
|
||||
|
||||
public T System<T>() where T : IEntitySystem
|
||||
@@ -668,6 +671,9 @@ namespace Robust.UnitTesting
|
||||
deps.Register<TestingModLoader, TestingModLoader>(true);
|
||||
deps.RegisterInstance<IStatusHost>(new Mock<IStatusHost>().Object, true);
|
||||
deps.Register<IRobustMappedStringSerializer, IntegrationMappedStringSerializer>(true);
|
||||
deps.Register<IServerConsoleHost, TestingServerConsoleHost>(true);
|
||||
deps.Register<IConsoleHost, TestingServerConsoleHost>(true);
|
||||
deps.Register<IConsoleHostInternal, TestingServerConsoleHost>(true);
|
||||
Options?.InitIoC?.Invoke();
|
||||
deps.BuildGraph();
|
||||
//ServerProgram.SetupLogging();
|
||||
@@ -836,6 +842,9 @@ namespace Robust.UnitTesting
|
||||
deps.Register<IModLoaderInternal, TestingModLoader>(true);
|
||||
deps.Register<TestingModLoader, TestingModLoader>(true);
|
||||
deps.Register<IRobustMappedStringSerializer, IntegrationMappedStringSerializer>(true);
|
||||
deps.Register<IClientConsoleHost, TestingClientConsoleHost>(true);
|
||||
deps.Register<IConsoleHost, TestingClientConsoleHost>(true);
|
||||
deps.Register<IConsoleHostInternal, TestingClientConsoleHost>(true);
|
||||
Options?.InitIoC?.Invoke();
|
||||
deps.BuildGraph();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user