private static void MainWithOpts(CliOptions opts) { Console.WriteLine($"Starting benchmark with {Path.Combine(opts.BaseDirectory, opts.TestPcapFilename)}"); Environment.SetEnvironmentVariable(PcapLoaderBenchmark.BaseDirectoryFullPathEnvName, opts.BaseDirectory); Environment.SetEnvironmentVariable(PcapLoaderBenchmark.TestPcapFilenameEnvName, opts.TestPcapFilename); BenchmarkRunner.Run <PcapLoaderBenchmark>(); }
private static void Main(String[] args) { CliOptions opts = null; Parser.Default.ParseArguments <CliOptions>(args).WithParsed(options => { opts = options; }); var baseDirectoryFullPath = opts?.BaseDirectory ?? Environment.GetEnvironmentVariable(PcapLoaderBenchmark.BaseDirectoryFullPathEnvName) ?? Path.GetFullPath($"{Directory.GetCurrentDirectory()}/../TestingData"); Environment.SetEnvironmentVariable(PcapLoaderBenchmark.BaseDirectoryFullPathEnvName, baseDirectoryFullPath); BenchmarkRunner.Run <PcapLoaderBenchmark>(); }