Skip to content

Commit e787e60

Browse files
Merge pull request #198 from petabridge/dev
NBench v1.0.2 production release
2 parents edb2b5a + e13be8d commit e787e60

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+125222
-95
lines changed

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,9 @@
6161
#*.PDF diff=astextplain
6262
#*.rtf diff=astextplain
6363
#*.RTF diff=astextplain
64+
65+
###############################################################################
66+
# behavior for bash scripts
67+
# bash scripts must keep Unix line endings
68+
###############################################################################
69+
*.sh text eol=lf

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,4 @@ build/
204204
.nuget/
205205
.dotnet/
206206
.idea/.idea.NBench.NetCore/.idea/*
207+
launchSettings.json
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net46</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
9+
<PackageReference Include="xunit" Version="2.3.0-beta2-build3683" />
10+
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta2-build1317" />
11+
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta2-build3683" />
12+
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="15.0.0" />
13+
</ItemGroup>
14+
15+
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
16+
<Reference Include="System" />
17+
<Reference Include="Microsoft.CSharp" />
18+
<PackageReference Include="ApprovalTests" Version="3.0.13" />
19+
</ItemGroup>
20+
21+
<ItemGroup>
22+
<ProjectReference Include="..\src\NBench\NBench.csproj" />
23+
</ItemGroup>
24+
25+
<ItemGroup>
26+
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
27+
</ItemGroup>
28+
29+
</Project>

tests/NBench.Tests.End2End/Reporting/MarkdownBenchmarkOutputSpec.cs renamed to NBench.Tests.Reporting/Reporting/MarkdownBenchmarkOutputSpec.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public class MarkdownBenchmarkOutputSpec
3535
".." + Path.DirectorySeparatorChar
3636
+ ".." + Path.DirectorySeparatorChar
3737
+ ".." + Path.DirectorySeparatorChar
38-
+ ".." + Path.DirectorySeparatorChar
3938
+ ".." + Path.DirectorySeparatorChar;
4039
private static readonly string _perfResultsPath =
4140
Path.GetFullPath(_solutionPath + "PerfResults");

NBench.sln

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26228.4
4+
VisualStudioVersion = 15.0.26430.6
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", "{C8104500-2C0F-46A2-AE84-A3D74CC55697}"
77
EndProject
@@ -39,6 +39,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBench.PerformanceCounters.
3939
EndProject
4040
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NBench.Runner.DotNetCli", "src\NBench.Runner.DotNetCli\NBench.Runner.DotNetCli.csproj", "{552BA093-1A4A-455D-8186-B8018C9972D5}"
4141
EndProject
42+
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}"
43+
EndProject
44+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NBench.Tests.Reporting", "NBench.Tests.Reporting\NBench.Tests.Reporting.csproj", "{7D45CF9B-F2AC-4879-B325-4486F58A3435}"
45+
EndProject
4246
Global
4347
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4448
Debug|Any CPU = Debug|Any CPU
@@ -181,6 +185,30 @@ Global
181185
{552BA093-1A4A-455D-8186-B8018C9972D5}.Release|x64.Build.0 = Release|Any CPU
182186
{552BA093-1A4A-455D-8186-B8018C9972D5}.Release|x86.ActiveCfg = Release|Any CPU
183187
{552BA093-1A4A-455D-8186-B8018C9972D5}.Release|x86.Build.0 = Release|Any CPU
188+
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
189+
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Debug|Any CPU.Build.0 = Debug|Any CPU
190+
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Debug|x64.ActiveCfg = Debug|Any CPU
191+
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Debug|x64.Build.0 = Debug|Any CPU
192+
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Debug|x86.ActiveCfg = Debug|Any CPU
193+
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Debug|x86.Build.0 = Debug|Any CPU
194+
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Release|Any CPU.ActiveCfg = Release|Any CPU
195+
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Release|Any CPU.Build.0 = Release|Any CPU
196+
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Release|x64.ActiveCfg = Release|Any CPU
197+
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Release|x64.Build.0 = Release|Any CPU
198+
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Release|x86.ActiveCfg = Release|Any CPU
199+
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D}.Release|x86.Build.0 = Release|Any CPU
200+
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
201+
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Debug|Any CPU.Build.0 = Debug|Any CPU
202+
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Debug|x64.ActiveCfg = Debug|Any CPU
203+
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Debug|x64.Build.0 = Debug|Any CPU
204+
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Debug|x86.ActiveCfg = Debug|Any CPU
205+
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Debug|x86.Build.0 = Debug|Any CPU
206+
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Release|Any CPU.ActiveCfg = Release|Any CPU
207+
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Release|Any CPU.Build.0 = Release|Any CPU
208+
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Release|x64.ActiveCfg = Release|Any CPU
209+
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Release|x64.Build.0 = Release|Any CPU
210+
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Release|x86.ActiveCfg = Release|Any CPU
211+
{7D45CF9B-F2AC-4879-B325-4486F58A3435}.Release|x86.Build.0 = Release|Any CPU
184212
EndGlobalSection
185213
GlobalSection(SolutionProperties) = preSolution
186214
HideSolutionNode = FALSE
@@ -194,5 +222,7 @@ Global
194222
{96FCB3AB-8C76-4BD0-B97F-1239E5FF5C5C} = {1F1914B9-8F67-4B51-9738-CDE5AFB2F8DE}
195223
{FD7BE8F5-460F-4A3D-A479-E4AF36C4EED5} = {1F1914B9-8F67-4B51-9738-CDE5AFB2F8DE}
196224
{416A4BAD-459C-4896-A44C-4C2344EBE154} = {1F1914B9-8F67-4B51-9738-CDE5AFB2F8DE}
225+
{C526F6D9-B1A5-486F-8CC1-43104CBDD38D} = {1F1914B9-8F67-4B51-9738-CDE5AFB2F8DE}
226+
{7D45CF9B-F2AC-4879-B325-4486F58A3435} = {1F1914B9-8F67-4B51-9738-CDE5AFB2F8DE}
197227
EndGlobalSection
198228
EndGlobal

RELEASE_NOTES.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
#### v1.0.1 March March 29 2017
1+
#### v1.0.2 May 31 2017
2+
3+
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.
4+
5+
Other changes include:
6+
7+
- Integration tests to validate that the above issue is resolved
8+
- Upgrade to xUnit .NET Core CLI runner (v2.3.0-beta2-build3683) for all NBench unit tests
9+
- Update .NET Core runtime targets to `netcoreapp1.1`
10+
11+
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:
12+
13+
```
14+
<ItemGroup>
15+
<DotNetCliToolReference Include="NBench.Runner.DotNetCli" Version="1.0.2" />
16+
</ItemGroup>
17+
```
18+
19+
#### v1.0.1 March 29 2017
220

321
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.
422

build.fsx

Lines changed: 53 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -72,78 +72,63 @@ Target "RestorePackages" (fun _ ->
7272
)
7373

7474
Target "Build" (fun _ ->
75-
if (isWindows) then
76-
let runSingleProject project =
77-
DotNetCli.Build
78-
(fun p ->
79-
{ p with
80-
Project = project
81-
Configuration = configuration })
82-
83-
let projects = !! "./src/**/*.csproj" ++ "./tests/**/*.csproj"
84-
85-
projects |> Seq.iter (runSingleProject)
86-
else
75+
let runSingleProject project =
8776
DotNetCli.Build
88-
(fun p ->
89-
{ p with
90-
Project = "./src/NBench/NBench.csproj"
91-
Framework = "netstandard1.6"
92-
Configuration = configuration })
93-
94-
let runSingleProjectNetCore project =
95-
DotNetCli.Build
96-
(fun p ->
97-
{ p with
98-
Project = project
99-
Framework = "netcoreapp1.0"
100-
Configuration = configuration })
101-
102-
let netCoreProjects = (!! "./src/**/*NBench.Runner.DotNetCli.csproj"
103-
++ "./tests/**/*NBench.Tests*.csproj"
104-
-- "./tests/**/*NBench.PerformanceCounters.Tests.*.csproj")
77+
(fun p ->
78+
{ p with
79+
Project = project
80+
Configuration = configuration
81+
AdditionalArgs = ["--no-incremental"]}) // "Rebuild"
10582

106-
netCoreProjects |> Seq.iter (runSingleProjectNetCore)
83+
let projects = !! "./src/**/*.csproj" ++ "./tests/**/*.csproj"
84+
85+
projects |> Seq.iter (runSingleProject)
10786
)
10887

10988
Target "RunTests" (fun _ ->
110-
if (isWindows) then
111-
let runSingleProject project =
112-
DotNetCli.Test
113-
(fun p ->
114-
{ p with
115-
Project = project
116-
Configuration = configuration})
117-
118-
let projects = (!! "./tests/**/*NBench.Tests*.csproj"
119-
-- "./tests/**/*NBench.Tests.Assembly.csproj")
120-
121-
projects |> Seq.iter (log)
122-
projects |> Seq.iter (runSingleProject)
123-
124-
else
125-
let runSingleProjectNetCore project =
126-
DotNetCli.Test
127-
(fun p ->
128-
{ p with
129-
Project = project
130-
Framework = "netcoreapp1.0"
131-
Configuration = configuration})
132-
133-
let projects = (!! "./tests/**/*NBench.Tests*.csproj"
134-
-- "./tests/**/*NBench.PerformanceCounters.Tests.*.csproj"
135-
-- "./tests/**/*NBench.Tests.Performance.csproj"
136-
-- "./tests/**/*NBench.Tests.Assembly.csproj")
89+
let sampleBenchmarProjects = !! "./tests/**/NBench.Tests.Performance.csproj"
90+
++ "./tests/**/NBench.Tests.Performance.WithDependencies.csproj"
91+
++ "./tests/**/NBench.Tests.Assembly.csproj"
92+
93+
sampleBenchmarProjects |> Seq.iter (fun proj ->
94+
DotNetCli.Build
95+
(fun p ->
96+
{ p with
97+
Project = proj
98+
Configuration = configuration
99+
AdditionalArgs = ["--no-incremental"]}))
137100

138-
projects |> Seq.iter (log)
139-
projects |> Seq.iter (runSingleProjectNetCore)
101+
let runSingleProject project =
102+
DotNetCli.RunCommand
103+
(fun p ->
104+
{ p with
105+
WorkingDir = (Directory.GetParent project).FullName
106+
TimeOut = TimeSpan.FromMinutes 10. })
107+
(sprintf "xunit -parallel none -teamcity -xml %s_xunit.xml" (outputTests @@ fileNameWithoutExt project))
108+
109+
let projects =
110+
match (isWindows) with
111+
| true -> (!! "./tests/**/*NBench.Tests*.csproj"
112+
-- "./tests/**/*NBench.PerformanceCounters.Tests.*.csproj"
113+
-- "./tests/**/*NBench.Tests.Performance.csproj"
114+
-- "./tests/**/*NBench.Tests.Performance.WithDependencies.csproj"
115+
-- "./tests/**/*NBench.Tests.Assembly.csproj")
116+
| _ -> (!! "./tests/**/*NBench.Tests*.csproj"
117+
-- "./tests/**/*NBench.Tests.Reporting.csproj"
118+
-- "./tests/**/*NBench.PerformanceCounters.Tests.*.csproj"
119+
-- "./tests/**/*NBench.Tests.Performance.csproj"
120+
-- "./tests/**/*NBench.Tests.Performance.WithDependencies.csproj"
121+
-- "./tests/**/*NBench.Tests.Assembly.csproj")
122+
123+
projects |> Seq.iter (log)
124+
projects |> Seq.iter (runSingleProject)
140125
)
141126

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

148133
let spec = getBuildParam "spec"
149134

@@ -174,10 +159,10 @@ Target "NBench" <| fun _ ->
174159
Project = netCoreNbenchRunnerProject
175160
Configuration = configuration
176161
Runtime = "win7-x64"
177-
Framework = "netcoreapp1.0"})
162+
Framework = "netcoreapp1.1"})
178163

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

182167
let netCoreNbenchRunnerArgs = new StringBuilder()
183168
|> append netCoreAssembly
@@ -206,10 +191,10 @@ Target "NBench" <| fun _ ->
206191
Project = netCoreNbenchRunnerProject
207192
Configuration = configuration
208193
Runtime = "debian.8-x64"
209-
Framework = "netcoreapp1.0"})
194+
Framework = "netcoreapp1.1"})
210195

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

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

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

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

247232
let netCoreProjects = [ ("NBench", "./src/NBench/NBench.csproj", "netstandard1.6");
248-
("NBench.Runner.DotNetCli", "./src/NBench.Runner.DotNetCli/NBench.Runner.DotNetCli.csproj", "netcoreapp1.0") ]
233+
("NBench.Runner.DotNetCli", "./src/NBench.Runner.DotNetCli/NBench.Runner.DotNetCli.csproj", "netcoreapp1.1") ]
249234

250235
let publishSingleProjectNetCoreApp project =
251236
let projectName, projectPath, projectFramework = project

build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Param(
3232
$FakeVersion = "4.50.0"
3333
$NBenchVersion = "0.3.4"
3434
$DotNetChannel = "preview";
35-
$DotNetVersion = "1.0.0";
35+
$DotNetVersion = "1.0.3";
3636
$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.ps1";
3737
$NugetVersion = "3.5.0";
3838
$NugetUrl = "https://dist.nuget.org/win-x86-commandline/v$NugetVersion/nuget.exe"

build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then
4545
mkdir "$SCRIPT_DIR/.dotnet"
4646
fi
4747
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.sh
48-
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version 1.0.0 --install-dir .dotnet --no-path
48+
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version 1.0.3 --install-dir .dotnet --no-path
4949
export PATH="$SCRIPT_DIR/.dotnet":$PATH
5050
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
5151
export DOTNET_CLI_TELEMETRY_OPTOUT=1
@@ -84,6 +84,11 @@ if [ ! -f "$FAKE_EXE" ]; then
8484
exit 1
8585
fi
8686

87+
###########################################################################
88+
# WORKAROUND FOR MONO
89+
###########################################################################
90+
export FrameworkPathOverride=/usr/lib/mono/4.5/
91+
8792
###########################################################################
8893
# RUN BUILD SCRIPT
8994
###########################################################################

0 commit comments

Comments
 (0)