Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
* dev:
  v1.0.3 release notes
  ignore integraion test on Mono for now
  shouldrunallbenchmarks wasn't giving any beneficial feedback so got rid of it
  try splitting off loadassemblies test as its own class
  use dotnet pack for netstanjdard packages since it handles folder structure and file includes
  nbench nuspec (doesn't work)
  performancecounters re-enable
  nuget tweaks
  typo in nbench step
  deprecate DotNetCli project and compile into NBench.Runner for .NET Core version
  revise createnuget step in fake
  • Loading branch information
heynickc committed Jun 10, 2017
2 parents e787e60 + b3e4bc7 commit 113fb5e
Show file tree
Hide file tree
Showing 6 changed files with 323 additions and 199 deletions.
44 changes: 34 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,32 +55,56 @@ After defining some NBench `PerfBenchmark` methods and declaring some measuremen

### .NET 4.5.2 Runner

To install the .NET 4.5.2 NBench runner via NuGet:
The NBench Runner NuGet package now contains executables that support .NET 4.5.2, .NET Core 1.1/win7-x64, and .NET Core 1.1/debian8-x64 benchmark assembly targets. Before v1.0.3, you would expect the NBench.Runner NuGet package to contain a single executable that works with .NET 4.5.2:

```
lib/
net45/
NBench.Runner.exe
```

With the additional .NET Core executables, you will now get two additional subfolders in your downloaded package:

```
lib/
net452/
NBench.Runner.exe
netcoreapp1.1/
win7-x64/
NBench.Runner.exe
debian8-x64/
NBench.Runner
```

You may choose the appropriate executable for your benchmark assembly/architecture combination

To install and execute the NBench Runner against a .NET 4.5.2 benchmark assembly, you would execute the following:

```
PS> Install-Package NBench.Runner
PS> .\packages\NBench.Runner\NBench.Runner.exe .\src\bin\Debug\MyPerfTests.dll output-directory="C:\Perf"
PS> <--packageLocation-->\NBench.Runner\lib\net452\NBench.Runner.exe <--benchmarkProjectLocation-->\bin\Debug\net452\MyPerfTests.dll output-directory="C:\Perf"
```

And this command will run your `PerfBenchmark` and write output [that looks like this](https://gist.github.com/Aaronontheweb/8e0bfa2cccc63f5bd8bf) to a markdown file in the `output-directory`.

### .NET Core Runner

NBench 1.0.0 has a separate runner for projects that target .NET Core 1.0. It is installed on a per-project basis via NuGet by adding a `<DotNetCliToolReference>` to your test project's `.csproj` file:
If you have compiled a benchmark assembly that targets .NET Core 1.1, you may use the appropriate executable from the lib/netcoreap1.1 folder of the downloaded NBench.Runner NuGet package;

On 64-bit Windows:

```
<ItemGroup>
<DotNetCliToolReference Include="NBench.Runner.DotNetCli" Version="1.0.0" />
</ItemGroup>
PS> Install-Package NBench.Runner
PS> <--packageLocation-->\NBench.Runner\lib\netcoreapp1.1\win7-x64\NBench.Runner.exe <--benchmarkProjectLocation-->\bin\Debug\netcoreapp1.1\MyPerfTests.dll output-directory="C:\Perf"
```

After adding this reference, run `dotnet restore` and the NBench .NET Core runner will be installed for your project. To run the tests, open a command prompt and navigate to the project's parent folder. You can now run the following command, passing the same arguments as `NBench.Runner.exe`:
On 64-bit Debian 8:

```
PS> dotnet nbench .\src\bin\Debug\MyPerfTests.dll output-directory="C:\Perf"
PS> Install-Package NBench.Runner
PS> <--packageLocation-->\NBench.Runner\lib\netcoreapp1.1\debian8-x64\NBench.Runner.exe <--benchmarkProjectLocation-->\bin\Debug\netcoreapp1.1\MyPerfTests.dll output-directory="C:\Perf"
```

**NOTE:** Your shell's working directory must be inside the folder containing the .csproj file with the above `<DotNetCliToolReference>` in order to run `dotnet nbench`.

## Command Line Parameters
```
NBench.Runner.exe [assembly names] [output-directory={dir-path}] [configuration={file-path}] [include=MyTest*.Perf*,Other*Spec] [exclude=*Long*] [concurrent={true|false}]
Expand Down
47 changes: 47 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
#### v1.0.3 June 7 2017

This release resolves issues with NuGet deployment of the dedicated NBench.Runner.DotNetCli runner that was originally designed to be used for .NET Core projects. The issue is detailed by [#200](https://github.com/petabridge/NBench/issues/200) and resolved with PR [#201](https://github.com/petabridge/NBench/pull/201).

Important breaking change:

NBench.Runner.DotNetCli is being deprecated (temporarily) as the supported means of running the NBench runner with a benchmark assembly that targets .NET Core. Instead, the original [NBench.Runner](https://www.nuget.org/packages/NBench.Runner/) will come packaged with 2 additional executables that are compatible with .NET Core. Originally, per the instructions on the README, to run the **.NET 4.5.2** you would run the following commands:

```
PS> Install-Package NBench.Runner
PS> .\packages\NBench.Runner\NBench.Runner.exe .\src\bin\Debug\MyPerfTests.dll output-directory="C:\Perf
```

Since the new NBench.Runner NuGet package ships the additional .NET Core runner, the folder structure of the downloaded runner is as follows:

lib/
net452/
NBench.Runner.exe
netcoreapp1.1/
win7-x64/
NBench.Runner.exe
debian8-x64/
NBench.Runner

The above way to run the .NET 4.5.2 runner, hence, changes to:

```
PS> Install-Package NBench.Runner
PS> .\packages\NBench.Runner\lib\net452\NBench.Runner.exe .\src\bin\Debug\net452\MyPerfTests.dll output-directory="C:\Perf
```

For .NET Core support (meaning running a benchmark that has been targeted for `netcoreapp1.1` or `netstandard1.6`, you will run the appropriate NBench.Runner.exe for your architecture:

```
PS> Install-Package NBench.Runner
PS> .\packages\NBench.Runner\lib\netcoreapp1.1\win7-x64\NBench.Runner.exe .\src\bin\Debug\netcoreapp1.1\MyPerfTests.dll output-directory="C:\Perf
```

or, on Debian 8:

```
PS> Install-Package NBench.Runner
PS> .\packages\NBench.Runner\lib\netcoreapp1.1\debian8-x64\NBench.Runner.exe .\src\bin\Debug\netcoreapp1.1\MyPerfTests.dll output-directory="C:\Perf
```

Plans will be made to re-introduce support for NBench.Runner.DotNetCli which allows for the usage of NBench as a `DotNetCliToolReference`.

#### v1.0.2 May 31 2017

This release resolves issues: [#182](https://github.com/petabridge/NBench/issues/182) and [#192](https://github.com/petabridge/NBench/issues/192) relating to the NBench.Runner.DotNetCli (the NBench Runner that can execute benchmarks for assemblies that target .NET Core). The root cause was that the runner was unable to execute .NET Core benchmarks that had external dependencies.
Expand Down
Loading

0 comments on commit 113fb5e

Please sign in to comment.