Skip to content

Commit 3c2e493

Browse files
committed
Update to 2.7.2-pre.17 and support Xunit.ParallelAlgorithm in RunSetttings
1 parent 144931e commit 3c2e493

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<NSubstituteVersion>5.1.0</NSubstituteVersion>
1010
<TunnelVisionLabsReferenceAssemblyAnnotatorVersion>1.0.0-alpha.160</TunnelVisionLabsReferenceAssemblyAnnotatorVersion>
1111
<XunitAnalyzersVersion>1.12.0</XunitAnalyzersVersion>
12-
<XunitVersion>2.7.1</XunitVersion>
12+
<XunitVersion>2.7.2-pre.17</XunitVersion>
1313
</PropertyGroup>
1414

1515
</Project>

src/xunit.runner.visualstudio/Utility/RunSettings.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class RunSettings
1616
public TestMethodDisplay? MethodDisplay { get; set; }
1717
public TestMethodDisplayOptions? MethodDisplayOptions { get; set; }
1818
public bool? NoAutoReporters { get; set; }
19+
public ParallelAlgorithm? ParallelAlgorithm { get; set; }
1920
public bool? ParallelizeAssembly { get; set; }
2021
public bool? ParallelizeTestCollections { get; set; }
2122
public bool? PreEnumerateTheories { get; set; }
@@ -42,6 +43,8 @@ public void CopyTo(TestAssemblyConfiguration configuration)
4243
configuration.MethodDisplay = MethodDisplay;
4344
if (MethodDisplayOptions.HasValue)
4445
configuration.MethodDisplayOptions = MethodDisplayOptions;
46+
if (ParallelAlgorithm.HasValue)
47+
configuration.ParallelAlgorithm = ParallelAlgorithm;
4548
if (ParallelizeAssembly.HasValue)
4649
configuration.ParallelizeAssembly = ParallelizeAssembly;
4750
if (ParallelizeTestCollections.HasValue)
@@ -106,6 +109,10 @@ public static RunSettings Parse(string? settingsXml)
106109
if (bool.TryParse(noAutoReportersString, out var noAutoReporters))
107110
result.NoAutoReporters = noAutoReporters;
108111

112+
var parallelAlgorithmString = xunitElement.Element(Constants.Xunit.ParallelAlgorithm)?.Value;
113+
if (Enum.TryParse<ParallelAlgorithm>(parallelAlgorithmString, ignoreCase: true, out var parallelAlgorithm))
114+
result.ParallelAlgorithm = parallelAlgorithm;
115+
109116
var parallelizeAssemblyString = xunitElement.Element(Constants.Xunit.ParallelizeAssembly)?.Value;
110117
if (bool.TryParse(parallelizeAssemblyString, out var parallelizeAssembly))
111118
result.ParallelizeAssembly = parallelizeAssembly;
@@ -209,6 +216,7 @@ public static class Xunit
209216
public const string MethodDisplay = "MethodDisplay";
210217
public const string MethodDisplayOptions = "MethodDisplayOptions";
211218
public const string NoAutoReporters = "NoAutoReporters";
219+
public const string ParallelAlgorithm = "ParallelAlgorithm";
212220
public const string ParallelizeAssembly = "ParallelizeAssembly";
213221
public const string ParallelizeTestCollections = "ParallelizeTestCollections";
214222
public const string PreEnumerateTheories = "PreEnumerateTheories";

src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@
6464
</NuspecProperties>
6565
</PropertyGroup>
6666
</Target>
67-
67+
6868
</Project>

0 commit comments

Comments
 (0)