Browse Source

Merge remote-tracking branch 'refs/remotes/origin/Core' into Core-Flava

Former-commit-id: 2640c7c2f4ebff830b94f107e3416ae74ef90176
Former-commit-id: 9f18dfc5e7ffe3c034530d2612a2d388ebce0881
Former-commit-id: a1414ec493a93473ac1eb123f781c83a3df4233c
af/merge-core
James Jackson-South 10 years ago
parent
commit
2923f0e982
  1. 3
      NuGet.config
  2. 14
      tests/ImageProcessorCore.Benchmarks/Config.cs
  3. 21
      tests/ImageProcessorCore.Benchmarks/Program.cs
  4. 4
      tests/ImageProcessorCore.Benchmarks/Properties/AssemblyInfo.cs
  5. 9
      tests/ImageProcessorCore.Benchmarks/project.json

3
NuGet.config

@ -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
tests/ImageProcessorCore.Benchmarks/Config.cs

@ -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
this.Add(new BenchmarkDotNet.Diagnostics.Windows.MemoryDiagnoser());
this.Add(new BenchmarkDotNet.Diagnostics.Windows.InliningDiagnoser());
}
}
}

21
tests/ImageProcessorCore.Benchmarks/Program.cs

@ -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
@ -18,20 +12,7 @@
/// </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);
}
}
}

4
tests/ImageProcessorCore.Benchmarks/Properties/AssemblyInfo.cs

@ -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
@ -21,3 +23,5 @@ using System.Runtime.InteropServices;
// 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))]

9
tests/ImageProcessorCore.Benchmarks/project.json

@ -13,8 +13,7 @@
"emitEntryPoint": true
},
"dependencies": {
"BenchmarkDotNet": "0.9.7",
"BenchmarkDotNet.Diagnostics.Windows": "0.9.7",
"BenchmarkDotNet.Diagnostics.Windows": "0.9.8.78",
"ImageProcessorCore": "1.0.0-*"
},
"commands": {
@ -24,12 +23,8 @@
"net451": {
"dependencies": {
},
"imports": [
"dnx451"
],
"frameworkAssemblies": {
"System.Drawing": "",
"System.Runtime": ""
"System.Drawing": ""
}
}
}

Loading…
Cancel
Save