Add OctokitRT unit tests to the build

This commit is contained in:
Haacked
2013-10-04 10:13:57 -07:00
parent f6c156f371
commit 5d15d34c31
2 changed files with 16 additions and 5 deletions

View File

@@ -18,7 +18,7 @@
</Target>
<Target Name="RunRTUnitTests" DependsOnTargets="Build">
<xunit Assembly=".\OctokitRT.Tests\bin\$(Configuration)\OctokitRT.Tests.dll" Xml="OctokitRT.Tests.results.xml" />
<xunit Assembly=".\Octokit.Tests\bin\$(Configuration)\OctokitRT.Tests.dll" Xml="OctokitRT.Tests.results.xml" />
</Target>
<Target Name="RunIntegrationTests" DependsOnTargets="Build; DoNotSkipIntegrationTests; SkipIntegrationTests" />
@@ -31,5 +31,5 @@
<Warning Text ="The integration tests were skipped because the OCTOKIT_GITHUBUSERNAME and OCTOKIT_GITHUBUSERNAME environment variables are not set. Please configure these environment variables for a GitHub test account (DO NOT USE A &quot;REAL&quot; ACCOUNT)." />
</Target>
<Target Name="FullBuild" DependsOnTargets="RunUnitTests; RunIntegrationTests" />
<Target Name="FullBuild" DependsOnTargets="RunUnitTests; RunRTUnitTests; RunIntegrationTests" />
</Project>

View File

@@ -84,14 +84,14 @@ if ($LastExitCode -ne 0) {
Die-WithOutput $exitCode $output
}
function Run-XUnit([string]$project, [int]$timeoutDuration) {
$dll = "$project\bin\Release\$project.dll"
function Run-XUnit([string]$project, [int]$timeoutDuration, [string]$projectFolder = $project) {
$dll = "$projectFolder\bin\Release\$project.dll"
$xunitDirectory = Join-Path $rootDirectory tools\xunit
$consoleRunner = Join-Path $xunitDirectory xunit.console.clr4.x86.exe
$xml = Join-Path $rootDirectory "nunit-$project.xml"
$output=(& $consoleRunner $dll /nunit $xml /silent /noshadow)
$output=(& $consoleRunner $dll /nunit $xml /silent /noshadow)
$result = New-Object System.Object
$result | Add-Member -Type NoteProperty -Name Output -Value $output
@@ -112,6 +112,17 @@ if ($result.ExitCode -eq 0) {
}
Write-Output ""
Write-Output "Running OctokitRT.Tests..."
$result = Run-XUnit OctokitRT.Tests 120 Octokit.Tests
if ($result.ExitCode -eq 0) {
# Print out the test result summary.
Write-Output $result.Output[-1]
} else {
$exitCode = $result.ExitCode
Write-Output $result.Output
}
Write-Output ""
Write-Output "Running Octokit.Tests.Integration..."
$result = Run-XUnit Octokit.Tests.Integration 180
if ($result.ExitCode -eq 0) {