@@ -9,6 +9,7 @@ namespace Xunit.Runner.VisualStudio;
9
9
internal class RunSettings
10
10
{
11
11
public AppDomainSupport ? AppDomain { get ; set ; }
12
+ public int ? AssertEquivalentMaxDepth { get ; set ; }
12
13
public string ? Culture { get ; set ; }
13
14
public bool DesignMode { get ; set ; } = false ;
14
15
public bool ? DiagnosticMessages { get ; set ; }
@@ -25,6 +26,10 @@ internal class RunSettings
25
26
public bool ? ParallelizeAssembly { get ; set ; }
26
27
public bool ? ParallelizeTestCollections { get ; set ; }
27
28
public bool ? PreEnumerateTheories { get ; set ; }
29
+ public int ? PrintMaxEnumerableLength { get ; set ; }
30
+ public int ? PrintMaxObjectDepth { get ; set ; }
31
+ public int ? PrintMaxObjectMemberCount { get ; set ; }
32
+ public int ? PrintMaxStringLength { get ; set ; }
28
33
public string ? ReporterSwitch { get ; set ; }
29
34
public int ? Seed { get ; set ; }
30
35
public bool ? ShadowCopy { get ; set ; }
@@ -36,6 +41,8 @@ public void CopyTo(TestAssemblyConfiguration configuration)
36
41
{
37
42
if ( AppDomain . HasValue )
38
43
configuration . AppDomain = AppDomain ;
44
+ if ( AssertEquivalentMaxDepth . HasValue )
45
+ configuration . AssertEquivalentMaxDepth = AssertEquivalentMaxDepth ;
39
46
if ( Culture is not null )
40
47
configuration . Culture = Culture . ToUpperInvariant ( ) switch
41
48
{
@@ -69,6 +76,14 @@ public void CopyTo(TestAssemblyConfiguration configuration)
69
76
configuration . ParallelizeTestCollections = ParallelizeTestCollections ;
70
77
if ( PreEnumerateTheories . HasValue )
71
78
configuration . PreEnumerateTheories = PreEnumerateTheories ;
79
+ if ( PrintMaxEnumerableLength . HasValue )
80
+ configuration . PrintMaxEnumerableLength = PrintMaxEnumerableLength ;
81
+ if ( PrintMaxObjectDepth . HasValue )
82
+ configuration . PrintMaxObjectDepth = PrintMaxObjectDepth ;
83
+ if ( PrintMaxObjectMemberCount . HasValue )
84
+ configuration . PrintMaxObjectMemberCount = PrintMaxObjectMemberCount ;
85
+ if ( PrintMaxStringLength . HasValue )
86
+ configuration . PrintMaxStringLength = PrintMaxStringLength ;
72
87
if ( Seed . HasValue )
73
88
configuration . Seed = Seed ;
74
89
if ( ShadowCopy . HasValue )
@@ -99,6 +114,10 @@ public static RunSettings Parse(string? settingsXml)
99
114
if ( Enum . TryParse < AppDomainSupport > ( appDomainString , ignoreCase : true , out var appDomain ) )
100
115
result . AppDomain = appDomain ;
101
116
117
+ var assertEquivalentMaxDepthString = xunitElement . Element ( Constants . Xunit . AssertEquivalentMaxDepth ) ? . Value ;
118
+ if ( int . TryParse ( assertEquivalentMaxDepthString , out var assertEquivalentMaxDepth ) && assertEquivalentMaxDepth >= 1 )
119
+ result . AssertEquivalentMaxDepth = assertEquivalentMaxDepth ;
120
+
102
121
result . Culture = xunitElement . Element ( Constants . Xunit . Culture ) ? . Value ;
103
122
104
123
var diagnosticMessagesString = xunitElement . Element ( Constants . Xunit . DiagnosticMessages ) ? . Value ;
@@ -177,6 +196,22 @@ public static RunSettings Parse(string? settingsXml)
177
196
if ( bool . TryParse ( preEnumerateTheoriesString , out var preEnumerateTheories ) )
178
197
result . PreEnumerateTheories = preEnumerateTheories ;
179
198
199
+ var printMaxEnumerableLengthString = xunitElement . Element ( Constants . Xunit . PrintMaxEnumerableLength ) ? . Value ;
200
+ if ( int . TryParse ( printMaxEnumerableLengthString , out var printMaxEnumerableLength ) && printMaxEnumerableLength >= 0 )
201
+ result . PrintMaxEnumerableLength = printMaxEnumerableLength ;
202
+
203
+ var printMaxObjectDepthString = xunitElement . Element ( Constants . Xunit . PrintMaxObjectDepth ) ? . Value ;
204
+ if ( int . TryParse ( printMaxObjectDepthString , out var printMaxObjectDepth ) && printMaxObjectDepth >= 0 )
205
+ result . PrintMaxObjectDepth = printMaxObjectDepth ;
206
+
207
+ var printMaxObjectMemberCountString = xunitElement . Element ( Constants . Xunit . PrintMaxObjectMemberCount ) ? . Value ;
208
+ if ( int . TryParse ( printMaxObjectMemberCountString , out var printMaxObjectMemberCount ) && printMaxObjectMemberCount >= 0 )
209
+ result . PrintMaxObjectMemberCount = printMaxObjectMemberCount ;
210
+
211
+ var printMaxStringLengthString = xunitElement . Element ( Constants . Xunit . PrintMaxStringLength ) ? . Value ;
212
+ if ( int . TryParse ( printMaxStringLengthString , out var printMaxStringLength ) && printMaxStringLength >= 0 )
213
+ result . PrintMaxStringLength = printMaxStringLength ;
214
+
180
215
var reporterSwitchString = xunitElement . Element ( Constants . Xunit . ReporterSwitch ) ? . Value ;
181
216
if ( reporterSwitchString is not null )
182
217
result . ReporterSwitch = reporterSwitchString ;
@@ -263,6 +298,7 @@ public static class RunConfiguration
263
298
public static class Xunit
264
299
{
265
300
public const string AppDomain = nameof ( AppDomain ) ;
301
+ public const string AssertEquivalentMaxDepth = nameof ( AssertEquivalentMaxDepth ) ;
266
302
public const string Culture = nameof ( Culture ) ;
267
303
public const string DiagnosticMessages = nameof ( DiagnosticMessages ) ;
268
304
public const string Explicit = nameof ( Explicit ) ;
@@ -278,6 +314,10 @@ public static class Xunit
278
314
public const string ParallelizeAssembly = nameof ( ParallelizeAssembly ) ;
279
315
public const string ParallelizeTestCollections = nameof ( ParallelizeTestCollections ) ;
280
316
public const string PreEnumerateTheories = nameof ( PreEnumerateTheories ) ;
317
+ public const string PrintMaxEnumerableLength = nameof ( PrintMaxEnumerableLength ) ;
318
+ public const string PrintMaxObjectDepth = nameof ( PrintMaxObjectDepth ) ;
319
+ public const string PrintMaxObjectMemberCount = nameof ( PrintMaxObjectMemberCount ) ;
320
+ public const string PrintMaxStringLength = nameof ( PrintMaxStringLength ) ;
281
321
public const string Seed = nameof ( Seed ) ;
282
322
public const string ReporterSwitch = nameof ( ReporterSwitch ) ;
283
323
public const string ShadowCopy = nameof ( ShadowCopy ) ;
0 commit comments