@@ -18,35 +18,35 @@ namespace BenchmarkDotNet.Running
18
18
public static class BenchmarkRunner
19
19
{
20
20
[ PublicAPI ]
21
- public static Summary Run < T > ( IConfig config = null , string [ ] args = null )
21
+ public static Summary Run < T > ( IConfig ? config = null , string [ ] ? args = null )
22
22
{
23
23
using ( DirtyAssemblyResolveHelper . Create ( ) )
24
24
return RunWithExceptionHandling ( ( ) => RunWithDirtyAssemblyResolveHelper ( typeof ( T ) , config , args ) ) ;
25
25
}
26
26
27
27
[ PublicAPI ]
28
- public static Summary Run ( Type type , IConfig config = null , string [ ] args = null )
28
+ public static Summary Run ( Type type , IConfig ? config = null , string [ ] ? args = null )
29
29
{
30
30
using ( DirtyAssemblyResolveHelper . Create ( ) )
31
31
return RunWithExceptionHandling ( ( ) => RunWithDirtyAssemblyResolveHelper ( type , config , args ) ) ;
32
32
}
33
33
34
34
[ PublicAPI ]
35
- public static Summary [ ] Run ( Type [ ] types , IConfig config = null , string [ ] args = null )
35
+ public static Summary [ ] Run ( Type [ ] types , IConfig ? config = null , string [ ] ? args = null )
36
36
{
37
37
using ( DirtyAssemblyResolveHelper . Create ( ) )
38
38
return RunWithExceptionHandling ( ( ) => RunWithDirtyAssemblyResolveHelper ( types , config , args ) ) ;
39
39
}
40
40
41
41
[ PublicAPI ]
42
- public static Summary Run ( Type type , MethodInfo [ ] methods , IConfig config = null )
42
+ public static Summary Run ( Type type , MethodInfo [ ] methods , IConfig ? config = null )
43
43
{
44
44
using ( DirtyAssemblyResolveHelper . Create ( ) )
45
45
return RunWithExceptionHandling ( ( ) => RunWithDirtyAssemblyResolveHelper ( type , methods , config ) ) ;
46
46
}
47
47
48
48
[ PublicAPI ]
49
- public static Summary [ ] Run ( Assembly assembly , IConfig config = null , string [ ] args = null )
49
+ public static Summary [ ] Run ( Assembly assembly , IConfig ? config = null , string [ ] ? args = null )
50
50
{
51
51
using ( DirtyAssemblyResolveHelper . Create ( ) )
52
52
return RunWithExceptionHandling ( ( ) => RunWithDirtyAssemblyResolveHelper ( assembly , config , args ) ) ;
@@ -69,7 +69,7 @@ public static Summary[] Run(BenchmarkRunInfo[] benchmarkRunInfos)
69
69
[ PublicAPI ]
70
70
[ EditorBrowsable ( EditorBrowsableState . Never ) ]
71
71
[ Obsolete ( "This method will be removed soon as it is not supported in .NET Core" ) ]
72
- public static Summary RunUrl ( string url , IConfig config = null )
72
+ public static Summary RunUrl ( string url , IConfig ? config = null )
73
73
{
74
74
using ( DirtyAssemblyResolveHelper . Create ( ) )
75
75
return RunWithExceptionHandling ( ( ) => RunUrlWithDirtyAssemblyResolveHelper ( url , config ) ) ;
@@ -78,31 +78,31 @@ public static Summary RunUrl(string url, IConfig config = null)
78
78
[ PublicAPI ]
79
79
[ EditorBrowsable ( EditorBrowsableState . Never ) ]
80
80
[ Obsolete ( "This method will be removed soon as it is not supported in .NET Core" ) ]
81
- public static Summary RunSource ( string source , IConfig config = null )
81
+ public static Summary RunSource ( string source , IConfig ? config = null )
82
82
{
83
83
using ( DirtyAssemblyResolveHelper . Create ( ) )
84
84
return RunWithExceptionHandling ( ( ) => RunSourceWithDirtyAssemblyResolveHelper ( source , config ) ) ;
85
85
}
86
86
87
87
[ MethodImpl ( MethodImplOptions . NoInlining ) ]
88
- private static Summary RunWithDirtyAssemblyResolveHelper ( Type type , IConfig config , string [ ] args )
88
+ private static Summary RunWithDirtyAssemblyResolveHelper ( Type type , IConfig ? config , string [ ] ? args )
89
89
=> ( args == null
90
90
? BenchmarkRunnerClean . Run ( new [ ] { BenchmarkConverter . TypeToBenchmarks ( type , config ) } )
91
91
: new BenchmarkSwitcher ( new [ ] { type } ) . RunWithDirtyAssemblyResolveHelper ( args , config , false ) )
92
92
. Single ( ) ;
93
93
94
94
[ MethodImpl ( MethodImplOptions . NoInlining ) ]
95
- private static Summary RunWithDirtyAssemblyResolveHelper ( Type type , MethodInfo [ ] methods , IConfig config = null )
95
+ private static Summary RunWithDirtyAssemblyResolveHelper ( Type type , MethodInfo [ ] methods , IConfig ? config = null )
96
96
=> BenchmarkRunnerClean . Run ( new [ ] { BenchmarkConverter . MethodsToBenchmarks ( type , methods , config ) } ) . Single ( ) ;
97
97
98
98
[ MethodImpl ( MethodImplOptions . NoInlining ) ]
99
- private static Summary [ ] RunWithDirtyAssemblyResolveHelper ( Assembly assembly , IConfig config , string [ ] args )
99
+ private static Summary [ ] RunWithDirtyAssemblyResolveHelper ( Assembly assembly , IConfig ? config , string [ ] ? args )
100
100
=> args == null
101
101
? BenchmarkRunnerClean . Run ( assembly . GetRunnableBenchmarks ( ) . Select ( type => BenchmarkConverter . TypeToBenchmarks ( type , config ) ) . ToArray ( ) )
102
102
: new BenchmarkSwitcher ( assembly ) . RunWithDirtyAssemblyResolveHelper ( args , config , false ) . ToArray ( ) ;
103
103
104
104
[ MethodImpl ( MethodImplOptions . NoInlining ) ]
105
- private static Summary [ ] RunWithDirtyAssemblyResolveHelper ( Type [ ] types , IConfig config , string [ ] args )
105
+ private static Summary [ ] RunWithDirtyAssemblyResolveHelper ( Type [ ] types , IConfig ? config , string [ ] ? args )
106
106
=> args == null
107
107
? BenchmarkRunnerClean . Run ( types . Select ( type => BenchmarkConverter . TypeToBenchmarks ( type , config ) ) . ToArray ( ) )
108
108
: new BenchmarkSwitcher ( types ) . RunWithDirtyAssemblyResolveHelper ( args , config , false ) . ToArray ( ) ;
@@ -113,13 +113,13 @@ private static Summary[] RunWithDirtyAssemblyResolveHelper(BenchmarkRunInfo[] be
113
113
114
114
#pragma warning disable CS0618 // Use of obsolete symbol
115
115
[ MethodImpl ( MethodImplOptions . NoInlining ) ]
116
- private static Summary RunUrlWithDirtyAssemblyResolveHelper ( string url , IConfig config = null )
116
+ private static Summary RunUrlWithDirtyAssemblyResolveHelper ( string url , IConfig ? config = null )
117
117
=> RuntimeInformation . IsFullFramework
118
118
? BenchmarkRunnerClean . Run ( BenchmarkConverter . UrlToBenchmarks ( url , config ) ) . Single ( )
119
119
: throw new InvalidBenchmarkDeclarationException ( "Supported only on Full .NET Framework" ) ;
120
120
121
121
[ MethodImpl ( MethodImplOptions . NoInlining ) ]
122
- private static Summary RunSourceWithDirtyAssemblyResolveHelper ( string source , IConfig config = null )
122
+ private static Summary RunSourceWithDirtyAssemblyResolveHelper ( string source , IConfig ? config = null )
123
123
=> RuntimeInformation . IsFullFramework
124
124
? BenchmarkRunnerClean . Run ( BenchmarkConverter . SourceToBenchmarks ( source , config ) ) . Single ( )
125
125
: throw new InvalidBenchmarkDeclarationException ( "Supported only on Full .NET Framework" ) ;
0 commit comments