forked from pocoproject/poco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
613 lines (539 loc) · 23.3 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
version: build {branch}-{build}
cache:
- C:\mysql-5.7.26-win32
- C:\ProgramData\chocolatey
- C:\OpenSSL-Win32
- C:\OpenSSL-Win64
- C:\Program Files (x86)\PostgreSQL\9.6
branches:
except:
- /.*ravis.*/
- /.*ndroid.*/
- /.*NDROID.*/
#skip_commits:
# message: /.*Merge.*/
hosts:
localhost: 127.0.0.1
db.server.com: 127.0.0.2
services:
# mysql : server: localhost, port: 3306
# mysql : user : root, password: Password12!
- mysql
# mongodb config : C:\mongodb\mongod.cfg
# mongodb database: C:\mongodb\data\db
- mongodb
# Server name: localhost
# Server port: 5432
# postgres account password: Password12!
- postgresql
image:
- Visual Studio 2017
platform:
# - Win32
- x64
# -------------------------------------------------------------------------------------------
# building debug configuration doubles the round time and isn't so useful.
# tests are run only in release & shared.
# -------------------------------------------------------------------------------------------
configuration:
- release
# - debug
# -------------------------------------------------------------------------------------------
environment:
bundling: bundled
MYSQL32URL: http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.26-win32.zip
MYSQL32ZIP: mysql-5.7.26-win32.zip
MYSQL32: C:\mysql-5.7.26-win32
MYSQL64: C:\Program Files\MySql\MySQL Server 5.7
POSTGRES32: C:\Program Files (x86)\PostgreSQL\9.6
POSTGRES64: C:\Program Files\PostgreSQL\9.6
OPENSSLURL: https://slproweb.com/download
OPENSSL32EXE: Win32OpenSSL-1_1_0f.exe
OPENSSL64EXE: Win64OpenSSL-1_1_0f.exe
OPENSSL32: C:\OpenSSL-Win32
OPENSSL64: C:\OpenSSL-Win64
matrix:
# - builder: cygwin
# vsver: 150
- builder: msbuild
vsver: 140
linkmode: shared
# - builder: msbuild
# vsver: 140
# linkmode: static_md
# - builder: msbuild
# vsver: 140
# linkmode: static_mt
# - builder: msbuild
# vsver: 150
# linkmode: shared
# - builder: msbuild
# vsver: 150
# linkmode: static_md
# - builder: msbuild
# vsver: 150
# linkmode: static_mt
- builder: cmake
vsver: 150
matrix:
fast_finish: true
install:
- git submodule update --init --recursive --remote openssl
# -------------------------------------------------------------------------------------------
# VS2017 setup. VS2017 does not provide VS150COMNTOOLS.
# See https://blogs.msdn.microsoft.com/vcblog/2017/03/06/finding-the-visual-c-compiler-tools-in-visual-studio-2017/
# -------------------------------------------------------------------------------------------
- ps: |
Install-Module VSSetup -Scope CurrentUser -Force
$installationPath = Get-VSSetupInstance | Select-VSSetupInstance -Latest -Require Microsoft.VisualStudio.Component.VC.Tools.x86.x64 | select InstallationPath
$vs150comntools = $installationPath.psobject.properties.Value;
set-item -force -path "ENV:VS150COMNTOOLS" -value "$vs150comntools\Common7\Tools\"
Write-Host "`nVS150COMNTOOLS=$env:VS150COMNTOOLS" -ForegroundColor Yellow
# -------------------------------------------------------------------------------------------
- if "%builder%"=="cygwin" (
if "%platform%"=="Win32" (
C:\cygwin\setup-x86.exe -qnNdO -R C:/cygwin -s http://cygwin.mirror.constant.com -l C:/cygwin/var/cache/setup -P libpq5 -P libpq-devel -P libpcre-devel -P openssl-devel -P libiodbc-devel -P libiodbc2 -P odbc-mysql -P odbc-pgsql -P odbc-sqlite3 -P libmysqlclient-devel -P libsqlite3-devel -P libcrypt-devel
))
- if "%builder%"=="cygwin" (
if "%platform%"=="x64" (
C:\cygwin64\setup-x86_64.exe -qnNdO -R C:/cygwin64 -s http://cygwin.mirror.constant.com -l C:/cygwin64/var/cache/setup -P libpq5 -P libpq-devel -P libpcre-devel -P openssl-devel -P libiodbc-devel -P libiodbc2 -P odbc-mysql -P odbc-pgsql -P odbc-sqlite3 -P libmysqlclient-devel -P libsqlite3-devel -P libcrypt-devel
))
- set POCO_BASE=%CD%
- set PATH=C:\ProgramData\chocolatey\bin;%PATH%
- ps: |
if ($env:builder -eq "cygwin")
{
if ($env:platform -eq "Win32")
{
$env:PATH = "C:\cygwin\bin;" + $env:PATH
}
if ($env:platform -eq "x64")
{
$env:PATH = "c:\cygwin64\bin;" + $env:PATH
}
find /cygdrive/c/cygwin -name "cygpq-5.dll"
g++ --version
}
- uname -a
- cat /proc/cpuinfo
- cat /proc/meminfo
- ps: |
if ($env:builder -eq "cmake")
{
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
# }
# -------------------------------------------------------------------------------------------
# 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
$env:PATH = "C:\Program Files (x86)\cmake\bin;" + $env:PATH
$env:PATH = "C:\Program Files (x86)\ctest\bin;" + $env:PATH
}
# -------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
# MySQL 32 bit is not available by default on AppVeyor
# -------------------------------------------------------------------------------------------
- ps: |
if ($env:platform -eq "Win32")
{
if (Test-Path $env:MYSQL32) {
Write-Host "using $env:MYSQL32 from cache" -ForegroundColor Yellow
}
else
{
Write-Host "downloading $env:MYSQL32" -ForegroundColor Cyan
Invoke-WebRequest $env:MYSQL32URL -OutFile $env:MYSQL32ZIP
Write-Host "installing $env:MYSQL32" -ForegroundColor Green
7z x -y $env:MYSQL32ZIP -oc:\
}
}
# -------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
# PostgreSQL 32 bit is not available by default on AppVeyor
# http://www.enterprisedb.com/products-services-training/pgdownload#windows
# -------------------------------------------------------------------------------------------
- ps: |
if ($env:platform -eq "Win32")
{
if (Test-Path $env:POSTGRES32) {
Write-Host "using $env:POSTGRES32 from cache" -ForegroundColor Yellow
}
else
{
Write-Host "Installing $env:POSTGRES32 ..." -ForegroundColor Cyan
Write-Host "Downloading..."
$exePath = "$($env:USERPROFILE)\postgresql-9.6.5-1-windows.exe"
(New-Object Net.WebClient).DownloadFile('http://get.enterprisedb.com/postgresql/postgresql-9.6.5-1-windows.exe', $exePath)
Write-Host "Installing..."
cmd /c start /wait $exePath --mode unattended --superpassword Password12!
del $exePath
Write-Host "Setting up services..."
Stop-Service postgresql-9.6
Set-Service -Name postgresql-9.6 -StartupType Manual
Write-Host "$env:POSTGRES32 installed" -ForegroundColor Green
}
}
# -------------------------------------------------------------------------------------------
before_build:
- ps: |
if ($env:builder -eq "cmake")
{
if ($env:vsver -eq "110")
{
$vspath= convert-path $env:VS110COMNTOOLS\..\..\VC\bin; $yyyy='2010'
if($env:platform -eq 'Win32') { $vctool='';}
if($env:platform -eq 'x64') { $vctool='x86_amd64';$vspath+='\'+$vctool }
}
if ($env:vsver -eq "120")
{
$vspath= convert-path $env:VS120COMNTOOLS\..\..\VC\bin;$yyyy='2013'
if($env:platform -eq 'Win32') { $vctool='';}
if($env:platform -eq 'x64') { $vctool='x86_amd64';$vspath+='\'+$vctool }
}
if ($env:vsver -eq "140")
{
$vspath= convert-path $env:VS140COMNTOOLS\..\..\VC\bin; $yyyy='2015'
if($env:platform -eq 'Win32') { $vctool='';}
if($env:platform -eq 'x64') { $vctool='x86_amd64';$vspath+='\'+$vctool }
}
if ($env:vsver -eq "150")
{
$vspath= convert-path $env:VS150COMNTOOLS\..\..\VC\bin; $yyyy='2017'
if($env:platform -eq 'Win32') { $vctool='';}
if($env:platform -eq 'x64') { $vctool='x86_amd64';$vspath+='\'+$vctool }
}
pushd $vspath;
$tool= if($vctool -eq '') {'32'} else {$vctool}
cmd /c "vcvars$tool.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
write-host "`nVisual Studio $yyyy CLI variables set." -ForegroundColor Yellow
}
# -------------------------------------------------------------------------------------------
# PostgreSQL
# -------------------------------------------------------------------------------------------
- ps: |
if ($env:platform -eq "Win32")
{
$env:INCLUDE = $env:POSTGRES32 + "\include;" + $env:INCLUDE
$env:LIB = $env:POSTGRES32 + "\lib;" + $env:LIB
$env:PATH = $env:POSTGRES32 + "\bin;" + $env:PATH
}
if ($env:platform -eq "x64")
{
$env:INCLUDE = $env:POSTGRES64 + "\include;" + $env:INCLUDE
$env:LIB = $env:POSTGRES64 + "\lib;" + $env:LIB
$env:PATH = $env:POSTGRES64 + "\bin;" + $env:PATH
}
# -------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
# MySQL
# & C:\cygwin\bin\ls -lR $env:MYSQL32
# & C:\cygwin\bin\ls -lR $env:MYSQL64
# -------------------------------------------------------------------------------------------
- ps: |
if ($env:platform -eq "Win32")
{
$env:INCLUDE = $env:MYSQL32 + "\include;" + $env:INCLUDE
$env:LIB = $env:MYSQL32 + "\lib;" + $env:LIB
$env:PATH = $env:MYSQL32 + "\bin;" + $env:PATH
if (Test-Path ($env:MYSQL32 + "\lib\libmysql.dll")) {
$from = $env:MYSQL32 + "\lib\libmysql.dll";
$to = $env:MYSQL32 + "\bin\libmysql.dll"
copy $from $to
}
}
if ($env:platform -eq "x64")
{
$env:INCLUDE = $env:MYSQL64 + "\include;" + $env:INCLUDE
$env:LIB = $env:MYSQL64 + "\lib;" + $env:LIB
$env:PATH = $env:MYSQL64 + "\bin;" + $env:PATH
if (Test-Path ($env:MYSQL64 + "\lib\libmysql.dll")) {
$from = $env:MYSQL64 + "\lib\libmysql.dll";
$to = $env:MYSQL64 + "\bin\libmysql.dll"
copy $from $to
}
}
$env:MYSQL_PWD="Password12!"
$cmd = 'mysql -e "create database pocotestdb;" --user=root';
iex "& $cmd"
# -------------------------------------------------------------------------------------------
- set
- if "%platform%"=="Win32" ( dir "%MYSQL32%\include" )
- if "%platform%"=="x64" ( dir "%MYSQL64%\include" )
after_build:
- ps: |
$line='-------------------------------------------------------------------------------------';
$find='C:\Cygwin\bin\find.exe';
$arg1="$env:POCO_BASE -type f -name '*.cpp' -exec grep -n -H ";
$arg2=" {} ;"
$word='FIXME'
Write-Host -ForegroundColor Yellow $word;
Write-Host -ForegroundColor Yellow $line;
Start-Process -nnw -Wait -FilePath $find -Args "$arg1 $word $arg2" -RSO cout -RSE cerr;
gc cout; gc cerr;
Write-Host -ForegroundColor Yellow $line;
Write-Host;Write-Host;
$word='TODO'
Write-Host -ForegroundColor Yellow $word;
Write-Host -ForegroundColor Yellow $line;
Start-Process -nnw -Wait -FilePath $find -Args "$arg1 $word $arg2" -RSO cout -RSE cerr;
gc cout; gc cerr;
Write-Host -ForegroundColor Yellow $line;
Write-Host;Write-Host;
$word='HACK'
Write-Host -ForegroundColor Yellow $word;
Write-Host -ForegroundColor Yellow $line;
Start-Process -nnw -Wait -FilePath $find -Args "$arg1 $word $arg2" -RSO cout -RSE cerr;
gc cout; gc cerr;
Write-Host -ForegroundColor Yellow $line;
Write-Host;Write-Host;
build_script:
# -------------------------------------------------------------------------------------------
# When building with cmake, it remains one exception reported below
# Once this problem be fixed, a fix from Microsoft about mc.exe outputing informative
# message on stderr: https://connect.microsoft.com/VisualStudio/Feedback/Details/2161572
# 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
# -------------------------------------------------------------------------------------------
# Don't build Cygwin64 with std=c++14 until this issue be fixed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77441
# -------------------------------------------------------------------------------------------
- ps: |
if ($env:builder -eq "cygwin")
{
$cmd='bash.exe configure --everything --omit=PDF';iex "& $cmd"
$cmd='make.exe -s';iex "& $cmd"
}
if ($env:builder -eq "msbuild")
{
$logger='"C:\Progra~1\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"';
$verbosity='minimal';
Write-Host -ForegroundColor Yellow "$env:poco_base\buildwin.cmd" " $env:vsver build $env:linkmode $env:configuration $env:platform samples tests msbuild env $verbosity"
$process = Start-Process -PassThru -nnw -Wait -FilePath "$env:poco_base\buildwin.cmd" -RSO cout -RSE cerr `
-EA Stop -Args "$env:vsver build $env:linkmode $env:configuration $env:platform samples tests msbuild env $verbosity $logger";
gc cout; gc cerr;
Write-Host -ForegroundColor Yellow '>>> current directory is ' $(get-location).Path;
}
if ($env:builder -eq "cmake")
{
if ($env:platform -eq "Win32")
{
if ($env:vsver -eq "140")
{
$generator = '"Visual Studio 14 2015"'
}
if ($env:vsver -eq "150")
{
$generator = '"Visual Studio 15 2017"'
}
}
if ($env:platform -eq "x64")
{
if ($env:vsver -eq "140")
{
$generator = '"Visual Studio 14 2015 Win64"'
}
if ($env:vsver -eq "150")
{
$generator = '"Visual Studio 15 2017 Win64"'
}
}
# Visual Studio projects are multi-configuration build system, this means CMAKE_BUILD_TYPE is ignored!
# Use --config Debug or --config Release at build time. See below.
$defs = "-H."
$defs+=" -Bbuild-cmake"
$defs+=" -G" + $generator;
$defs+=" -DPOCO_ENABLE_PDF=OFF";
$defs+=" -DPOCO_ENABLE_NETSSL=ON";
$defs+=" -DPOCO_ENABLE_NETSSL_WIN=ON";
$defs+=" -DPOCO_ENABLE_SQL_MYSQL=OFF";
$defs+=" -DPOCO_ENABLE_REDIS=OFF";
$defs+=" -DPOCO_ENABLE_SAMPLES=ON";
$defs+=" -DPOCO_ENABLE_TESTS=ON";
Write-Host -ForegroundColor Yellow cmake $defs
$process = Start-Process -PassThru -nnw -Wait -FilePath "cmake" -RSO cout -RSE cerr -Args $defs;
gc cout; gc cerr;
try {
$ErrorActionPreference = 'Continue';
Write-Host -ForegroundColor Yellow cmake `-`-build build-cmake --config Debug
cmake `-`-build build-cmake --config Debug
} catch {
Write-Warning "Oops: $_"
}
popd
Write-Host -ForegroundColor Yellow '>>> current directory is ' $(get-location).Path;
$ErrorActionPreference = 'Stop';
}
before_test:
- ps: |
$line='-------------------------------------------------------------------------------------';
$CPPUNIT_IGNORE='';
$CPPUNIT_IGNORE+='class CppUnit::TestCaller<class NTPClientTest>.testTimeSync,';
$CPPUNIT_IGNORE+='class CppUnit::TestCaller<class GlobTest>.testGlob,';
$CPPUNIT_IGNORE+='class CppUnit::TestCaller<class RawSocketTest>.testEchoIPv4,';
$CPPUNIT_IGNORE+='class CppUnit::TestCaller<class RawSocketTest>.testSendToReceiveFromIPv4,';
$CPPUNIT_IGNORE+='class CppUnit::TestCaller<class ICMPClientTest>.testPing,';
$CPPUNIT_IGNORE+='class CppUnit::TestCaller<class ICMPClientTest>.testBigPing,';
$CPPUNIT_IGNORE+='class CppUnit::TestCaller<class HTTPSClientSessionTest>.testProxy,';
$CPPUNIT_IGNORE+='class CppUnit::TestCaller<class HTTPSStreamFactoryTest>.testProxy,';
$CPPUNIT_IGNORE+='class CppUnit::TestCaller<class TCPServerTest>.testReuseSocket,';
$CPPUNIT_IGNORE+='class CppUnit::TestCaller<class HTTPSClientSessionTest>.testInterop,';
$CPPUNIT_IGNORE+='class CppUnit::TestCaller<class TimerTest>.testTimer,';
$CPPUNIT_IGNORE+='class CppUnit::TestCaller<class PathTest>.testFind,';
$CPPUNIT_IGNORE+='class CppUnit::TestCaller<class ICMPSocketTest>.testSendToReceiveFrom,';
$CPPUNIT_IGNORE+='class CppUnit::TestCaller<class ICMPSocketTest>.testMTU,';
set-item -force -path "ENV:CPPUNIT_IGNORE" -value $CPPUNIT_IGNORE
Write-Host -ForegroundColor Yellow 'CPPUNIT_IGNORE'
Write-Host -ForegroundColor Yellow $line;
foreach($t in $CPPUNIT_IGNORE.split(",")) { Write-Host -ForegroundColor Yellow $t.trim() }
Write-Host -ForegroundColor Yellow $line;
after_test:
test_script:
- ps: |
$runs=0;$fails=0;$failedTests='';$status=0;$tab="`t";
$line='-------------------------------------------------------------------------------------';
if ($env:configuration -eq "release")
{
if ($env:builder -eq "cygwin")
{
$runner="";$runnerd="";$global:LastExitCode=0;
if ($env:platform -eq "Win32")
{
$runner="$env:POCO_BASE\net\testsuite\bin\cygwin\i686\testrunner.exe"
$runnerd="$env:POCO_BASE\net\testsuite\bin\cygwin\i686\testrunnerd.exe"
}
if ($env:platform -eq "x64")
{
$runner="$env:POCO_BASE\net\testsuite\bin\cygwin\x86_64\testrunner.exe"
$runnerd="$env:POCO_BASE\net\testsuite\bin\cygwin\x86_64\testrunnerd.exe"
}
Write-Host -ForegroundColor Yellow $runner;
$cmd = 'netsh advfirewall firewall add rule name="TestRunner" profile=any dir=in program="$runner" action=allow';
Write-Host -ForegroundColor Yellow $cmd;iex "& $cmd";
Write-Host -ForegroundColor Yellow ': LastExitCode=' $lastExitCode;
Write-Host -ForegroundColor Yellow $runnerd;
$cmd = 'netsh advfirewall firewall add rule name="TestRunner" profile=any dir=in program="$runnerd" action=allow';
Write-Host -ForegroundColor Yellow $cmd;iex "& $cmd";
Write-Host -ForegroundColor Yellow ': LastExitCode=' $lastExitCode;
$cmd = 'bash.exe -c "appveyor/Cygwin/runtests.sh"';
Write-Host -ForegroundColor Yellow $cmd;iex "& $cmd";
Write-Host -ForegroundColor Yellow ': LastExitCode=' $lastExitCode;
}
if ($env:builder -eq "msbuild" -and $env:linkmode -eq "shared")
{
$suffix = '';
if ($env:platform -eq "Win32")
{
$env:PATH = "$env:POCO_BASE\bin;" + $env:PATH;$suffix = '';
$excluded = @('Redis', 'PDF')
}
if ($env:platform -eq "x64")
{
$env:PATH = "$env:POCO_BASE\bin64;" + $env:PATH;$suffix = 64;
$excluded = @('Redis', 'PDF')
}
Write-Host -ForegroundColor Yellow '>>> current directory is ' $(get-location).Path;
$components = gc $env:poco_base\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;
foreach ($component in $components) {
if ($excluded -notcontains $component) {
$path = "$env:poco_base\" + $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 -nnw -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 'NotFound'
}
} else {
Add-AppveyorTest -Framework 'CppUnit' -Name $component -Outcome 'Skipped'
}
}
}
if ($env:builder -eq "cmake")
{
pushd build-cmake;
Write-Host -ForegroundColor Yellow $line;
ctest --config Debug -N
Write-Host -ForegroundColor Yellow $line;
$cmd='ctest -C Debug --output-on-failure -E SQL*';
Write-Host -ForegroundColor Yellow $cmd
iex "& $cmd"
popd
}
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
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