Skip to content

Commit

Permalink
Allow custom runtimes to use Executor (#2285)
Browse files Browse the repository at this point in the history
* Allow custom runtimes to use Executor

* Apply @AndreyAkinshin's suggestion
  • Loading branch information
tgjones committed Mar 12, 2023
1 parent 6162e9d commit 565870f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/BenchmarkDotNet/Environments/Runtimes/CustomRuntime.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using BenchmarkDotNet.Jobs;

namespace BenchmarkDotNet.Environments
{
public abstract class CustomRuntime : Runtime
{
protected CustomRuntime(RuntimeMoniker runtimeMoniker, string msBuildMoniker, string displayName)
: base(runtimeMoniker, msBuildMoniker, displayName)
{
}
}
}
4 changes: 4 additions & 0 deletions src/BenchmarkDotNet/Toolchains/Executor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ private static ProcessStartInfo CreateStartInfo(BenchmarkCase benchmarkCase, Art
start.Arguments = args;
start.WorkingDirectory = artifactsPaths.BinariesDirectoryPath;
break;
case CustomRuntime _:
start.FileName = exePath;
start.Arguments = args;
break;
default:
throw new NotSupportedException("Runtime = " + runtime);
}
Expand Down

0 comments on commit 565870f

Please sign in to comment.