|
1 | 1 | using System;
|
| 2 | +using System.ComponentModel; |
2 | 3 | using System.Linq;
|
3 | 4 | using System.Reflection;
|
4 | 5 | using System.Runtime.CompilerServices;
|
@@ -65,14 +66,22 @@ public static Summary[] Run(BenchmarkRunInfo[] benchmarkRunInfos)
|
65 | 66 | return RunWithExceptionHandling(() => RunWithDirtyAssemblyResolveHelper(benchmarkRunInfos));
|
66 | 67 | }
|
67 | 68 |
|
| 69 | + /// <summary> |
| 70 | + /// Supported only on Full .NET Framework. Not recommended. |
| 71 | + /// </summary> |
68 | 72 | [PublicAPI]
|
| 73 | + [EditorBrowsable(EditorBrowsableState.Never)] |
69 | 74 | public static Summary RunUrl(string url, IConfig config = null)
|
70 | 75 | {
|
71 | 76 | using (DirtyAssemblyResolveHelper.Create())
|
72 | 77 | return RunWithExceptionHandling(() => RunUrlWithDirtyAssemblyResolveHelper(url, config));
|
73 | 78 | }
|
74 | 79 |
|
| 80 | + /// <summary> |
| 81 | + /// Supported only on Full .NET Framework. Not recommended. |
| 82 | + /// </summary> |
75 | 83 | [PublicAPI]
|
| 84 | + [EditorBrowsable(EditorBrowsableState.Never)] |
76 | 85 | public static Summary RunSource(string source, IConfig config = null)
|
77 | 86 | {
|
78 | 87 | using (DirtyAssemblyResolveHelper.Create())
|
@@ -110,13 +119,13 @@ private static Summary[] RunWithDirtyAssemblyResolveHelper(BenchmarkRunInfo[] be
|
110 | 119 | private static Summary RunUrlWithDirtyAssemblyResolveHelper(string url, IConfig config = null)
|
111 | 120 | => RuntimeInformation.IsFullFramework
|
112 | 121 | ? BenchmarkRunnerClean.Run(BenchmarkConverter.UrlToBenchmarks(url, config)).Single()
|
113 |
| - : throw new NotSupportedException("Supported only on Full .NET Framework"); |
| 122 | + : throw new InvalidBenchmarkDeclarationException("Supported only on Full .NET Framework"); |
114 | 123 |
|
115 | 124 | [MethodImpl(MethodImplOptions.NoInlining)]
|
116 | 125 | private static Summary RunSourceWithDirtyAssemblyResolveHelper(string source, IConfig config = null)
|
117 | 126 | => RuntimeInformation.IsFullFramework
|
118 | 127 | ? BenchmarkRunnerClean.Run(BenchmarkConverter.SourceToBenchmarks(source, config)).Single()
|
119 |
| - : throw new NotSupportedException("Supported only on Full .NET Framework"); |
| 128 | + : throw new InvalidBenchmarkDeclarationException("Supported only on Full .NET Framework"); |
120 | 129 |
|
121 | 130 | private static Summary RunWithExceptionHandling(Func<Summary> run)
|
122 | 131 | {
|
|
0 commit comments