summaryrefslogtreecommitdiff
path: root/tests/src/Common/PerfHarness/PerfHarness.cs
blob: 2ec1deab91066b3e98720b2b344ce213c6b7896a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;
using Microsoft.Xunit.Performance.Api;

public class PerfHarness
{
    public static int Main(string[] args)
    {
        try
        {
            using (XunitPerformanceHarness harness = new XunitPerformanceHarness(args))
                harness.RunBenchmarks(assemblyFileName: args[0]);
            return 0;
        }
        catch (Exception ex)
        {
            Console.WriteLine("[ERROR] Benchmark execution failed.");
            Console.WriteLine($"  {ex.ToString()}");
            return 1;
        }
    }
}