Skip to content

Commit

Permalink
Merge pull request #198 from petabridge/dev
Browse files Browse the repository at this point in the history
NBench v1.0.2 production release
  • Loading branch information
Aaronontheweb authored Jun 2, 2017
2 parents edb2b5a + e13be8d commit e787e60
Show file tree
Hide file tree
Showing 46 changed files with 125,222 additions and 95 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,9 @@
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

###############################################################################
# behavior for bash scripts
# bash scripts must keep Unix line endings
###############################################################################
*.sh text eol=lf
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,4 @@ build/
.nuget/
.dotnet/
.idea/.idea.NBench.NetCore/.idea/*
launchSettings.json
29 changes: 29 additions & 0 deletions NBench.Tests.Reporting/NBench.Tests.Reporting.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit" Version="2.3.0-beta2-build3683" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta2-build1317" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta2-build3683" />
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="15.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
<PackageReference Include="ApprovalTests" Version="3.0.13" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\src\NBench\NBench.csproj" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public class MarkdownBenchmarkOutputSpec
".." + Path.DirectorySeparatorChar
+ ".." + Path.DirectorySeparatorChar
+ ".." + Path.DirectorySeparatorChar
+ ".." + Path.DirectorySeparatorChar
+ ".." + Path.DirectorySeparatorChar;
private static readonly string _perfResultsPath =
Path.GetFullPath(_solutionPath + "PerfResults");
Expand Down
32 changes: 31 additions & 1 deletion NBench.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.4
VisualStudioVersion = 15.0.26430.6
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", "{C8104500-2C0F-46A2-AE84-A3D74CC55697}"
EndProject
Expand Down Expand Up @@ -39,6 +39,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBench.PerformanceCounters.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBench.Runner.DotNetCli", "src\NBench.Runner.DotNetCli\NBench.Runner.DotNetCli.csproj", "{552BA093-1A4A-455D-8186-B8018C9972D5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBench.Tests.Performance.WithDependencies", "tests\NBench.Tests.Performance.WithDependencies\NBench.Tests.Performance.WithDependencies.csproj", "{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NBench.Tests.Reporting", "NBench.Tests.Reporting\NBench.Tests.Reporting.csproj", "{7D45CF9B-F2AC-4879-B325-4486F58A3435}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -181,6 +185,30 @@ Global
{552BA093-1A4A-455D-8186-B8018C9972D5}.Release|x64.Build.0 = Release|Any CPU
{552BA093-1A4A-455D-8186-B8018C9972D5}.Release|x86.ActiveCfg = Release|Any CPU
{552BA093-1A4A-455D-8186-B8018C9972D5}.Release|x86.Build.0 = Release|Any CPU
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Debug|x64.ActiveCfg = Debug|Any CPU
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Debug|x64.Build.0 = Debug|Any CPU
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Debug|x86.ActiveCfg = Debug|Any CPU
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Debug|x86.Build.0 = Debug|Any CPU
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Release|Any CPU.Build.0 = Release|Any CPU
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Release|x64.ActiveCfg = Release|Any CPU
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Release|x64.Build.0 = Release|Any CPU
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Release|x86.ActiveCfg = Release|Any CPU
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Release|x86.Build.0 = Release|Any CPU
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Debug|x64.ActiveCfg = Debug|Any CPU
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Debug|x64.Build.0 = Debug|Any CPU
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Debug|x86.ActiveCfg = Debug|Any CPU
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Debug|x86.Build.0 = Debug|Any CPU
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Release|Any CPU.Build.0 = Release|Any CPU
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Release|x64.ActiveCfg = Release|Any CPU
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Release|x64.Build.0 = Release|Any CPU
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Release|x86.ActiveCfg = Release|Any CPU
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -194,5 +222,7 @@ Global
{96FCB3AB-8C76-4BD0-B97F-1239E5FF5C5C} = {1F1914B9-8F67-4B51-9738-CDE5AFB2F8DE}
{FD7BE8F5-460F-4A3D-A479-E4AF36C4EED5} = {1F1914B9-8F67-4B51-9738-CDE5AFB2F8DE}
{416A4BAD-459C-4896-A44C-4C2344EBE154} = {1F1914B9-8F67-4B51-9738-CDE5AFB2F8DE}
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D} = {1F1914B9-8F67-4B51-9738-CDE5AFB2F8DE}
{7D45CF9B-F2AC-4879-B325-4486F58A3435} = {1F1914B9-8F67-4B51-9738-CDE5AFB2F8DE}
EndGlobalSection
EndGlobal
20 changes: 19 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
#### v1.0.1 March March 29 2017
#### 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.

Other changes include:

- Integration tests to validate that the above issue is resolved
- Upgrade to xUnit .NET Core CLI runner (v2.3.0-beta2-build3683) for all NBench unit tests
- Update .NET Core runtime targets to `netcoreapp1.1`

If you are using the .NET Core CLI runner for NBench and encountered this issue, please be sure to update your `<DotNetCliToolReference>` to v1.0.2:

```
<ItemGroup>
<DotNetCliToolReference Include="NBench.Runner.DotNetCli" Version="1.0.2" />
</ItemGroup>
```

#### v1.0.1 March 29 2017

This release resolves an issue with the v1.0.0 NuGet release for NBench.Runner in which clients installing the package via `Install-Package NBench.Runner` were not getting the NBench.dll dependency for NBench.Runner.exe. NBench.dll is now compiled into NBench.Runner.exe.

Expand Down
121 changes: 53 additions & 68 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,78 +72,63 @@ Target "RestorePackages" (fun _ ->
)

Target "Build" (fun _ ->
if (isWindows) then
let runSingleProject project =
DotNetCli.Build
(fun p ->
{ p with
Project = project
Configuration = configuration })

let projects = !! "./src/**/*.csproj" ++ "./tests/**/*.csproj"

projects |> Seq.iter (runSingleProject)
else
let runSingleProject project =
DotNetCli.Build
(fun p ->
{ p with
Project = "./src/NBench/NBench.csproj"
Framework = "netstandard1.6"
Configuration = configuration })

let runSingleProjectNetCore project =
DotNetCli.Build
(fun p ->
{ p with
Project = project
Framework = "netcoreapp1.0"
Configuration = configuration })

let netCoreProjects = (!! "./src/**/*NBench.Runner.DotNetCli.csproj"
++ "./tests/**/*NBench.Tests*.csproj"
-- "./tests/**/*NBench.PerformanceCounters.Tests.*.csproj")
(fun p ->
{ p with
Project = project
Configuration = configuration
AdditionalArgs = ["--no-incremental"]}) // "Rebuild"

netCoreProjects |> Seq.iter (runSingleProjectNetCore)
let projects = !! "./src/**/*.csproj" ++ "./tests/**/*.csproj"

projects |> Seq.iter (runSingleProject)
)

Target "RunTests" (fun _ ->
if (isWindows) then
let runSingleProject project =
DotNetCli.Test
(fun p ->
{ p with
Project = project
Configuration = configuration})

let projects = (!! "./tests/**/*NBench.Tests*.csproj"
-- "./tests/**/*NBench.Tests.Assembly.csproj")

projects |> Seq.iter (log)
projects |> Seq.iter (runSingleProject)

else
let runSingleProjectNetCore project =
DotNetCli.Test
(fun p ->
{ p with
Project = project
Framework = "netcoreapp1.0"
Configuration = configuration})

let projects = (!! "./tests/**/*NBench.Tests*.csproj"
-- "./tests/**/*NBench.PerformanceCounters.Tests.*.csproj"
-- "./tests/**/*NBench.Tests.Performance.csproj"
-- "./tests/**/*NBench.Tests.Assembly.csproj")
let sampleBenchmarProjects = !! "./tests/**/NBench.Tests.Performance.csproj"
++ "./tests/**/NBench.Tests.Performance.WithDependencies.csproj"
++ "./tests/**/NBench.Tests.Assembly.csproj"

sampleBenchmarProjects |> Seq.iter (fun proj ->
DotNetCli.Build
(fun p ->
{ p with
Project = proj
Configuration = configuration
AdditionalArgs = ["--no-incremental"]}))

projects |> Seq.iter (log)
projects |> Seq.iter (runSingleProjectNetCore)
let runSingleProject project =
DotNetCli.RunCommand
(fun p ->
{ p with
WorkingDir = (Directory.GetParent project).FullName
TimeOut = TimeSpan.FromMinutes 10. })
(sprintf "xunit -parallel none -teamcity -xml %s_xunit.xml" (outputTests @@ fileNameWithoutExt project))

let projects =
match (isWindows) with
| true -> (!! "./tests/**/*NBench.Tests*.csproj"
-- "./tests/**/*NBench.PerformanceCounters.Tests.*.csproj"
-- "./tests/**/*NBench.Tests.Performance.csproj"
-- "./tests/**/*NBench.Tests.Performance.WithDependencies.csproj"
-- "./tests/**/*NBench.Tests.Assembly.csproj")
| _ -> (!! "./tests/**/*NBench.Tests*.csproj"
-- "./tests/**/*NBench.Tests.Reporting.csproj"
-- "./tests/**/*NBench.PerformanceCounters.Tests.*.csproj"
-- "./tests/**/*NBench.Tests.Performance.csproj"
-- "./tests/**/*NBench.Tests.Performance.WithDependencies.csproj"
-- "./tests/**/*NBench.Tests.Assembly.csproj")

projects |> Seq.iter (log)
projects |> Seq.iter (runSingleProject)
)

Target "NBench" <| fun _ ->
if (isWindows) then
// .NET 4.5.2
let nbenchRunner = findToolInSubPath "NBench.Runner.exe" "src/NBench.Runner/bin/Release/net452/win7-x64"
let assembly = __SOURCE_DIRECTORY__ @@ "/tests/NBench.Tests.Performance/bin/Release/net452/NBench.Tests.Performance.dll"
let assembly = __SOURCE_DIRECTORY__ @@ "/tests/NBench.Tests.Performance.WithDependencies/bin/Release/net452/NBench.Tests.Performance.WithDependencies.dll"

let spec = getBuildParam "spec"

Expand Down Expand Up @@ -174,10 +159,10 @@ Target "NBench" <| fun _ ->
Project = netCoreNbenchRunnerProject
Configuration = configuration
Runtime = "win7-x64"
Framework = "netcoreapp1.0"})
Framework = "netcoreapp1.1"})

let netCoreNbenchRunner = findToolInSubPath "dotnet-nbench.exe" "/src/NBench.Runner.DotNetCli/bin/Release/netcoreapp1.0/win7-x64/"
let netCoreAssembly = __SOURCE_DIRECTORY__ @@ "/tests/NBench.Tests.Performance/bin/Release/netcoreapp1.0/NBench.Tests.Performance.dll"
let netCoreNbenchRunner = findToolInSubPath "dotnet-nbench.exe" "/src/NBench.Runner.DotNetCli/bin/Release/netcoreapp1.1/win7-x64/"
let netCoreAssembly = __SOURCE_DIRECTORY__ @@ "/tests/NBench.Tests.Performance.WithDependencies/bin/Release/netstandard1.6/NBench.Tests.Performance.WithDependencies.dll"

let netCoreNbenchRunnerArgs = new StringBuilder()
|> append netCoreAssembly
Expand Down Expand Up @@ -206,10 +191,10 @@ Target "NBench" <| fun _ ->
Project = netCoreNbenchRunnerProject
Configuration = configuration
Runtime = "debian.8-x64"
Framework = "netcoreapp1.0"})
Framework = "netcoreapp1.1"})

let linuxNbenchRunner = __SOURCE_DIRECTORY__ @@ "/src/NBench.Runner.DotNetCli/bin/Release/netcoreapp1.0/debian.8-x64/dotnet-nbench"
let linuxPerfAssembly = __SOURCE_DIRECTORY__ @@ "/tests/NBench.Tests.Performance/bin/Release/netcoreapp1.0/NBench.Tests.Performance.dll"
let linuxNbenchRunner = __SOURCE_DIRECTORY__ @@ "/src/NBench.Runner.DotNetCli/bin/Release/netcoreapp1.1/debian.8-x64/dotnet-nbench"
let linuxPerfAssembly = __SOURCE_DIRECTORY__ @@ "/tests/NBench.Tests.Performance.WithDependencies/bin/Release/netstandard1.6/NBench.Tests.Performance.WithDependencies.dll"

let linuxNbenchRunnerArgs = new StringBuilder()
|> append linuxPerfAssembly
Expand All @@ -220,7 +205,7 @@ Target "NBench" <| fun _ ->

let result = ExecProcess(fun info ->
info.FileName <- linuxNbenchRunner
info.WorkingDirectory <- __SOURCE_DIRECTORY__ @@ "/src/NBench.Runner.DotNetCli/bin/Release/netcoreapp1.0/debian.8-x64/"
info.WorkingDirectory <- __SOURCE_DIRECTORY__ @@ "/src/NBench.Runner.DotNetCli/bin/Release/netcoreapp1.1/debian.8-x64/"
info.Arguments <- linuxNbenchRunnerArgs) (System.TimeSpan.FromMinutes 15.0) (* Reasonably long-running task. *)
if result <> 0 then failwithf "NBench.Runner failed. %s %s" linuxNbenchRunner linuxNbenchRunnerArgs

Expand All @@ -245,7 +230,7 @@ Target "CopyOutput" (fun _ ->
projects |> List.iter (fun p -> publishSingleProjectNet45 p)

let netCoreProjects = [ ("NBench", "./src/NBench/NBench.csproj", "netstandard1.6");
("NBench.Runner.DotNetCli", "./src/NBench.Runner.DotNetCli/NBench.Runner.DotNetCli.csproj", "netcoreapp1.0") ]
("NBench.Runner.DotNetCli", "./src/NBench.Runner.DotNetCli/NBench.Runner.DotNetCli.csproj", "netcoreapp1.1") ]

let publishSingleProjectNetCoreApp project =
let projectName, projectPath, projectFramework = project
Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Param(
$FakeVersion = "4.50.0"
$NBenchVersion = "0.3.4"
$DotNetChannel = "preview";
$DotNetVersion = "1.0.0";
$DotNetVersion = "1.0.3";
$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.ps1";
$NugetVersion = "3.5.0";
$NugetUrl = "https://dist.nuget.org/win-x86-commandline/v$NugetVersion/nuget.exe"
Expand Down
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then
mkdir "$SCRIPT_DIR/.dotnet"
fi
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.sh
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version 1.0.0 --install-dir .dotnet --no-path
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version 1.0.3 --install-dir .dotnet --no-path
export PATH="$SCRIPT_DIR/.dotnet":$PATH
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
Expand Down Expand Up @@ -84,6 +84,11 @@ if [ ! -f "$FAKE_EXE" ]; then
exit 1
fi

###########################################################################
# WORKAROUND FOR MONO
###########################################################################
export FrameworkPathOverride=/usr/lib/mono/4.5/

###########################################################################
# RUN BUILD SCRIPT
###########################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>Cross-platform performance benchmarking and testing framework for .NET applications.</Description>
<Copyright>Copyright (c) Petabridge https://petabridge.com/</Copyright>
<AssemblyTitle>NBench</AssemblyTitle>
<VersionPrefix>1.0.1</VersionPrefix>
<VersionPrefix>1.0.2</VersionPrefix>
<Authors>Petabridge</Authors>
<TargetFramework>net452</TargetFramework>
<AssemblyName>NBench.PerformanceCounters</AssemblyName>
Expand Down
4 changes: 2 additions & 2 deletions src/NBench.Runner.DotNetCli/NBench.Runner.DotNetCli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<Copyright>Copyright (c) Petabridge https://petabridge.com/</Copyright>
<AssemblyTitle>NBench</AssemblyTitle>
<AssemblyName>dotnet-nbench</AssemblyName>
<VersionPrefix>1.0.1</VersionPrefix>
<VersionPrefix>1.0.2</VersionPrefix>
<Authors>Petabridge</Authors>
<TargetFrameworks>netcoreapp1.0</TargetFrameworks>
<TargetFrameworks>netcoreapp1.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<RuntimeIdentifiers>win7-x64;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64</RuntimeIdentifiers>
<PackageType>DotnetCliTool</PackageType>
Expand Down
2 changes: 1 addition & 1 deletion src/NBench.Runner/NBench.Runner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Copyright>Copyright (c) Petabridge https://petabridge.com/</Copyright>
<AssemblyTitle>NBench</AssemblyTitle>
<AssemblyName>NBench.Runner</AssemblyName>
<VersionPrefix>1.0.1</VersionPrefix>
<VersionPrefix>1.0.2</VersionPrefix>
<Authors>Petabridge</Authors>
<TargetFramework>net452</TargetFramework>
<OutputType>Exe</OutputType>
Expand Down
2 changes: 1 addition & 1 deletion src/NBench/NBench.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>Cross-platform performance benchmarking and testing framework for .NET applications.</Description>
<Copyright>Copyright (c) Petabridge https://petabridge.com/</Copyright>
<AssemblyTitle>NBench</AssemblyTitle>
<VersionPrefix>1.0.1</VersionPrefix>
<VersionPrefix>1.0.2</VersionPrefix>
<Authors>Petabridge</Authors>
<TargetFrameworks>net452;netstandard1.6</TargetFrameworks>
<AssemblyName>NBench</AssemblyName>
Expand Down
2 changes: 2 additions & 0 deletions src/NBench/Properties/Friends.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
[assembly: InternalsVisibleTo("NBench.Tests")]
[assembly: InternalsVisibleTo("NBench.Tests.End2End")]
[assembly: InternalsVisibleTo("NBench.Microbenchmarks")]
[assembly: InternalsVisibleTo("NBench.Tests.Reporting")]


Loading

0 comments on commit e787e60

Please sign in to comment.