From c2474ffd92d85a81bfbf686a1364e0b3d63a2049 Mon Sep 17 00:00:00 2001 From: FrancisANDRE Date: Wed, 16 Dec 2015 21:09:27 +0100 Subject: [PATCH] Exit with # failures. Signed-off-by: FrancisANDRE --- appveyor.yml | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index aab916e61..bc698d9f2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -124,6 +124,11 @@ test_script: # - if %configuration%==release (build\script\runtests2.cmd !suffix!) - ps: | + $runs=0 + $failures=0 + $failedTests='' + $status=0 + $env:POCO_BASE = $env:CD $components = @('Foundation', 'XML', 'JSON', 'Util', 'Net', 'Crypto', 'NetSSL_OpenSSL', 'Data', 'MongoDB', 'Redis', 'Zip', 'PageCompiler', 'PageCompiler/File2Page', 'CppParser') if ($env:configuration -eq "release") @@ -134,12 +139,16 @@ test_script: foreach ($component in $components) { [string]$path = $component + "\testsuite\bin\TestSuite.exe"; if (Test-Path -Path $path) { + $runs += 1; Write-Host -ForegroundColor Yellow '-------------------------------------------------------------------------------------'; - Write-Host -ForegroundColor Yellow '|' $env:APPVEYOR_BUILD_VERSION $env:vs$builder $env:Platform $env:linkmode $component; + Write-Host -ForegroundColor Yellow '|' $env:APPVEYOR_BUILD_VERSION $env:vs$builder $env:Platform $env:Configuration $env:linkmode $component; Write-Host -ForegroundColor Yellow '-------------------------------------------------------------------------------------'; $process = Start-Process -PassThru -NoNewWindow -Wait -FilePath "$path" -Args "-all" -RSO "cout" -RSE "cerr"; Get-Content cout; Get-Content cerr; - $process.ExitCode; + if ($process.ExitCode -gt 0) + { + $failures += 1;$failedTests += $component + ', '; + } } } } @@ -149,15 +158,28 @@ test_script: foreach ($component in $components) { [string]$path = $component + "\testsuite\bin64\TestSuite.exe"; if (Test-Path -Path $path) { + $runs += 1; Write-Host -ForegroundColor Yellow '-------------------------------------------------------------------------------------'; - Write-Host -ForegroundColor Yellow '|' $env:APPVEYOR_BUILD_VERSION $env:vs$builder $env:Platform $env:linkmode $component; + Write-Host -ForegroundColor Yellow '|' $env:APPVEYOR_BUILD_VERSION $env:vs$builder $env:Platform $env:Configuration $env:linkmode $component; Write-Host -ForegroundColor Yellow '-------------------------------------------------------------------------------------'; $process = Start-Process -PassThru -NoNewWindow -Wait -FilePath "$path" -Args "-all" -RSO "cout" -RSE "cerr"; Get-Content cout; Get-Content cerr; - $process.ExitCode; + if ($process.ExitCode -gt 0) + { + $failures += 1;$failedTests += $component + ', '; + } } } - } + } + if ($faillures -gt 0) + { + Write-Host 'Failed: ' $failedTests + exit $failures; + } + else + { + exit 0; + } } #