Created
August 9, 2011 06:30
-
-
Save toddb/1133509 to your computer and use it in GitHub Desktop.
Test tasks for Gallio in powershell with psake - helps with unit, integration and system tests
This file contains hidden or 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
<# | |
Usage for Gallio tests: | |
Task Test-System -Description "Runs the system tests via Gallio" { | |
Test-Gallio $proj $configuration $platform $dll "system" "Test.System" | |
# Test-Gallio ".\src\Test.Unit\Test.Unit.csproj" Release x64 ".\src\Test.Unit\bin\Release\x64\Test.Unit.dll" "unit" | |
} | |
} | |
#> | |
function Test-Gallio($proj, $configuration, $platform, $dll, $report_name, $namespace_filter){ | |
Add-PSSnapIn Gallio | |
exec { msbuild $proj "/p:Configuration=$configuration" "/p:Platform=$platform" } | |
$result = Run-Gallio $dll -filter Namespace:/$namespace_filter/ -ReportTypes text,html -ReportNameFormat $report_name-test-report | |
$report_dir = resolve-path . | |
get-content "$report_dir\Reports\$report_name-test-report.txt" | Write-Host | |
Write-Host $result.ResultsSummary | |
if ($result.Statistics.FailedCount -gt 0) { | |
Write-Warning "Some unit tests have failed." | |
$Error = $result.ResultsSummary | |
exit $result.ResultCode | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment