8000 Support parallel algorithm in MSBuild runner · xunit/xunit@46cdf06 · GitHub
[go: up one dir, main page]

Skip to content

Commit 46cdf06

Browse files
committed
Support parallel algorithm in MSBuild runner
1 parent b4aa876 commit 46cdf06

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/xunit.runner.msbuild/xunit.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class xunit : MSBuildTask, ICancelableTask
2020
XunitFilters filters;
2121
IRunnerLogger logger;
2222
int? maxThreadCount;
23+
ParallelAlgorithm? parallelAlgorithm;
2324
bool? parallelizeAssemblies;
2425
bool? parallelizeTestCollections;
2526
IMessageSinkWithTypes reporterMessageHandler;
@@ -75,6 +76,8 @@ protected bool NeedsXml
7576

7677
public ITaskItem NUnit { get; set; }
7778

79+
public ParallelAlgorithm ParallelAlgorithm { set { parallelAlgorithm = value; } }
80+
7881
public bool ParallelizeAssemblies { set { parallelizeAssemblies = value; } }
7982

8083
public bool ParallelizeTestCollections { set { parallelizeTestCollections = value; } }
@@ -277,6 +280,8 @@ protected virtual XElement ExecuteAssembly(XunitProjectAssembly assembly, AppDom
277280
var executionOptions = TestFrameworkOptions.ForExecution(assembly.Configuration);
278281
if (maxThreadCount.HasValue && maxThreadCount.Value > -1)
279282
executionOptions.SetMaxParallelThreads(maxThreadCount);
28 524C 3+
if (parallelAlgorithm.HasValue)
284+
executionOptions.SetParallelAlgorithm(parallelAlgorithm);
280285
if (parallelizeTestCollections.HasValue)
281286
executionOptions.SetDisableParallelization(!parallelizeTestCollections);
282287
if (stopOnFail.HasValue)

0 commit comments

Comments
 (0)
0