This repository has been archived by the owner on Nov 29, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add psake build script that builds and runs tests.
- Loading branch information
Showing
13 changed files
with
916 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -15,4 +15,4 @@ _ReSharper.* | |
|
||
# ignore NUnit output | ||
tests/Logos.Utility.VisualState.xml | ||
tests/TestResult.xml | ||
TestResult.xml |
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,9 @@ | ||
Task Default -depends Tests | ||
|
||
Task Build { | ||
Exec { msbuild /m:4 /property:Configuration=Release Logos.Utility.sln } | ||
} | ||
|
||
Task Tests -depends Build { | ||
Exec { tools\NUnit\nunit-console.exe /nologo /framework=4.0 tests\Logos.Utility.nunit } | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,37 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<!-- | ||
The .NET 2.0 build of nunit-agent only | ||
runs under .NET 2.0 or higher. The setting | ||
useLegacyV2RuntimeActivationPolicy only applies | ||
under .NET 4.0 and permits use of mixed mode | ||
assemblies, which would otherwise not load | ||
correctly. | ||
--> | ||
<startup useLegacyV2RuntimeActivationPolicy="true"> | ||
<!-- | ||
Nunit-agent is normally run by the console or gui | ||
runners and not independently. In normal usage, | ||
the runner specifies which runtime should be used. | ||
Do NOT add any supportedRuntime elements here, | ||
since they may prevent the runner from controlling | ||
the runtime that is used! | ||
--> | ||
</startup> | ||
|
||
<runtime> | ||
<!-- Ensure that test exceptions don't crash NUnit --> | ||
<legacyUnhandledExceptionPolicy enabled="1" /> | ||
|
||
<!-- Run partial trust V2 assemblies in full trust under .NET 4.0 --> | ||
<loadFromRemoteSources enabled="true" /> | ||
|
||
<!-- Look for addins in the addins directory for now --> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<probing privatePath="lib;addins"/> | ||
</assemblyBinding> | ||
|
||
</runtime> | ||
|
||
</configuration> |
Binary file not shown.
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,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<!-- | ||
The .NET 2.0 build of the console runner only | ||
runs under .NET 2.0 or higher. The setting | ||
useLegacyV2RuntimeActivationPolicy only applies | ||
under .NET 4.0 and permits use of mixed mode | ||
assemblies, which would otherwise not load | ||
correctly. | ||
--> | ||
<startup useLegacyV2RuntimeActivationPolicy="true"> | ||
<!-- Comment out the next line to force use of .NET 4.0 --> | ||
</startup> | ||
<runtime> | ||
<!-- Ensure that test exceptions don't crash NUnit --> | ||
<legacyUnhandledExceptionPolicy enabled="1"/> | ||
<!-- Run partial trust V2 assemblies in full trust under .NET 4.0 --> | ||
<loadFromRemoteSources enabled="true"/> | ||
<!-- Look for addins in the addins directory for now --> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<probing privatePath="lib;addins"/> | ||
</assemblyBinding> | ||
</runtime> | ||
</configuration> |
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,11 @@ | ||
@echo off | ||
|
||
if '%1'=='/?' goto help | ||
if '%1'=='-help' goto help | ||
if '%1'=='-h' goto help | ||
|
||
powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\psake.ps1' %*; if ($psake.build_success -eq $false) { exit 1 } else { exit 0 }" | ||
exit /B %errorlevel% | ||
|
||
:help | ||
powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\psake.ps1' -help" |
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,51 @@ | ||
# Helper script for those who want to run psake without importing the module. | ||
# Example: | ||
# .\psake.ps1 "default.ps1" "BuildHelloWord" "4.0" | ||
|
||
# Must match parameter definitions for psake.psm1/invoke-psake | ||
# otherwise named parameter binding fails | ||
param( | ||
[Parameter(Position=0,Mandatory=0)] | ||
[string]$buildFile = 'default.ps1', | ||
[Parameter(Position=1,Mandatory=0)] | ||
[string[]]$taskList = @(), | ||
[Parameter(Position=2,Mandatory=0)] | ||
[string]$framework, | ||
[Parameter(Position=3,Mandatory=0)] | ||
[switch]$docs = $false, | ||
[Parameter(Position=4,Mandatory=0)] | ||
[System.Collections.Hashtable]$parameters = @{}, | ||
[Parameter(Position=5, Mandatory=0)] | ||
[System.Collections.Hashtable]$properties = @{}, | ||
[Parameter(Position=6, Mandatory=0)] | ||
[alias("init")] | ||
[scriptblock]$initialization = {}, | ||
[Parameter(Position=7, Mandatory=0)] | ||
[switch]$nologo = $false, | ||
[Parameter(Position=8, Mandatory=0)] | ||
[switch]$help = $false, | ||
[Parameter(Position=9, Mandatory=0)] | ||
[string]$scriptPath = $(Split-Path -parent $MyInvocation.MyCommand.path) | ||
) | ||
|
||
$currentThread = [System.Threading.Thread]::CurrentThread | ||
$invariantCulture = [System.Globalization.CultureInfo]::InvariantCulture | ||
$currentThread.CurrentCulture = $invariantCulture | ||
$currentThread.CurrentUICulture = $invariantCulture | ||
|
||
# '[p]sake' is the same as 'psake' but $Error is not polluted | ||
remove-module [p]sake | ||
import-module (join-path $scriptPath psake.psm1) | ||
if ($help) { | ||
Get-Help Invoke-psake -full | ||
return | ||
} | ||
|
||
if (-not(test-path $buildFile)) { | ||
$absoluteBuildFile = (join-path $scriptPath $buildFile) | ||
if (test-path $absoluteBuildFile) { | ||
$buildFile = $absoluteBuildFile | ||
} | ||
} | ||
|
||
invoke-psake $buildFile $taskList $framework $docs $parameters $properties $initialization $nologo |
Oops, something went wrong.