Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Runner: Add support for additional nunit args. #775

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading