small arithmetic optimization
.NET Test / .NET tests (push) Successful in 1m56s

This commit is contained in:
2026-09-20 00:52:24 +04:00
parent 34076c2466
commit 75925ab184
18 changed files with 1366 additions and 21 deletions
@@ -0,0 +1,23 @@
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
BenchmarkSwitcher switcher = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly);
// Only these standalone discovery/help forms intentionally produce no reports.
if (args is ["--list", "flat" or "tree"] or ["--help"] or ["-h"])
{
switcher.Run(args);
return 0;
}
Summary[] summaries = [.. switcher.Run(args.Length == 0 ? ["--filter", "*"] : args)];
// BenchmarkDotNet can return normally after validation, build, or execution
// failures. Do not let CI mistake an empty or failed run for a passing smoke test.
if (summaries.Length == 0 || summaries.Any(summary =>
summary.HasCriticalValidationErrors || summary.Reports.Length == 0 ||
summary.Reports.Any(report => !report.Success || report.ResultStatistics is null)))
{
Console.Error.WriteLine("Benchmark run failed or produced no measurements.");
return 1;
}
return 0;