poco/appveyor.yml
FrancisANDRE 7c92d85566 Align PS snippets
Signed-off-by: FrancisANDRE <zosrothko@orange.fr>
2015-12-19 14:57:40 +01:00

282 lines
7.8 KiB
YAML

version: poco-1.7.0 {branch}-{build}
cache:
- c:\mysql-5.7.9-win32
hosts:
localhost: 127.0.0.1
db.server.com: 127.0.0.2
services:
# - mysql
- mongodb
platform:
- Win32
- x64
configuration:
- release
- debug
environment:
bundling: bundled
logger: 'C:\Progra~1\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll'
samples: samples
tests: tests
verbosity: minimal
matrix:
- builder: msbuild
vsver: 120
linkmode: shared
# - builder: msbuild
# vsver: 120
# linkmode: static_md
# - builder: msbuild
# vsver: 120
# linkmode: static_mt
- builder: msbuild
vsver: 140
linkmode: shared
# - builder: msbuild
# vsver: 140
# linkmode: static_md
# - builder: msbuild
# vsver: 140
# linkmode: static_mt
matrix:
fast_finish: true
install:
- systeminfo
- c:\cygwin\bin\uname -a
- c:\cygwin\bin\cat /proc/cpuinfo
- c:\cygwin\bin\cat /proc/meminfo
- set
# MySQL 32 bit is not available by default on AppVeyor
- ps: |
if ($env:platform -eq "Win32")
{
if (Test-Path "c:\mysql-5.7.9-win32") {
echo "using mysql-5.7.9-win32 from cache"
}
else
{
echo "downloading mysql-5.7.9-win32"
Invoke-WebRequest "http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.9-win32.zip" -OutFile mysql-5.7.9-win32.zip
echo "installing mysql-5.7.9-win32"
7z x -y mysql-5.7.9-win32.zip -oc:\
}
}
before_build:
- ps: |
if ($env:vsver -eq "120")
{
if ($env:platform -eq "Win32")
{
& "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
$env:suffix = ""
}
if ($env:platform -eq "x64")
{
& "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64
$env:suffix = 64
}
}
if ($env:vsver -eq "140")
{
if ($env:platform -eq "Win32")
{
& "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
$env:suffix = ""
}
if ($env:platform -eq "x64")
{
& "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
$env:suffix = 64
}
}
# MySQL
- ps: |
if ($env:platform -eq "Win32")
{
$env:INCLUDE = "C:\mysql-5.7.9-win32\include;" + $env:INCLUDE
$env:LIB = "C:\mysql-5.7.9-win32\lib;" + $env:LIB
}
if ($env:platform -eq "x64")
{
$env:INCLUDE = "C:\Program Files\MySql\MySQL Server 5.6\include;" + $env:INCLUDE
$env:LIB = "C:\Program Files\MySql\MySQL Server 5.6\lib;" + $env:LIB
}
after_build:
- ps: |
$line='-------------------------------------------------------------------------------------';
$find='c:\cygwin\bin\find.exe';
$arg1=". -type f -name '*.cpp' -exec c:\cygwin\bin\grep -n -H ";
$arg2=" {} ;"
Write-Host -ForegroundColor Yellow $line;
$word='FIXME'
Start-Process -NoNewWindow -Wait -FilePath $find -Args "$arg1 $word $arg2" -RSO "cout" -RSE "cerr";
gc cout; gc cerr;
Write-Host;Write-Host;
Write-Host -ForegroundColor Yellow $line;
$word='TODO'
Start-Process -NoNewWindow -Wait -FilePath $find -Args "$arg1 $word $arg2" -RSO "cout" -RSE "cerr";
gc cout; gc cerr;
Write-Host;Write-Host;
Write-Host -ForegroundColor Yellow $line;
$word='HACK'
Start-Process -NoNewWindow -Wait -FilePath $find -Args "$arg1 $word $arg2" -RSO "cout" -RSE "cerr";
gc cout; gc cerr;
Write-Host;Write-Host;
build_script:
- ps: |
if ($env:builder -eq "msbuild")
{
$process = Start-Process -PassThru -NoNewWindow -Wait -FilePath "buildwin.cmd"
-Args "build $env:linkmode $env:configuration $env:platform $env:samples $env:tests msbuild $env:verbosity $env:logger"
-RSO "cout" -RSE "cerr";
gc cout; gc cerr;
}
before_test:
- set PATH=%CD%\bin;%PATH%
- set PATH=%CD%\bin64;%PATH%
- set CPPUNIT_IGNORE="class CppUnit::TestCaller<class NTPClientTest>.testTimeSync"
- set POCO_BASE=%CD%
after_test:
test_script:
- ps: |
$excluded = @('Data', 'Data/MySQL', 'Data/ODBC','Redis', 'PDF')
$runs=0;$fails=0;$failedTests='';$status=0;$tab="`t";
$line='-------------------------------------------------------------------------------------';
$components = gc components;
Write-Host components;
Write-Host -ForegroundColor Yellow $line;
$components;
Write-Host -ForegroundColor Yellow $line;
Write-Host excluded;
Write-Host -ForegroundColor Yellow $line;
$excluded
Write-Host -ForegroundColor Yellow $line;
if ($env:configuration -eq "release")
{
$suffix = '';
if ($env:platform -eq "Win32")
{
$env:PATH = "$env:CD\bin;" + $env:PATH;$suffix = '';
}
if ($env:platform -eq "x64")
{
$env:PATH = "$env:CD\bin64;" + $env:PATH;$suffix = 64;
}
foreach ($component in $components) {
if ($excluded -notcontains $component)
{
if ($env:msbuild -eq "msbuild")
{
[string]$path = $component + "\testsuite\bin$suffix\TestSuite.exe";
if (Test-Path -Path $path) {
$runs += 1;
Add-AppveyorTest -Framework 'CppUnit' -Name $component -Outcome 'Running'
Write-Host -ForegroundColor Yellow $line;
Write-Host -ForegroundColor Yellow '|' $env:APPVEYOR_BUILD_VERSION $env:vs$vsver $env:Platform $env:Configuration $env:linkmode '|' $tab $tab $component;
Write-Host -ForegroundColor Yellow $line;
$started = Get-Date
$process = Start-Process -PassThru -NoNewWindow -Wait -FilePath "$path" -Args "-all" -RSO "cout" -RSE "cerr";
$ended = Get-Date
$millisec = ($ended - $started).totalmilliseconds
gc cout; gc cerr;
if ($process.ExitCode -gt 0)
{
$fails += 1;$failedTests += $component + ', ';
Add-AppveyorTest -Framework 'CppUnit' -Name $component -Outcome 'Failed' -Duration $millisec
}
else
{
Add-AppveyorTest -Framework 'CppUnit' -Name $component -Outcome 'Passed' -Duration $millisec
}
}
}
}
else
{
Add-AppveyorTest -Framework 'CppUnit' -Name $component -Outcome 'Skipped'
}
}
Write-Host $runs' runs, ' $fails' fails'
if ($fails -gt 0)
{
Write-Host 'Failed: ' $failedTests
$host.SetShouldExit($fails);
} else
{
$host.SetShouldExit(0);
}
}
on_success:
- echo success
on_failure:
- echo failure
on_finish:
- echo finish
notifications:
- provider: Email
on_build_success: false
on_build_failure: false
on_build_status_changed: false
- provider: Slack
auth_token:
secure: xoOlP1UHshqjvh/INwMcNhZ5UHsTVKLGY5maTSjaxDc0fvRwoWIdYvY/CofQEuy2wOIBQK4eLD+tA0xG78ZgqQ==
channel: poco
on_build_success: false
on_build_status_changed: true
- provider: Slack
incoming_webhook: https://hooks.slack.com/services/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
auth_token:
secure: Xsss/K3VV9wZI9Ffwvafa67kyohNA437xJ3WA9fVI4w=
channel: appveyor
on_build_success: false
on_build_failure: true
on_build_status_changed: true