Closed alexvaluyskiy closed 7 years ago
Right now NBench has netcoreapp support in NBench.Runner https://github.com/petabridge/NBench/blob/dev/src/NBench.Runner/NBench.Runner.csproj
But it is not enough for DotNet CLI.
The proper solution is to create an additional project with almost the same content as NBench.Runner, and this metadata
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <AssemblyTitle>dotnet-nbench</AssemblyTitle> <TargetFrameworks>netcoreapp1.0</TargetFrameworks> <OutputType>Exe</OutputType> <PackageType>DotnetCliTool</PackageType> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\NBench\NBench.csproj" /> </ItemGroup> </Project>
Instead of exe and dll files the runner should accept the current project and its configuration (Debug/Release) and try to find a dll in bin/[Configuration] folder.
exe
dll
The project with performance test may add a runner via nuget, like this
<ItemGroup> <DotNetCliToolReference Include="dotnet-nbench" Version="0.3.5" /> </ItemGroup>
If we want to run the test, we should go to the project's folder and type
dotnet nbench dotnet nbench [include=MyTest*.Perf*,Other*Spec]
NBench.Runner project could stay with only one target - net452
NBench.Runner
net452
Docs: https://docs.microsoft.com/en-us/dotnet/articles/core/tools/extensibility
This is finished as of NBench 1.0. Instructions here: https://github.com/petabridge/NBench#net-core-runner
Right now NBench has netcoreapp support in NBench.Runner https://github.com/petabridge/NBench/blob/dev/src/NBench.Runner/NBench.Runner.csproj
But it is not enough for DotNet CLI.
The proper solution is to create an additional project with almost the same content as NBench.Runner, and this metadata
Instead of
exe
anddll
files the runner should accept the current project and its configuration (Debug/Release) and try to find a dll in bin/[Configuration] folder.The project with performance test may add a runner via nuget, like this
If we want to run the test, we should go to the project's folder and type
NBench.Runner
project could stay with only one target -net452
Docs: https://docs.microsoft.com/en-us/dotnet/articles/core/tools/extensibility