Skip to content

Commit f064b09

Browse files
committed
Reduce the default max iterations, to avoid extremely long test runs.
1 parent fb89c84 commit f064b09

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test/Verifiers/CodeFixVerifier.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ namespace TestHelper
2525
/// </summary>
2626
public abstract partial class CodeFixVerifier : DiagnosticVerifier
2727
{
28+
private const int DefaultNumberOfIncrementalIterations = -1000;
29+
2830
/// <summary>
2931
/// Returns the code fix being tested (C#) - to be implemented in non-abstract class.
3032
/// </summary>
@@ -46,7 +48,7 @@ public abstract partial class CodeFixVerifier : DiagnosticVerifier
4648
/// value is less than 0, the negated value is treated as an upper limit as opposed to an exact value.</param>
4749
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that the task will observe.</param>
4850
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
49-
protected async Task VerifyCSharpFixAsync(string oldSource, string newSource, string batchNewSource = null, int? codeFixIndex = null, bool allowNewCompilerDiagnostics = false, int numberOfIncrementalIterations = -int.MaxValue, int numberOfFixAllIterations = 1, CancellationToken cancellationToken = default(CancellationToken))
51+
protected async Task VerifyCSharpFixAsync(string oldSource, string newSource, string batchNewSource = null, int? codeFixIndex = null, bool allowNewCompilerDiagnostics = false, int numberOfIncrementalIterations = DefaultNumberOfIncrementalIterations, int numberOfFixAllIterations = 1, CancellationToken cancellationToken = default(CancellationToken))
5052
{
5153
var t1 = this.VerifyFixInternalAsync(LanguageNames.CSharp, this.GetCSharpDiagnosticAnalyzers().ToImmutableArray(), this.GetCSharpCodeFixProvider(), new[] { oldSource }, new[] { newSource }, codeFixIndex, allowNewCompilerDiagnostics, numberOfIncrementalIterations, GetSingleAnalyzerDocumentAsync, cancellationToken).ConfigureAwait(false);
5254

@@ -108,7 +110,7 @@ public abstract partial class CodeFixVerifier : DiagnosticVerifier
108110
/// value is less than 0, the negated value is treated as an upper limit as opposed to an exact value.</param>
109111
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that the task will observe.</param>
110112
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
111-
protected async Task VerifyCSharpFixAsync(string[] oldSources, string[] newSources, string[] batchNewSources = null, int? codeFixIndex = null, bool allowNewCompilerDiagnostics = false, int numberOfIncrementalIterations = -int.MaxValue, int numberOfFixAllIterations = 1, CancellationToken cancellationToken = default(CancellationToken))
113+
protected async Task VerifyCSharpFixAsync(string[] oldSources, string[] newSources, string[] batchNewSources = null, int? codeFixIndex = null, bool allowNewCompilerDiagnostics = false, int numberOfIncrementalIterations = DefaultNumberOfIncrementalIterations, int numberOfFixAllIterations = 1, CancellationToken cancellationToken = default(CancellationToken))
112114
{
113115
var t1 = this.VerifyFixInternalAsync(LanguageNames.CSharp, this.GetCSharpDiagnosticAnalyzers().ToImmutableArray(), this.GetCSharpCodeFixProvider(), oldSources, newSources, codeFixIndex, allowNewCompilerDiagnostics, numberOfIncrementalIterations, GetSingleAnalyzerDocumentAsync, cancellationToken).ConfigureAwait(false);
114116

0 commit comments

Comments
 (0)