poco/appveyor.yml
FrancisANDRE 39ca46f7ce Run ctest..
Signed-off-by: FrancisANDRE <zosrothko@orange.fr>
2015-12-20 09:18:13 +01:00

338 lines
10 KiB
YAML

version: poco-1.7.0 {branch}-{build}
cache:
# - c:\mysql-5.7.9-win32
- C:\ProgramData\chocolatey
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
matrix:
# -------------------------------------------------------------------------------------------
# When builder is cmake, it remains one exception reported below
# Once this problem fixed, the try/catch around the cmake builder can be removed
#
# [ 1%] Generating pocomsg.h
# cmake : MC: Compiling C:/projects/poco/Foundation/src/pocomsg.mc
# At line:16 char:3
# + cmake --build . --config $env:configuration
# + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# + CategoryInfo : NotSpecified: (MC: Compiling C.../src/pocomsg.mc:String) [], RemoteException
# + FullyQualifiedErrorId : NativeCommandError
#
# Command executed with exception: MC: Compiling C:/projects/poco/Foundation/src/pocomsg.mc
# -------------------------------------------------------------------------------------------
- builder: cmake
vsver: 120
# -------------------------------------------------------------------------------------------
- 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:
- set PATH=C:\ProgramData\chocolatey\bin;%PATH%
- systeminfo
- c:\cygwin\bin\uname -a
- c:\cygwin\bin\cat /proc/cpuinfo
- c:\cygwin\bin\cat /proc/meminfo
- ps: |
if (Test-Path "$env:ChocolateyInstall\bin\jom.exe") {
echo "using jom from cache"
} else {
choco install jom
}
if (Test-Path "$env:ChocolateyInstall\bin\cmake.exe") {
echo "using cmake from cache"
} else {
choco install cmake
}
- where cmake
- where jom
- set
# chocolatey brokes jom, here's workaround
# see https://github.com/jcfr/qt-easy-build/commit/6366f4275562bdaf4f686838600f46894579c41e)
- ps: |
if ($env:builder -eq "cmake")
{
$env:PATH = $env:ChocolateyInstall + "\bin" + ";" + $env:PATH
$env:PATH = $env:ChocolateyInstall + "\lib\jom\content" + ";" + $env:PATH
}
# 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")
{
pushd $env:VS120COMNTOOLS; $yyyy='2013'
}
if ($env:vsver -eq "140")
{
pushd $env:VS140COMNTOOLS; $yyyy='2015'
}
cmd /c "vsvars32.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
write-host "`nVisual Studio $yyyy Command Prompt variables set." -ForegroundColor Yellow
# 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")
{
$logger='C:\Progra~1\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll';
$samples='samples';$tests='tests';$verbosity='minimal';
$process = Start-Process -PassThru -NoNewWindow -Wait -FilePath "buildwin.cmd" -RSO cout -RSE cerr `
-Args "$env:vsver build $env:linkmode $env:configuration $env:platform `
$samples $tests msbuild $verbosity $logger";
gc cout; gc cerr;
}
if ($env:builder -eq "cmake")
{
mkdir cmake-build | out-null;cd cmake-build;
cmake ../. -G"NMake Makefiles" -DENABLE_SAMPLES=ON -DENABLE_TESTS=ON -DENABLE_NETSSL=OFF -DENABLE_NETSSL_WIN=ON -DENABLE_DATA_MYSQL=OFF -DENABLE_REDIS=OFF
try {
$ErrorActionPreference = 'Continue';
cmake --build . --config $env:configuration
} catch {
Write-Warning "Oops: $_"
}
cd ..
}
before_test:
- set POCO_BASE=%CD%
- set CPPUNIT_IGNORE='class CppUnit::TestCaller<class NTPClientTest>.testTimeSync, class CppUnit::TestCaller<class RawSocketTest>.testEchoIPv4, class CppUnit::TestCaller<class RawSocketTest>.test
SendToReceiveFromIPv4, class CppUnit::TestCaller<class ICMPClientTest>.testPing'
after_test:
test_script:
- ps: |
if ($env:builder -eq "msbuild")
{
$excluded = @('Data', 'Data/MySQL', 'Data/ODBC','Redis', 'PDF')
}
if ($env:builder -eq "cmake")
{
$excluded = @(
'CppUnit', 'CppUnit/WinTestRunner', 'NetSSL_OpenSSL',
'Data','Data/ODBC','Data/MySQL',
'PageCompiler','PageCompiler/File2Page',
'PDF','Redis', 'PocoDoc','ProGen'
)
}
$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
{
Write-Host -ForegroundColor Yellow 'using ctest -VV -R ' $component
ctest -VV -R $component
}
}
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