diff --git a/Content.IntegrationTests/ExternalTestContext.cs b/Content.IntegrationTests/ExternalTestContext.cs
new file mode 100644
index 0000000000..e23b2ee636
--- /dev/null
+++ b/Content.IntegrationTests/ExternalTestContext.cs
@@ -0,0 +1,12 @@
+using System.IO;
+
+namespace Content.IntegrationTests;
+
+///
+/// Generic implementation of for usage outside of actual tests.
+///
+public sealed class ExternalTestContext(string name, TextWriter writer) : ITestContextLike
+{
+ public string FullName => name;
+ public TextWriter Out => writer;
+}
diff --git a/Content.IntegrationTests/ITestContextLike.cs b/Content.IntegrationTests/ITestContextLike.cs
new file mode 100644
index 0000000000..47b6e08529
--- /dev/null
+++ b/Content.IntegrationTests/ITestContextLike.cs
@@ -0,0 +1,13 @@
+using System.IO;
+
+namespace Content.IntegrationTests;
+
+///
+/// Something that looks like a , for passing to integration tests.
+///
+public interface ITestContextLike
+{
+ string FullName { get; }
+ TextWriter Out { get; }
+}
+
diff --git a/Content.IntegrationTests/NUnitTestContextWrap.cs b/Content.IntegrationTests/NUnitTestContextWrap.cs
new file mode 100644
index 0000000000..849c1b0910
--- /dev/null
+++ b/Content.IntegrationTests/NUnitTestContextWrap.cs
@@ -0,0 +1,12 @@
+using System.IO;
+
+namespace Content.IntegrationTests;
+
+///
+/// Canonical implementation of for usage in actual NUnit tests.
+///
+public sealed class NUnitTestContextWrap(TestContext context, TextWriter writer) : ITestContextLike
+{
+ public string FullName => context.Test.FullName;
+ public TextWriter Out => writer;
+}
diff --git a/Content.IntegrationTests/Pair/TestPair.Recycle.cs b/Content.IntegrationTests/Pair/TestPair.Recycle.cs
index 89a9eb6463..694d6cfa64 100644
--- a/Content.IntegrationTests/Pair/TestPair.Recycle.cs
+++ b/Content.IntegrationTests/Pair/TestPair.Recycle.cs
@@ -13,6 +13,7 @@ using Robust.Server.Player;
using Robust.Shared.Exceptions;
using Robust.Shared.GameObjects;
using Robust.Shared.Network;
+using Robust.Shared.Utility;
namespace Content.IntegrationTests.Pair;
@@ -84,6 +85,7 @@ public sealed partial class TestPair : IAsyncDisposable
var returnTime = Watch.Elapsed;
await _testOut.WriteLineAsync($"{nameof(CleanReturnAsync)}: PoolManager took {returnTime.TotalMilliseconds} ms to put pair {Id} back into the pool");
+ State = PairState.Ready;
}
private async Task ResetModifiedPreferences()
@@ -104,7 +106,7 @@ public sealed partial class TestPair : IAsyncDisposable
await _testOut.WriteLineAsync($"{nameof(CleanReturnAsync)}: Return of pair {Id} started");
State = PairState.CleanDisposed;
await OnCleanDispose();
- State = PairState.Ready;
+ DebugTools.Assert(State is PairState.Dead or PairState.Ready);
PoolManager.NoCheckReturn(this);
ClearContext();
}
diff --git a/Content.IntegrationTests/PoolManager.cs b/Content.IntegrationTests/PoolManager.cs
index c7b8dcaee9..64aac16751 100644
--- a/Content.IntegrationTests/PoolManager.cs
+++ b/Content.IntegrationTests/PoolManager.cs
@@ -182,24 +182,29 @@ public static partial class PoolManager
///
/// See
///
- public static async Task GetServerClient(PoolSettings? poolSettings = null)
+ public static async Task GetServerClient(
+ PoolSettings? poolSettings = null,
+ ITestContextLike? testContext = null)
{
- return await GetServerClientPair(poolSettings ?? new PoolSettings());
+ return await GetServerClientPair(
+ poolSettings ?? new PoolSettings(),
+ testContext ?? new NUnitTestContextWrap(TestContext.CurrentContext, TestContext.Out));
}
- private static string GetDefaultTestName(TestContext testContext)
+ private static string GetDefaultTestName(ITestContextLike testContext)
{
- return testContext.Test.FullName.Replace("Content.IntegrationTests.Tests.", "");
+ return testContext.FullName.Replace("Content.IntegrationTests.Tests.", "");
}
- private static async Task GetServerClientPair(PoolSettings poolSettings)
+ private static async Task GetServerClientPair(
+ PoolSettings poolSettings,
+ ITestContextLike testContext)
{
if (!_initialized)
throw new InvalidOperationException($"Pool manager has not been initialized");
// Trust issues with the AsyncLocal that backs this.
- var testContext = TestContext.CurrentContext;
- var testOut = TestContext.Out;
+ var testOut = testContext.Out;
DieIfPoolFailure();
var currentTestName = poolSettings.TestName ?? GetDefaultTestName(testContext);
diff --git a/Content.MapRenderer/CommandLineArguments.cs b/Content.MapRenderer/CommandLineArguments.cs
index f75b671dcb..a4f3c83bf2 100644
--- a/Content.MapRenderer/CommandLineArguments.cs
+++ b/Content.MapRenderer/CommandLineArguments.cs
@@ -13,6 +13,7 @@ public sealed class CommandLineArguments
public string OutputPath { get; set; } = DirectoryExtensions.MapImages().FullName;
public bool ArgumentsAreFileNames { get; set; } = false;
public bool ShowMarkers { get; set; } = false;
+ public bool OutputParallax { get; set; } = false;
public static bool TryParse(IReadOnlyList args, [NotNullWhen(true)] out CommandLineArguments? parsed)
{
@@ -70,7 +71,17 @@ public sealed class CommandLineArguments
PrintHelp();
return false;
+ case "--parallax":
+ parsed.OutputParallax = true;
+ break;
+
default:
+ if (argument.StartsWith('-'))
+ {
+ Console.WriteLine($"Unknown argument: {argument}");
+ return false;
+ }
+
parsed.Maps.Add(argument);
break;
}
@@ -95,7 +106,6 @@ Options:
Defaults to: png
--viewer
Causes the map renderer to create the map.json files required for use with the map viewer.
- Also puts the maps in the required directory structure.
-o / --output