@@ -60,6 +60,7 @@ internal static Summary[] Run(BenchmarkRunInfo[] benchmarkRunInfos)
60
60
61
61
var buildPartitions = BenchmarkPartitioner . CreateForBuild ( supportedBenchmarks , resolver ) ;
62
62
var buildResults = BuildInParallel ( compositeLogger , rootArtifactsFolderPath , buildPartitions , ref globalChronometer ) ;
63
+ var allBuildsHaveFailed = buildResults . Values . All ( buildResult => ! buildResult . IsBuildSuccess ) ;
63
64
64
65
try
65
66
{
@@ -85,7 +86,7 @@ internal static Summary[] Run(BenchmarkRunInfo[] benchmarkRunInfos)
85
86
86
87
results . Add ( summary ) ;
87
88
88
- if ( benchmarkRunInfo . Config . Options . IsSet ( ConfigOptions . StopOnFirstError ) && summary . Reports . Any ( report => ! report . Success ) )
89
+ if ( ( benchmarkRunInfo . Config . Options . IsSet ( ConfigOptions . StopOnFirstError ) && summary . Reports . Any ( report => ! report . Success ) ) || allBuildsHaveFailed )
89
90
break ;
90
91
}
91
92
@@ -132,6 +133,7 @@ private static Summary Run(BenchmarkRunInfo benchmarkRunInfo,
132
133
ref StartedClock runChronometer )
133
134
{
134
135
var benchmarks = benchmarkRunInfo . BenchmarksCases ;
136
+ var allBuildsHaveFailed = benchmarks . All ( benchmark => ! buildResults [ benchmark ] . buildResult . IsBuildSuccess ) ;
135
137
var config = benchmarkRunInfo . Config ;
136
138
var cultureInfo = config . CultureInfo ?? DefaultCultureInfo . Instance ;
137
139
var reports = new List < BenchmarkReport > ( ) ;
@@ -189,7 +191,7 @@ private static Summary Run(BenchmarkRunInfo benchmarkRunInfo,
189
191
logger . WriteLineError ( "// Please follow the troubleshooting guide: https://benchmarkdotnet.org/articles/guides/troubleshooting.html" ) ;
190
192
}
191
193
192
- if ( config . Options . IsSet ( ConfigOptions . StopOnFirstError ) )
194
+ if ( config . Options . IsSet ( ConfigOptions . StopOnFirstError ) || allBuildsHaveFailed )
193
195
break ;
194
196
}
195
197
0 commit comments