basic arithmetic benchmarks added
.NET Test / .NET tests (push) Successful in 1m9s

This commit is contained in:
2026-09-14 00:04:39 +04:00
parent e05e1e902a
commit cb2524980d
6 changed files with 186 additions and 9 deletions
@@ -0,0 +1,31 @@
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
namespace Just.PreciseMath.Benchmarks;
internal static class Program
{
private static int Main(string[] args)
{
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).ToArray();
// 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;
}
}