Skip to content

Commit 6f6de00

Browse files
Introduce BenchmarkRunner.Run(Type[] types)
1 parent 42c7184 commit 6f6de00

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/BenchmarkDotNet/Running/BenchmarkRunnerDirty.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ public static Summary Run(Type type, IConfig config = null, string[] args = null
2929
using (DirtyAssemblyResolveHelper.Create())
3030
return RunWithExceptionHandling(() => RunWithDirtyAssemblyResolveHelper(type, config, args));
3131
}
32+
33+
[PublicAPI]
34+
public static Summary[] Run(Type[] types, IConfig config = null, string[] args = null)
35+
{
36+
using (DirtyAssemblyResolveHelper.Create())
37+
return RunWithExceptionHandling(() => RunWithDirtyAssemblyResolveHelper(types, config, args));
38+
}
3239

3340
[PublicAPI]
3441
public static Summary Run(Type type, MethodInfo[] methods, IConfig config = null)
@@ -88,6 +95,12 @@ private static Summary[] RunWithDirtyAssemblyResolveHelper(Assembly assembly, IC
8895
=> args == null
8996
? BenchmarkRunnerClean.Run(assembly.GetRunnableBenchmarks().Select(type => BenchmarkConverter.TypeToBenchmarks(type, config)).ToArray())
9097
: new BenchmarkSwitcher(assembly).RunWithDirtyAssemblyResolveHelper(args, config, false).ToArray();
98+
99+
[MethodImpl(MethodImplOptions.NoInlining)]
100+
private static Summary[] RunWithDirtyAssemblyResolveHelper(Type[] types, IConfig config, string[] args)
101+
=> args == null
102+
? BenchmarkRunnerClean.Run(types.Select(type => BenchmarkConverter.TypeToBenchmarks(type, config)).ToArray())
103+
: new BenchmarkSwitcher(types).RunWithDirtyAssemblyResolveHelper(args, config, false).ToArray();
91104

92105
[MethodImpl(MethodImplOptions.NoInlining)]
93106
private static Summary[] RunWithDirtyAssemblyResolveHelper(BenchmarkRunInfo[] benchmarkRunInfos)

0 commit comments

Comments
 (0)