|
|
|
@ -5,6 +5,7 @@ Properties { |
|
|
|
|
|
|
|
# see appveyor.yml for usage |
|
|
|
$BuildNumber = $null |
|
|
|
$IsAppVeyor = $null |
|
|
|
|
|
|
|
# Input and output paths |
|
|
|
$BUILD_PATH = Resolve-Path "." |
|
|
|
@ -23,7 +24,7 @@ Properties { |
|
|
|
$NUGET_EXE = Join-Path $SRC_PATH ".nuget\NuGet.exe" |
|
|
|
$NUNIT_EXE = Join-Path $SRC_PATH "packages\NUnit.Runners.2.6.3\tools\nunit-console.exe" |
|
|
|
$COVERALLS_EXE = Join-Path $SRC_PATH "packages\coveralls.io.1.3.2\tools\coveralls.net.exe" |
|
|
|
$OPENCOVER_EXE = Join-Path $SRC_PATH "packages\OpenCover.4.5.3207\OpenCover.Console.exe" |
|
|
|
$OPENCOVER_EXE = Join-Path $SRC_PATH "packages\OpenCover.4.5.3809-rc94\OpenCover.Console.exe" |
|
|
|
$REPORTGEN_EXE = Join-Path $SRC_PATH "packages\ReportGenerator.1.9.1.0\ReportGenerator.exe" |
|
|
|
$NUNITREPORT_EXE = Join-Path $BUILD_PATH "tools\NUnitHTMLReportGenerator.exe" |
|
|
|
|
|
|
|
@ -152,15 +153,22 @@ task Run-Coverage -depends Build-Tests { |
|
|
|
$TestDdlPath = Join-Path $TestDllFolder "$_.dll" |
|
|
|
$CoverageOutputPath = Join-Path $TEST_RESULTS "$($_)_Coverage.xml" |
|
|
|
|
|
|
|
$appVeyor = "" |
|
|
|
if ($IsAppVeyor) { |
|
|
|
$appVeyor = " -appveyor" |
|
|
|
} |
|
|
|
|
|
|
|
Write-Host "Running code coverage on project $_" |
|
|
|
$coverageFilter = "-filter:+[*]* -[FluentAssertions*]* -[ImageProcessor]*Common.Exceptions -[ImageProcessor.UnitTests]* -[ImageProcessor.Web.UnitTests]*" |
|
|
|
& $OPENCOVER_EXE -register:user -target:$NUNIT_EXE -targetargs:"$TestDdlPath /noshadow /nologo" -targetdir:$TestDllFolder -output:$CoverageOutputPath $coverageFilter |
|
|
|
& $OPENCOVER_EXE -threshold:1 -oldstyle -register:user -target:$NUNIT_EXE -targetargs:"$TestDdlPath /noshadow /nologo" $appVeyor -targetdir:$TestDllFolder -output:$CoverageOutputPath $coverageFilter |
|
|
|
|
|
|
|
Write-Host "Transforming coverage results file to HTML" |
|
|
|
& $REPORTGEN_EXE -reports:$CoverageOutputPath -targetdir:(Join-Path $TEST_RESULTS "Coverage\$_") |
|
|
|
& $REPORTGEN_EXE -verbosity:Info -reports:$CoverageOutputPath -targetdir:(Join-Path $TEST_RESULTS "Coverage\$_") |
|
|
|
|
|
|
|
Write-Host "Uploading coverage report to Coveralls.io" |
|
|
|
Exec { . $COVERALLS_EXE --opencover $CoverageOutputPath } |
|
|
|
if ($env:COVERALLS_REPO_TOKEN -ne $null) { |
|
|
|
Write-Host "Uploading coverage report to Coveralls.io" |
|
|
|
Exec { . $COVERALLS_EXE --opencover $CoverageOutputPath } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|