Skip to content

Commit

Permalink
update to latest #BenchmarkDotNet version
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsitnik committed Jul 15, 2016
1 parent a1f0b1c commit 6ca587c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 28 deletions.
3 changes: 2 additions & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="benchmarkDotNetDevelop" value="https://ci.appveyor.com/nuget/benchmarkdotnet" />
</packageSources>
</configuration>
14 changes: 14 additions & 0 deletions tests/ImageProcessorCore.Benchmarks/Config.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using BenchmarkDotNet.Configs;

namespace ImageProcessorCore.Benchmarks
{
public class Config : ManualConfig
{
public Config()
{
// uncomment if you want to use any of the diagnoser
//Add(new BenchmarkDotNet.Diagnostics.MemoryDiagnoser());
//Add(new BenchmarkDotNet.Diagnostics.InliningDiagnoser());
}
}
}
21 changes: 1 addition & 20 deletions tests/ImageProcessorCore.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
namespace ImageProcessorCore.Benchmarks
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

public class Program
Expand All @@ -18,20 +12,7 @@ public class Program
/// </param>
public static void Main(string[] args)
{
// Use reflection for a more maintainable way of creating the benchmark switcher,
Type[] benchmarks = typeof(Program).Assembly.GetTypes()
.Where(t => t.GetMethods(BindingFlags.Instance | BindingFlags.Public)
.Any(m => m.GetCustomAttributes(typeof(BenchmarkAttribute), false).Any()))
.OrderBy(t => t.Namespace)
.ThenBy(t => t.Name)
.ToArray();

// TODO: This throws an exception.
// List<string> x = new List<string>(args) { "diagnosers=MemoryDiagnoser,InliningDiagnoser" };
BenchmarkSwitcher benchmarkSwitcher = new BenchmarkSwitcher(benchmarks);

// benchmarkSwitcher.Run(x.ToArray());
benchmarkSwitcher.Run(args);
new BenchmarkSwitcher(typeof(Program).Assembly).Run(args);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
using ImageProcessorCore.Benchmarks;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
Expand All @@ -21,3 +23,5 @@

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("299d8e18-102c-42de-adbf-79098ee706a8")]

[assembly: Config(typeof(Config))]
10 changes: 3 additions & 7 deletions tests/ImageProcessorCore.Benchmarks/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"emitEntryPoint": true
},
"dependencies": {
"BenchmarkDotNet": "0.9.7",
"BenchmarkDotNet.Diagnostics.Windows": "0.9.7",
"BenchmarkDotNet": "0.9.8-develop",
"BenchmarkDotNet.Diagnostics.Windows": "0.9.8-develop",
"ImageProcessorCore": "1.0.0-*"
},
"commands": {
Expand All @@ -24,12 +24,8 @@
"net451": {
"dependencies": {
},
"imports": [
"dnx451"
],
"frameworkAssemblies": {
"System.Drawing": "",
"System.Runtime": ""
"System.Drawing": ""
}
}
}
Expand Down

0 comments on commit 6ca587c

Please sign in to comment.