New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single point of full config creation #565
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
using BenchmarkDotNet.Analysers; | ||
using BenchmarkDotNet.Columns; | ||
using BenchmarkDotNet.Diagnosers; | ||
using BenchmarkDotNet.Exporters; | ||
using BenchmarkDotNet.Filters; | ||
using BenchmarkDotNet.Jobs; | ||
using BenchmarkDotNet.Loggers; | ||
using BenchmarkDotNet.Order; | ||
using BenchmarkDotNet.Reports; | ||
using BenchmarkDotNet.Validators; | ||
|
||
using JetBrains.Annotations; | ||
|
||
namespace BenchmarkDotNet.Configs | ||
{ | ||
[PublicAPI] | ||
public class ReadOnlyConfig : IConfig | ||
{ | ||
#region Fields & .ctor | ||
private readonly IConfig config; | ||
|
||
public ReadOnlyConfig([NotNull] IConfig config) | ||
{ | ||
if (config == null) | ||
throw new ArgumentNullException(nameof(config)); | ||
|
||
this.config = config; | ||
} | ||
#endregion | ||
|
||
#region IConfig implementation | ||
public IEnumerable<IColumnProvider> GetColumnProviders() => config.GetColumnProviders(); | ||
public IEnumerable<IExporter> GetExporters() => config.GetExporters(); | ||
public IEnumerable<ILogger> GetLoggers() => config.GetLoggers(); | ||
public IEnumerable<IDiagnoser> GetDiagnosers() => config.GetDiagnosers(); | ||
public IEnumerable<IAnalyser> GetAnalysers() => config.GetAnalysers(); | ||
public IEnumerable<Job> GetJobs() => config.GetJobs(); | ||
public IEnumerable<IValidator> GetValidators() => config.GetValidators(); | ||
public IEnumerable<HardwareCounter> GetHardwareCounters() => config.GetHardwareCounters(); | ||
public IEnumerable<IFilter> GetFilters() => config.GetFilters(); | ||
|
||
public IOrderProvider GetOrderProvider() => config.GetOrderProvider(); | ||
public ISummaryStyle GetSummaryStyle() => config.GetSummaryStyle(); | ||
|
||
public ConfigUnionRule UnionRule => config.UnionRule; | ||
|
||
public bool KeepBenchmarkFiles => config.KeepBenchmarkFiles; | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using BenchmarkDotNet.Configs; | ||
|
||
namespace BenchmarkDotNet.Running | ||
{ | ||
public class BenchmarkRunInfo | ||
{ | ||
public BenchmarkRunInfo(Benchmark[] benchmarks, Type type, ReadOnlyConfig config) | ||
{ | ||
Benchmarks = benchmarks; | ||
Type = type; | ||
Config = config; | ||
} | ||
public Benchmark[] Benchmarks { get; } | ||
public Type Type { get; } | ||
public ReadOnlyConfig Config { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
Sorry, something went wrong.