forked from theburningmonk/SimpleSpeedTester
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afa97c8
commit 3db591a
Showing
64 changed files
with
646 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="NUnit.Runners" version="2.6.3" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#### 1.0.0 - Nov 07, 2011 | ||
* Initial release | ||
|
||
#### 1.1.0 - Jan 13, 2014 | ||
* Full GC at the start of each test run |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@echo off | ||
cls | ||
if not exist packages\FAKE\tools\Fake.exe ( | ||
.nuget\nuget.exe install FAKE -OutputDirectory packages -ExcludeVersion | ||
) | ||
packages\FAKE\tools\FAKE.exe build.fsx All | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
// -------------------------------------------------------------------------------------- | ||
// FAKE build script | ||
// -------------------------------------------------------------------------------------- | ||
|
||
#r @"packages/FAKE/tools/FakeLib.dll" | ||
open Fake | ||
open Fake.Git | ||
open Fake.AssemblyInfoFile | ||
open Fake.ReleaseNotesHelper | ||
open System | ||
|
||
let buildDir = "build/" | ||
let testDir = "test/" | ||
let tempDir = "temp/" | ||
|
||
// -------------------------------------------------------------------------------------- | ||
// START TODO: Provide project-specific details below | ||
// -------------------------------------------------------------------------------------- | ||
|
||
// Information about the project are used | ||
// - for version and project name in generated AssemblyInfo file | ||
// - by the generated NuGet package | ||
// - to run tests and to publish documentation on GitHub gh-pages | ||
// - for documentation, you also need to edit info in "docs/tools/generate.fsx" | ||
|
||
// The name of the project | ||
// (used by attributes in AssemblyInfo, name of a NuGet package and directory in 'src') | ||
let project = "SimpleSpeedTester" | ||
|
||
// Short summary of the project | ||
// (used as description in AssemblyInfo and as a short summary for NuGet package) | ||
let summary = "SimpleSpeedTester is a simple, easy to use framework that helps you speed test your .Net code by taking care of some of the orchestration for you." | ||
|
||
// Longer description of the project | ||
// (used as a description for NuGet package; line breaks are automatically cleaned up) | ||
let description = """ """ | ||
// List of author names (for NuGet package) | ||
let authors = [ "Yan Cui" ] | ||
// Tags for your project (for NuGet package) | ||
let tags = "C# csharp testing benchmark performance" | ||
|
||
// File system information | ||
// (<solutionFile>.sln is built during the building process) | ||
let projectFile = "SimpleSpeedTester.csproj" | ||
let testProjectFile = "SimpleSpeedTester.Tests.csproj" | ||
// Pattern specifying assemblies to be tested using NUnit | ||
let testAssemblies = ["tests/*/bin/*/*Tests*.dll"] | ||
|
||
// Git configuration (used for publishing documentation in gh-pages branch) | ||
// The profile where the project is posted | ||
let gitHome = "https://github.com/theburningmonk" | ||
// The name of the project on GitHub | ||
let gitName = "SimpleSpeedTester" | ||
|
||
// -------------------------------------------------------------------------------------- | ||
// END TODO: The rest of the file includes standard build steps | ||
// -------------------------------------------------------------------------------------- | ||
|
||
// Read additional information from the release notes document | ||
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ | ||
let release = parseReleaseNotes (IO.File.ReadAllLines "RELEASE_NOTES.md") | ||
|
||
// Generate assembly info files with the right version & up-to-date information | ||
Target "AssemblyInfo" (fun _ -> | ||
let fileName = "src/" + project + "/Properties/AssemblyInfo.cs" | ||
CreateFSharpAssemblyInfo fileName | ||
[ Attribute.Title project | ||
Attribute.Product project | ||
Attribute.Description summary | ||
Attribute.Version release.AssemblyVersion | ||
Attribute.FileVersion release.AssemblyVersion ] | ||
) | ||
|
||
// -------------------------------------------------------------------------------------- | ||
// Clean build results & restore NuGet packages | ||
|
||
Target "RestorePackages" RestorePackages | ||
|
||
Target "Clean" (fun _ -> | ||
CleanDirs [ buildDir; testDir; tempDir ] | ||
) | ||
|
||
Target "CleanDocs" (fun _ -> | ||
CleanDirs [ "docs/output" ] | ||
) | ||
|
||
// -------------------------------------------------------------------------------------- | ||
// Build library & test project | ||
|
||
let files includes = | ||
{ BaseDirectory = __SOURCE_DIRECTORY__ | ||
Includes = includes | ||
Excludes = [] } | ||
|
||
Target "Build" (fun _ -> | ||
files [ "src/SimpleSpeedTester/" + projectFile ] | ||
|> MSBuildRelease buildDir "Rebuild" | ||
|> ignore | ||
) | ||
|
||
// -------------------------------------------------------------------------------------- | ||
// Build library & test project | ||
|
||
Target "BuildTests" (fun _ -> | ||
files [ "tests/SimpleSpeedTester.Tests/" + testProjectFile ] | ||
|> MSBuildRelease testDir "Rebuild" | ||
|> ignore | ||
) | ||
|
||
// -------------------------------------------------------------------------------------- | ||
// Run the unit tests using test runner & kill test runner when complete | ||
|
||
Target "RunTests" (fun _ -> | ||
ActivateFinalTarget "CloseTestRunner" | ||
|
||
{ BaseDirectory = __SOURCE_DIRECTORY__ | ||
Includes = testAssemblies | ||
Excludes = [] } | ||
|> NUnit (fun p -> | ||
{ p with | ||
DisableShadowCopy = true | ||
TimeOut = TimeSpan.FromMinutes 20. | ||
OutputFile = "TestResults.xml" }) | ||
) | ||
|
||
FinalTarget "CloseTestRunner" (fun _ -> | ||
ProcessHelper.killProcess "nunit-agent.exe" | ||
) | ||
|
||
// -------------------------------------------------------------------------------------- | ||
// Build a NuGet package | ||
|
||
Target "NuGet" (fun _ -> | ||
// Format the description to fit on a single line (remove \r\n and double-spaces) | ||
let description = description.Replace("\r", "") | ||
.Replace("\n", "") | ||
.Replace(" ", " ") | ||
|
||
NuGet (fun p -> | ||
{ p with | ||
Authors = authors | ||
Project = project | ||
Summary = summary | ||
Description = description | ||
Version = release.NugetVersion | ||
ReleaseNotes = String.Join(Environment.NewLine, release.Notes) | ||
Tags = tags | ||
OutputPath = "nuget" | ||
AccessKey = getBuildParamOrDefault "nugetkey" "" | ||
Publish = hasBuildParam "nugetkey" | ||
Dependencies = [] }) | ||
("nuget/" + project + ".nuspec") | ||
) | ||
|
||
// -------------------------------------------------------------------------------------- | ||
// Generate the documentation | ||
|
||
Target "GenerateDocs" (fun _ -> | ||
executeFSIWithArgs "docs/tools" "generate.fsx" ["--define:RELEASE"] [] |> ignore | ||
) | ||
|
||
// -------------------------------------------------------------------------------------- | ||
// Release Scripts | ||
|
||
Target "ReleaseDocs" (fun _ -> | ||
let ghPages = "gh-pages" | ||
let ghPagesLocal = "temp/gh-pages" | ||
Repository.clone "temp" (gitHome + "/" + gitName + ".git") ghPages | ||
Branches.checkoutBranch ghPagesLocal ghPages | ||
fullclean ghPagesLocal | ||
CopyRecursive "docs/output" ghPagesLocal true |> printfn "%A" | ||
CommandHelper.runSimpleGitCommand ghPagesLocal "add ." |> printfn "%s" | ||
let cmd = sprintf """commit -a -m "Update generated documentation for version %s""" release.NugetVersion | ||
CommandHelper.runSimpleGitCommand ghPagesLocal cmd |> printfn "%s" | ||
Branches.push ghPagesLocal | ||
) | ||
|
||
Target "Release" DoNothing | ||
|
||
// -------------------------------------------------------------------------------------- | ||
// Run all targets by default. Invoke 'build <Target>' to override | ||
|
||
Target "All" DoNothing | ||
|
||
"Clean" | ||
==> "RestorePackages" | ||
==> "AssemblyInfo" | ||
==> "Build" | ||
==> "BuildTests" | ||
==> "RunTests" | ||
==> "All" | ||
|
||
"All" | ||
// ==> "CleanDocs" | ||
// ==> "GenerateDocs" | ||
// ==> "ReleaseDocs" | ||
==> "NuGet" | ||
==> "Release" | ||
|
||
RunTargetOrDefault "All" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
if [ ! -f packages/FAKE/tools/Fake.exe ]; then | ||
mono .NuGet/NuGet.exe install FAKE -OutputDirectory packages -ExcludeVersion | ||
fi | ||
mono packages/FAKE/tools/FAKE.exe build.fsx $@ |
Oops, something went wrong.