tand/build/benchmarks/DotnetBenchmarkExtensions.cs
Peter Kurfer d8d307545f
Refactored
- Added Benchmarks
- Added Nuke build
- Refactored directory structure
- Generated GitHub Actions config from Nuke
- Added tool to handle benchmarking from Nuke
2020-03-21 01:10:20 +01:00

21 lines
No EOL
707 B
C#

using System.Collections.Generic;
using Nuke.Common.Tooling;
namespace _build.benchmarks
{
public static class DotNetBenchmarkExtensions
{
public static IReadOnlyCollection<Output> DotNetBenchmark(Configure<BenchmarkToolSettings> configurator)
{
return DotNetBenchmark(configurator(new BenchmarkToolSettings()));
}
public static IReadOnlyCollection<Output> DotNetBenchmark(BenchmarkToolSettings toolSettings = null)
{
toolSettings ??= new BenchmarkToolSettings();
var process = ProcessTasks.StartProcess(toolSettings);
process.AssertZeroExitCode();
return process.Output;
}
}
}