Browse Source

Update opencover plus config changes

Former-commit-id: 5118df8f7f235c170ccc4aae184c245ba6d40194
Former-commit-id: 5c21a386f9d306a7d45ed61acac6584f42f312bb
Former-commit-id: abb45e613b0e27656095a8ed0133d05aeb6115fc
af/merge-core
James South 11 years ago
parent
commit
7ba3f54679
  1. 3
      appveyor.yml
  2. 18
      build/build.ps1
  3. 4
      build/coverage.bat
  4. 2
      src/.nuget/packages.config

3
appveyor.yml

@ -24,7 +24,7 @@ matrix:
environment:
COVERALLS_REPO_TOKEN:
secure: UQiSUNs39uWy45YG1iS9hatwF5ouX0Q2c
secure: 1hvfHFO3qtGTcwB+AnCGYsn0az0j9MzAux5hee5CFeyRJ+lWut0LjnyqvsI/5Pfa
#---------------------------------#
# build configuration #
@ -35,7 +35,6 @@ before_build:
- ps: Import-Module .\build\psake.psm1
build_script:
- ps: Invoke-Psake .\build\build.ps1 -properties @{"BuildNumber"=$env:APPVEYOR_BUILD_NUMBER}
#---------------------------------#
# tests configuration #

18
build/build.ps1

@ -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 }
}
}
}

4
build/coverage.bat

@ -1,3 +1,5 @@
@echo off
powershell "Import-Module %~dp0\psake.psm1 ; Invoke-Psake %~dp0\build.ps1 Run-Coverage ; exit $LASTEXITCODE"
powershell "Import-Module %~dp0\psake.psm1 ; Invoke-Psake %~dp0\build.ps1 Run-Coverage ; exit $LASTEXITCODE"
pause

2
src/.nuget/packages.config

@ -2,6 +2,6 @@
<packages>
<package id="coveralls.io" version="1.3.2" />
<package id="NUnit.Runners" version="2.6.3" />
<package id="OpenCover" version="4.5.3207" />
<package id="OpenCover" version="4.5.3809-rc94" />
<package id="ReportGenerator" version="1.9.1.0" />
</packages>
Loading…
Cancel
Save