Skip to content

Commit 0fc0cc1

Browse files
authored
chore: modify auto-generated project build failure behaviors (#3046)
BREAKING CHANGE:
1 parent be4ff65 commit 0fc0cc1

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

src/BenchmarkDotNet/Running/BenchmarkRunnerClean.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,19 @@ private static Summary Run(BenchmarkRunInfo benchmarkRunInfo,
276276
if (!benchmark.Job.GetToolchain().IsInProcess)
277277
{
278278
logger.WriteLine();
279-
logger.WriteLineError("// BenchmarkDotNet has failed to build the auto-generated boilerplate code.");
280-
logger.WriteLineError($"// It can be found in {buildResult.ArtifactsPaths.BuildArtifactsDirectoryPath}");
281-
logger.WriteLineError("// Please follow the troubleshooting guide: https://benchmarkdotnet.org/articles/guides/troubleshooting.html");
279+
logger.WriteLineError($"// BenchmarkDotNet has failed to build the auto-generated boilerplate code.");
280+
281+
if (config.Options.IsSet(ConfigOptions.KeepBenchmarkFiles))
282+
{
283+
logger.WriteLineError($"// It can be found in {buildResult.ArtifactsPaths.BuildArtifactsDirectoryPath}");
284+
}
285+
else
286+
{
287+
artifactsToCleanup.AddRange(buildResult.ArtifactsToCleanup);
288+
logger.WriteLineError($"// Re-run benchmark with --keepFiles option to confirm auto-generated project files.");
289+
}
290+
291+
logger.WriteLineError($"// Please follow the troubleshooting guide: https://benchmarkdotnet.org/articles/guides/troubleshooting.html");
282292
}
283293

284294
if (config.Options.IsSet(ConfigOptions.StopOnFirstError) || allBuildsHaveFailed)

0 commit comments

Comments
 (0)