@@ -9,6 +9,7 @@ namespace Xunit.Runner.VisualStudio;
99internal class RunSettings
1010{
1111 public AppDomainSupport ? AppDomain { get ; set ; }
12+ public int ? AssertEquivalentMaxDepth { get ; set ; }
1213 public string ? Culture { get ; set ; }
1314 public bool DesignMode { get ; set ; } = false ;
1415 public bool ? DiagnosticMessages { get ; set ; }
@@ -25,6 +26,10 @@ internal class RunSettings
2526 public bool ? ParallelizeAssembly { get ; set ; }
2627 public bool ? ParallelizeTestCollections { get ; set ; }
2728 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 ; }
2833 public string ? ReporterSwitch { get ; set ; }
2934 public int ? Seed { get ; set ; }
3035 public bool ? ShadowCopy { get ; set ; }
@@ -36,6 +41,8 @@ public void CopyTo(TestAssemblyConfiguration configuration)
3641 {
3742 if ( AppDomain . HasValue )
3843 configuration . AppDomain = AppDomain ;
44+ if ( AssertEquivalentMaxDepth . HasValue )
45+ configuration . AssertEquivalentMaxDepth = AssertEquivalentMaxDepth ;
3946 if ( Culture is not null )
4047 configuration . Culture = Culture . ToUpperInvariant ( ) switch
4148 {
@@ -69,6 +76,14 @@ public void CopyTo(TestAssemblyConfiguration configuration)
6976 configuration . ParallelizeTestCollections = ParallelizeTestCollections ;
7077 if ( PreEnumerateTheories . HasValue )
7178 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 ;
7287 if ( Seed . HasValue )
7388 configuration . Seed = Seed ;
7489 if ( ShadowCopy . HasValue )
@@ -99,6 +114,10 @@ public static RunSettings Parse(string? settingsXml)
99114 if ( Enum . TryParse < AppDomainSupport > ( appDomainString , ignoreCase : true , out var appDomain ) )
100115 result . AppDomain = appDomain ;
101116
117+ var assertEquivalentMaxDepthString = xunitElement . Element ( Constants . Xunit . AssertEquivalentMaxDepth ) ? . Value ;
118+ if ( int . TryParse ( assertEquivalentMaxDepthString , out var assertEquivalentMaxDepth ) && assertEquivalentMaxDepth >= 1 )
119+ result . AssertEquivalentMaxDepth = assertEquivalentMaxDepth ;
120+
102121 result . Culture = xunitElement . Element ( Constants . Xunit . Culture ) ? . Value ;
103122
104123 var diagnosticMessagesString = xunitElement . Element ( Constants . Xunit . DiagnosticMessages ) ? . Value ;
@@ -177,6 +196,22 @@ public static RunSettings Parse(string? settingsXml)
177196 if ( bool . TryParse ( preEnumerateTheoriesString , out var preEnumerateTheories ) )
178197 result . PreEnumerateTheories = preEnumerateTheories ;
179198
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+
180215 var reporterSwitchString = xunitElement . Element ( Constants . Xunit . ReporterSwitch ) ? . Value ;
181216 if ( reporterSwitchString is not null )
182217 result . ReporterSwitch = reporterSwitchString ;
@@ -263,6 +298,7 @@ public static class RunConfiguration
263298 public static class Xunit
264299 {
265300 public const string AppDomain = nameof ( AppDomain ) ;
301+ public const string AssertEquivalentMaxDepth = nameof ( AssertEquivalentMaxDepth ) ;
266302 public const string Culture = nameof ( Culture ) ;
267303 public const string DiagnosticMessages = nameof ( DiagnosticMessages ) ;
268304 public const string Explicit = nameof ( Explicit ) ;
@@ -278,6 +314,10 @@ public static class Xunit
278314 public const string ParallelizeAssembly = nameof ( ParallelizeAssembly ) ;
279315 public const string ParallelizeTestCollections = nameof ( ParallelizeTestCollections ) ;
280316 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 ) ;
281321 public const string Seed = nameof ( Seed ) ;
282322 public const string ReporterSwitch = nameof ( ReporterSwitch ) ;
283323 public const string ShadowCopy = nameof ( ShadowCopy ) ;
0 commit comments