You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52-30Lines changed: 52 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,29 @@ public class CounterPerfSpecs
53
53
54
54
After defining some NBench `PerfBenchmark` methods and declaring some measurements, you can run your benchmark by downloading the `NBench.Runner.exe` via NuGet.
55
55
56
-
### .NET 4.5.2 Runner
56
+
### Running NBench Tests with `dotnet nbench`
57
+
The easiest way to run NBench in any runtime, .NET Core or .NET Framework is to install the `dotnet-nbench` NuGet package and add it as a `DotNetCliToolReference` to your NBench test projects.
This will allow you to run NBench specifications for all frameworks your test projects target, including multi-targeted projects, by simply running the following command in the working directory of your test project:
This will build and compile your project, as well as run the appropriate `NBench.Runner` executable to run your tests and produce an output report.
72
+
73
+
> N.B. If you don't specify an `--output` setting while running in this mode, `dotnet-nbench` will automatically record all output to the `[currentDir]/PerfResults/[framework]`.
74
+
75
+
### Stand-alone Runner
76
+
Below are the instructions for the standalone `NBench.Runner` package, which is substantially more manual than the `dotnet nbench` runner described above.
77
+
78
+
#### .NET 4.5.2 Runner
57
79
58
80
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:
59
81
@@ -69,11 +91,15 @@ With the additional .NET Core executables, you will now get two additional subfo
69
91
lib/
70
92
net452/
71
93
NBench.Runner.exe
72
-
netcoreapp1.1/
94
+
netcoreapp1.0/
73
95
win7-x64/
74
-
NBench.Runner.exe
75
-
debian8-x64/
76
-
NBench.Runner
96
+
NBench.Runner.dll
97
+
netcoreapp2.0/
98
+
win7-x64/
99
+
NBench.Runner.dll
100
+
netcoreapp2.1/
101
+
win7-x64/
102
+
NBench.Runner.dll
77
103
```
78
104
79
105
You may choose the appropriate executable for your benchmark assembly/architecture combination
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`.
89
115
90
-
### .NET Core Runner
116
+
####.NET Core Runner
91
117
92
118
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;
***assembly names** - list of assemblies to load and test. Space delimited. Requires `.dll` or `.exe` at the end of each assembly name
114
-
***output-directory=path** - folder where a Markdown report will be exported. Report will [look like this](https://gist.github.com/Aaronontheweb/8e0bfa2cccc63f5bd8bf)
115
-
***configuration=path** - folder with a config file to be used when loading the `assembly names`
116
-
***include=name test pattern** - a "`,`"(comma) separted list of wildcard pattern to be mached and included in the tests. Default value is `*` (all)
134
+
***--output-directorypath** - folder where a Markdown report will be exported. Report will [look like this](https://gist.github.com/Aaronontheweb/8e0bfa2cccc63f5bd8bf)
135
+
***--configurationpath** - folder with a config file to be used when loading the `assembly names`
136
+
***--includename test pattern** - a "`,`"(comma) separted list of wildcard pattern to be mached and included in the tests. Default value is `*` (all)
117
137
The test is executed on the complete name of the benchmark `Namespace.Class+MethodName`
118
-
***exclude=name test pattern** - a "`,`"(comma) separted list of wildcard pattern to be mached and excluded in the tests. Default value is `` (none)
138
+
***--excludename test pattern** - a "`,`"(comma) separted list of wildcard pattern to be mached and excluded in the tests. Default value is `` (none)
119
139
The test is executed on the complete name of the benchmark `Namespace.Class+MethodName`
120
-
***concurrent=true|false** - disables thread priority and processor affinity operations for all benchmarks. Used only when running multi-threaded benchmarks. Set to `false` (single-threaded) by default.
121
-
***tracing=true|false** - turns on trace capture inside the NBench runner and will save any captured messages to all available output targets, including Markdown reports. Set to `false` by default.
140
+
***-- concurrent true|false** - disables thread priority and processor affinity operations for all benchmarks. Used only when running multi-threaded benchmarks. Set to `false` (single-threaded) by default.
141
+
***--trace true|false** - turns on trace capture inside the NBench runner and will save any captured messages to all available output targets, including Markdown reports. Set to `false` by default.
142
+
***--diagnostic** - turns on diagnostic logging inside the `NBench.Runner` and `dotnet-nbench` executables.
143
+
***--teamcity** - turns on TeamCity message formatting.
122
144
123
145
Supported wildcard patterns are `*` any string and `?` any char. In order to include a class with all its tests in the benchmark
124
146
you need to specify a pattern finishing in `*`. E.g. `include=*.MyBenchmarkClass.*`.
125
147
126
148
Example patterns:
127
149
128
150
```
129
-
include="*MyBenchmarkClass*" (include all benchmarks in MyBenchmarkClass)
130
-
include="*MyBenchmarkClass+MyBenchmark" (include MyBenchmark in MyBenchmarkClass)
131
-
include="*MyBenchmarkClass*,*MyOtherBenchmarkClass*" (include all benchmarks in MyBenchmarkClass and MyOtherBenchmarkClass)
151
+
--include"*MyBenchmarkClass*" (include all benchmarks in MyBenchmarkClass)
152
+
--include"*MyBenchmarkClass+MyBenchmark" (include MyBenchmark in MyBenchmarkClass)
153
+
--include"*MyBenchmarkClass*,*MyOtherBenchmarkClass*" (include all benchmarks in MyBenchmarkClass and MyOtherBenchmarkClass)
132
154
133
-
exclude=*"MyBenchmarkClass* "(exclude all benchmarks in MyBenchmarkClass)
134
-
exclude="*MyBenchmarkClass+MyBenchmark" (exclude MyBenchmark in MyBenchmarkClass)
135
-
exclude="*MyBenchmarkClass*,*MyOtherBenchmarkClass*" (exclude all benchmarks in MyBenchmarkClass and MyOtherBenchmarkClass)
155
+
--exclude "*MyBenchmarkClass* "(exclude all benchmarks in MyBenchmarkClass)
156
+
--exclude"*MyBenchmarkClass+MyBenchmark" (exclude MyBenchmark in MyBenchmarkClass)
157
+
--exclude"*MyBenchmarkClass*,*MyOtherBenchmarkClass*" (exclude all benchmarks in MyBenchmarkClass and MyOtherBenchmarkClass)
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,11 @@
1
+
#### v1.2.0 July 10 2018
2
+
Introduces the `dotnet-nbench` package, which allows all NBench packages to be executed via the `dotnet` CLI regardless of how many frameworks are targeted by a particular project.
3
+
4
+
You can read more about the details of how the `dotnet-nbench` package works here: https://github.com/Petabridge/NBench/blob/master/README.md#running-nbench-tests-with-dotnet-nbench
5
+
6
+
**Support for .NET Core 2.0 and 2.1**
7
+
All NBench runners now ship with native support for .NET Core 2.0 and .NET Core 2.1.
8
+
1
9
#### v1.1.0 July 1 2018
2
10
Fixes several major issues with the `NBench.Runner` executable and being able to support .NET Core dependencies. This is the first set of fixes in a series of ongoing changes designed to help make NBench more user-friendly, extensible, and capable of all manner of interesting performance-related tasks.
0 commit comments