Skip to content

Commit

Permalink
Test Runner: Add support for additional nunit args. (#775)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhett12321 authored Sep 9, 2024
1 parent 40eb250 commit b7999bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion NWN.Anvil.TestRunner/src/main/TestRunnerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ internal sealed class TestRunnerService
private readonly Queue<Assembly> testAssemblyQueue = new Queue<Assembly>();
private readonly string outputDir;

private readonly string additionalArgs = Environment.GetEnvironmentVariable("ANVIL_NUNIT_ARGS");

private Thread testWorkerThread;

public TestRunnerService(MainThreadSynchronizationContext mainThreadSynchronizationContext, PluginStorageService pluginStorageService)
Expand Down Expand Up @@ -78,7 +80,8 @@ private async void Shutdown()
private string[] GetRunnerArguments(Assembly assembly)
{
string outputPath = Path.Combine(outputDir, assembly.GetName().Name!);
string args = $"--mainthread --work={outputPath}";

string args = $"--mainthread --work={outputPath} {additionalArgs}";
return string.IsNullOrEmpty(args) ? Array.Empty<string>() : CommandLineParser.SplitCommandLineIntoArguments(args, false).ToArray();
}
}
Expand Down

0 comments on commit b7999bd

Please sign in to comment.