Merge pull request #1099 from Kampbell/AppVeyorWithCMake

AppVeyor with Cmake
This commit is contained in:
Günter Obiltschnig 2015-12-23 23:38:25 +01:00
commit e21c77b74b
26 changed files with 464 additions and 230 deletions

1
.gitignore vendored
View File

@ -149,3 +149,4 @@ openssl/packages/
!openssl/win64/lib/debug/*.pdb
!openssl/win64/lib/release/*.lib
/Debug

View File

@ -3,6 +3,11 @@ language: cpp
cache:
- apt
branches:
except:
- /*?pp?eyor*/
before_install:
# we need a recent version of CMake
# - sudo add-apt-repository -y ppa:andykimpe/cmake3
@ -40,9 +45,10 @@ matrix:
compiler: clang
os: osx
script:
- ./configure --everything --omit=Data/ODBC,Data/MySQL,Data/SQLite
- ./configure --everything --omit=Data/ODBC,Data/MySQL,Data/SQLite && make -j2
- cat config.*
- make install -j2
- sudo make install
- ls -l /usr/local/lib/*Poco*
- find . -name "*testrunner*"
- ./travis/runtests.sh
@ -50,6 +56,7 @@ matrix:
compiler: gcc
script:
- ./configure --everything && make -s -j2
- sudo make install
- ./travis/runtests.sh
- env: TEST_NAME="Linux gcc (make) unbundled"
@ -57,12 +64,14 @@ matrix:
script:
- sudo apt-get install -qq -y libpcre3-dev libssl-dev libexpat1-dev
- ./configure --everything --unbundled && make -s -j2
- sudo make install
- ./travis/runtests.sh
- env: TEST_NAME="Linux clang (make)"
compiler: clang
script:
- ./configure --everything --config=Linux-clang && make -s -j2
- sudo make install
- ./travis/runtests.sh
- env: TEST_NAME="Linux arm-linux-gnueabi- (make)"

View File

@ -21,6 +21,6 @@ target_include_directories( "${LIBNAME}"
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
)
if (ENABLE_TESTS)
if (ENABLE_SAMPLES)
add_subdirectory(samples)
endif ()

View File

@ -5,6 +5,7 @@
#
# ENABLE_{COMPONENT}
# ENABLE_TESTS
# ENABLE_SAMPLES
cmake_minimum_required(VERSION 3.0.0)
@ -81,7 +82,10 @@ option(ENABLE_REDIS "Enable Redis" ON)
option(FORCE_OPENSSL "Force usage of OpenSSL even under windows" OFF)
option(ENABLE_TESTS
"Set to OFF|ON (default is OFF) to control build of POCO tests & samples" OFF)
"Set to OFF|ON (default is OFF) to control build of POCO tests" OFF)
option(ENABLE_SAMPLES
"Set to OFF|ON (default is OFF) to control build of POCO samples" OFF)
option(POCO_STATIC
"Set to OFF|ON (default is OFF) to control build of POCO as STATIC library" OFF)
@ -111,9 +115,15 @@ endif(POCO_STATIC)
if (ENABLE_TESTS)
include(CTest)
enable_testing()
message(STATUS "Building with unittests & samples")
message(STATUS "Building with tests")
else ()
message(STATUS "Building without tests & samples")
message(STATUS "Building without tests")
endif ()
if (ENABLE_SAMPLES)
message(STATUS "Building with samples")
else ()
message(STATUS "Building without samples")
endif ()
if (POCO_UNBUNDLED)

View File

@ -43,10 +43,10 @@ void TextTestResult::setup()
std::string::const_iterator end = ignored.end();
while (it != end)
{
while (it != end && (std::isspace(*it) || *it == '"')) ++it;
while (it != end && (std::isspace(*it) || *it == '"' || *it == '\'')) ++it;
std::string test;
while (it != end && *it != ',' && *it != '"') test += *it++;
if (it != end && (*it == ',' || *it == '"')) ++it;
while (it != end && *it != ',' && *it != '"' && *it != '\'') test += *it++;
if (it != end && (*it == ',' || *it == '"' || *it == '\'')) ++it;
if (!test.empty()) _ignored.insert(test);
}
}

View File

@ -25,7 +25,9 @@ target_include_directories( "${LIBNAME}"
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
${OPENSSL_INCLUDE_DIR}
)
target_compile_definitions("${LIBNAME}" PUBLIC ${LIB_MODE_DEFINITIONS})
@ -33,6 +35,8 @@ POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")
if (ENABLE_TESTS)
add_subdirectory(samples)
add_subdirectory(testsuite)
endif ()
if (ENABLE_SAMPLES)
add_subdirectory(samples)
endif ()

View File

@ -18,7 +18,7 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
add_executable( ${TESTUNIT} ${TEST_SRCS} )
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
target_link_libraries( ${TESTUNIT} PocoCrypto PocoNetSSL PocoXML PocoUtil PocoFoundation CppUnit )
target_link_libraries( ${TESTUNIT} PocoCrypto PocoXML PocoUtil PocoFoundation CppUnit )
if(UNIX)
target_link_libraries( ${TESTUNIT} pthread)
endif(UNIX)

View File

@ -73,6 +73,8 @@ if(ENABLE_DATA_ODBC)
endif(ENABLE_DATA_ODBC)
if (ENABLE_TESTS)
add_subdirectory(samples)
add_subdirectory(testsuite)
endif ()
if (ENABLE_SAMPLES)
add_subdirectory(samples)
endif ()

View File

@ -174,7 +174,9 @@ POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")
if (ENABLE_TESTS)
add_subdirectory( samples )
add_subdirectory( testsuite )
endif ()
if (ENABLE_SAMPLES)
add_subdirectory( samples )
endif ()

View File

@ -31,7 +31,9 @@ POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")
if (ENABLE_TESTS)
add_subdirectory(samples)
add_subdirectory(testsuite)
endif ()
if (ENABLE_SAMPLES)
add_subdirectory(samples)
endif ()

View File

@ -31,7 +31,9 @@ POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")
if (ENABLE_TESTS)
add_subdirectory(samples)
add_subdirectory(testsuite)
endif ()
if (ENABLE_SAMPLES)
add_subdirectory(samples)
endif ()

View File

@ -40,7 +40,9 @@ POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")
if (ENABLE_TESTS)
add_subdirectory(samples)
add_subdirectory(testsuite)
endif ()
if (ENABLE_SAMPLES)
add_subdirectory(samples)
endif ()

View File

@ -31,7 +31,9 @@ POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")
if (ENABLE_TESTS)
add_subdirectory(samples)
add_subdirectory(testsuite)
endif ()
if (ENABLE_SAMPLES)
add_subdirectory(samples)
endif ()

View File

@ -307,27 +307,22 @@ void HTTPSClientSessionTest::testInterop()
void HTTPSClientSessionTest::testProxy()
{
try {
HTTPSTestServer srv;
HTTPSClientSession s("secure.appinf.com");
s.setProxy(
Application::instance().config().getString("testsuite.proxy.host"),
Application::instance().config().getInt("testsuite.proxy.port")
);
HTTPRequest request(HTTPRequest::HTTP_GET, "/public/poco/NetSSL.txt");
s.sendRequest(request);
X509Certificate cert = s.serverCertificate();
HTTPResponse response;
std::istream& rs = s.receiveResponse(response);
std::ostringstream ostr;
StreamCopier::copyStream(rs, ostr);
std::string str(ostr.str());
assert(str == "This is a test file for NetSSL.\n");
assert(cert.commonName() == "secure.appinf.com" || cert.commonName() == "*.appinf.com");
}
catch (Poco::Net::HTTPException e) {
std::cout << e.displayText() << std::endl;
}
HTTPSTestServer srv;
HTTPSClientSession s("secure.appinf.com");
s.setProxy(
Application::instance().config().getString("testsuite.proxy.host"),
Application::instance().config().getInt("testsuite.proxy.port")
);
HTTPRequest request(HTTPRequest::HTTP_GET, "/public/poco/NetSSL.txt");
s.sendRequest(request);
X509Certificate cert = s.serverCertificate();
HTTPResponse response;
std::istream& rs = s.receiveResponse(response);
std::ostringstream ostr;
StreamCopier::copyStream(rs, ostr);
std::string str(ostr.str());
assert(str == "This is a test file for NetSSL.\n");
assert(cert.commonName() == "secure.appinf.com" || cert.commonName() == "*.appinf.com");
}
@ -480,7 +475,7 @@ CppUnit::Test* HTTPSClientSessionTest::suite()
CppUnit_addTest(pSuite, HTTPSClientSessionTest, testKeepAlive);
CppUnit_addTest(pSuite, HTTPSClientSessionTest, testInterop);
#ifdef FIXME
should use a public proxy server
testProxy should use a public proxy server
http://www.publicproxyservers.com/proxy/list1.html
Really working public proxy servers - page 1 of 6.
#endif

View File

@ -85,21 +85,17 @@ void HTTPSStreamFactoryTest::testRedirect()
void HTTPSStreamFactoryTest::testProxy()
{
try {
HTTPSTestServer server;
HTTPSStreamFactory factory(
Application::instance().config().getString("testsuite.proxy.host"),
Application::instance().config().getInt("testsuite.proxy.port")
);
URI uri("https://secure.appinf.com/public/poco/NetSSL.txt");
std::auto_ptr<std::istream> pStr(factory.open(uri));
std::ostringstream ostr;
StreamCopier::copyStream(*pStr.get(), ostr);
assert(ostr.str().length() > 0);
}
catch (Poco::Net::HTTPException e) {
std::cout << e.displayText() << std::endl;
}
HTTPSTestServer server;
HTTPSStreamFactory factory(
Application::instance().config().getString("testsuite.proxy.host"),
Application::instance().config().getInt("testsuite.proxy.port")
);
URI uri("https://secure.appinf.com/public/poco/NetSSL.txt");
std::auto_ptr<std::istream> pStr(factory.open(uri));
std::ostringstream ostr;
StreamCopier::copyStream(*pStr.get(), ostr);
assert(ostr.str().length() > 0);
}
@ -139,7 +135,7 @@ CppUnit::Test* HTTPSStreamFactoryTest::suite()
CppUnit_addTest(pSuite, HTTPSStreamFactoryTest, testEmptyPath);
CppUnit_addTest(pSuite, HTTPSStreamFactoryTest, testRedirect);
#ifdef FIXME
should use a public proxy server
testProxy should use a public proxy server
http://www.publicproxyservers.com/proxy/list1.html
Really working public proxy servers - page 1 of 6.
#endif

View File

@ -31,8 +31,21 @@ POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")
if (ENABLE_TESTS)
#TODO: Looks like the samples use crypto somehow?
#add_subdirectory(samples)
#add_subdirectory(testsuite)
if (WIN32)
# FIXME:
# add_subdirectory(testsuite)
message(STATUS "############ FIXME: ${LIBNAME} add_subdirectory(testsuite)")
else ()
add_subdirectory(testsuite)
endif ()
endif ()
if (ENABLE_SAMPLES)
if (WIN32)
# FIXME: Looks like the samples use crypto somehow?
# add_subdirectory(samples)
message(STATUS "############ FIXME: ${LIBNAME} add_subdirectory(samples)")
else ()
add_subdirectory(testsuite)
endif ()
endif ()

View File

@ -314,27 +314,27 @@ void HTTPSClientSessionTest::testInterop()
void HTTPSClientSessionTest::testProxy()
{
try {
HTTPSTestServer srv;
HTTPSClientSession s("secure.appinf.com");
s.setProxy(
Application::instance().config().getString("testsuite.proxy.host"),
Application::instance().config().getInt("testsuite.proxy.port")
);
HTTPRequest request(HTTPRequest::HTTP_GET, "/public/poco/NetSSL.txt");
s.sendRequest(request);
Poco::Net::X509Certificate cert = s.serverCertificate();
HTTPResponse response;
std::istream& rs = s.receiveResponse(response);
std::ostringstream ostr;
StreamCopier::copyStream(rs, ostr);
std::string str(ostr.str());
assert(str == "This is a test file for NetSSL.\n");
assert(cert.commonName() == "secure.appinf.com" || cert.commonName() == "*.appinf.com");
}
catch (Poco::Exception e) {
std::cout << e.displayText() << std::endl;
}
#ifdef FIXME
testProxy should use a public proxy server
http://www.publicproxyservers.com/proxy/list1.html
Really working public proxy servers - page 1 of 6.
#endif
HTTPSTestServer srv;
HTTPSClientSession s("secure.appinf.com");
s.setProxy(
Application::instance().config().getString("testsuite.proxy.host"),
Application::instance().config().getInt("testsuite.proxy.port")
);
HTTPRequest request(HTTPRequest::HTTP_GET, "/public/poco/NetSSL.txt");
s.sendRequest(request);
Poco::Net::X509Certificate cert = s.serverCertificate();
HTTPResponse response;
std::istream& rs = s.receiveResponse(response);
std::ostringstream ostr;
StreamCopier::copyStream(rs, ostr);
std::string str(ostr.str());
assert(str == "This is a test file for NetSSL.\n");
assert(cert.commonName() == "secure.appinf.com" || cert.commonName() == "*.appinf.com");
}

View File

@ -85,21 +85,21 @@ void HTTPSStreamFactoryTest::testRedirect()
void HTTPSStreamFactoryTest::testProxy()
{
try {
HTTPSTestServer server;
HTTPSStreamFactory factory(
Application::instance().config().getString("testsuite.proxy.host"),
Application::instance().config().getInt("testsuite.proxy.port")
);
URI uri("https://secure.appinf.com/public/poco/NetSSL.txt");
std::auto_ptr<std::istream> pStr(factory.open(uri));
std::ostringstream ostr;
StreamCopier::copyStream(*pStr.get(), ostr);
assert(ostr.str().length() > 0);
}
catch (Poco::Exception e) {
std::cout << e.displayText() << std::endl;
}
#ifdef FIXME
testProxy should use a public proxy server
http://www.publicproxyservers.com/proxy/list1.html
Really working public proxy servers - page 1 of 6.
#endif
HTTPSTestServer server;
HTTPSStreamFactory factory(
Application::instance().config().getString("testsuite.proxy.host"),
Application::instance().config().getInt("testsuite.proxy.port")
);
URI uri("https://secure.appinf.com/public/poco/NetSSL.txt");
std::auto_ptr<std::istream> pStr(factory.open(uri));
std::ostringstream ostr;
StreamCopier::copyStream(*pStr.get(), ostr);
assert(ostr.str().length() > 0);
}

View File

@ -136,7 +136,9 @@ POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")
if (ENABLE_TESTS)
add_subdirectory(samples)
add_subdirectory(testsuite)
endif ()
if (ENABLE_SAMPLES)
add_subdirectory(samples)
endif ()

View File

@ -19,3 +19,7 @@ install(
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)
if (ENABLE_SAMPLES)
# add_subdirectory(samples)
endif ()

View File

@ -31,7 +31,9 @@ POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")
if (ENABLE_TESTS)
# add_subdirectory(samples)
add_subdirectory(testsuite)
endif ()
if (ENABLE_SAMPLES)
# add_subdirectory(samples)
endif ()

View File

@ -72,8 +72,10 @@ POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")
if (ENABLE_TESTS)
add_subdirectory(samples)
# TODO: Add tests
#add_subdirectory(testsuite)
endif ()
if (ENABLE_SAMPLES)
add_subdirectory(samples)
endif ()

View File

@ -48,6 +48,8 @@ POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")
if (ENABLE_TESTS)
add_subdirectory(samples)
add_subdirectory(testsuite)
endif ()
if (ENABLE_SAMPLES)
add_subdirectory(samples)
endif ()

View File

@ -54,7 +54,9 @@ POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")
if (ENABLE_TESTS)
add_subdirectory(samples)
add_subdirectory(testsuite)
endif ()
if (ENABLE_SAMPLES)
add_subdirectory(samples)
endif ()

View File

@ -31,7 +31,9 @@ POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")
if (ENABLE_TESTS)
add_subdirectory(samples)
add_subdirectory(testsuite)
endif ()
if (ENABLE_SAMPLES)
add_subdirectory(samples)
endif ()

View File

@ -1,106 +1,203 @@
version: poco-1.7.0 {branch}-{build}
cache:
- c:\mysql-5.7.9-win32
- c:\mysql-5.7.9-win32
- C:\ProgramData\chocolatey
- C:\OpenSSL-Win32
- C:\OpenSSL-Win64
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
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
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:\
}
}
# - debug
# -------------------------------------------------------------------------------------------
environment:
bundling: bundled
logger: 'C:\Progra~1\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll'
samples: samples
tests: tests
verbosity: minimal
matrix:
- builder: 120
- builder: cmake
vsver: 120
- builder: msbuild
vsver: 120
linkmode: shared
# - builder: 120
- builder: msbuild
vsver: 120
linkmode: static_md
- builder: msbuild
vsver: 120
linkmode: static_mt
# -------------------------------------------------------------------------------------------
# VS2013 runs a x64 or Win32 build & tests in around 32 mn
# Environment: builder=msbuild, vsver=120, linkmode=shared; Platform: Win32 31 min 33 sec
# Environment: builder=msbuild, vsver=120, linkmode=shared; Platform: x64 33 min 32 sec
#
# In VS2015 running either a x64 or Win32 build & tests takes twice time and thus makes the build failed since
# it overpasses 1 hour and free Appveyor account job are limited to 1 hour. Thus VS2015 builds
# are removed until one finds out the reason why build time is doubled.
#
# Environment: builder=msbuild, vsver=140, linkmode=shared; Platform: Win32 1 hr
# Environment: builder=msbuild, vsver=140, linkmode=shared; Platform: x64 1 hr
# -------------------------------------------------------------------------------------------
# - builder: msbuild
# vsver: 140
# linkmode: shared
# - builder: msbuild
# vsver: 140
# linkmode: static_md
# - builder: 120
# linkmode: static_mt
- builder: 140
linkmode: shared
# - builder: 140
# linkmode: static_md
# - builder: 140
# - 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 ($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
}
}
- 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
}
# -------------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------------
# OpenSSL-Win32 & OpenSSL-Win64
# Download & use OpenSSL from Shining Light Productions for CMake
# until CMake use implicitly the embedded openssl from the Poco repo. See issue #1093
# -------------------------------------------------------------------------------------------
- ps: |
if ($env:builder -eq "cmake")
{
if ($env:platform -eq "Win32")
{
if (Test-Path "C:\OpenSSL-Win32") {
echo "using C:\OpenSSL-Win32 from cache"
} else {
echo "downloading OpenSSL-Win32"
Start-FileDownload 'http://slproweb.com/download/Win32OpenSSL-1_0_2e.exe'
echo "installing C:\OpenSSL-Win32"
Start-Process "Win32OpenSSL-1_0_2e.exe" -Args "/silent /verysilent /sp- /suppressmsgboxes" -Wait
}
}
if ($env:platform -eq "x64")
{
if (Test-Path "C:\OpenSSL-Win64") {
echo "using C:\OpenSSL-Win64 from cache"
} else {
echo "downloading OpenSSL-Win64"
Start-FileDownload 'http://slproweb.com/download/Win64OpenSSL-1_0_2e.exe'
echo "installing C:\OpenSSL-Win64"
Start-Process "Win64OpenSSL-1_0_2e.exe" -Args "/silent /verysilent /sp- /suppressmsgboxes" -Wait
}
}
}
# -------------------------------------------------------------------------------------------
# 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 c:\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 c:\mysql-5.7.9-win32"
7z x -y mysql-5.7.9-win32.zip -oc:\
}
}
# -------------------------------------------------------------------------------------------
before_build:
- set POCO_BASE=%CD%
- ps: |
if ($env:builder -eq "120")
{
if ($env:platform -eq "Win32")
{
& "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
$env:suffix = ""
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 }
}
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])"
}
if ($env:platform -eq "x64")
{
& "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64
$env:suffix = 64
}
}
if ($env:builder -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
}
}
}
popd
write-host "`nVisual Studio $yyyy CLI variables set." -ForegroundColor Yellow
# MySQL
- ps: |
@ -119,103 +216,192 @@ after_build:
- ps: |
$line='-------------------------------------------------------------------------------------';
$find='c:\cygwin\bin\find.exe';
$arg1=". -type f -name '*.cpp' -exec c:\cygwin\bin\grep -n -H ";
$arg1="$env:POCO_BASE -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";
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;
Write-Host -ForegroundColor Yellow $line;
$word='TODO'
Start-Process -NoNewWindow -Wait -FilePath $find -Args "$arg1 $word $arg2" -RSO "cout" -RSE "cerr";
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;
Write-Host -ForegroundColor Yellow $line;
$word='HACK'
Start-Process -NoNewWindow -Wait -FilePath $find -Args "$arg1 $word $arg2" -RSO "cout" -RSE "cerr";
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:
- buildwin %builder% build %linkmode% %configuration% %platform% %samples% %tests% msbuild %verbosity% %logger%
# -------------------------------------------------------------------------------------------
# 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
# -------------------------------------------------------------------------------------------
- ps: |
if ($env:builder -eq "msbuild")
{
$logger='"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"';
$verbosity='minimal';
$process = Start-Process -PassThru -nnw -Wait -FilePath "$env:poco_base\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;
Write-Host -ForegroundColor Yellow '>>> current directory is ' $(get-location).Path;
}
if ($env:builder -eq "cmake")
{
mkdir cmake-build | out-null;pushd cmake-build;
if ($env:platform -eq "Win32")
{
$opensslrootdir = 'C:\OpenSSL-Win32'
}
if ($env:platform -eq "x64")
{
$opensslrootdir = 'C:\OpenSSL-Win64'
}
$defs =' -G"NMake Makefiles"';
$defs+=" -DCMAKE_BUILD_TYPE=$env:configuration";
$defs+=" -DOPENSSL_ROOT_DIR=$opensslrootdir";
$defs+=" -DENABLE_NETSSL=OFF";
$defs+=" -DENABLE_NETSSL_WIN=ON";
$defs+=" -DENABLE_DATA_MYSQL=OFF";
$defs+=" -DENABLE_REDIS=OFF";
$defs+=" -DENABLE_SAMPLES=ON";
$defs+=" -DENABLE_TESTS=ON";
$defs+=" ..";
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 .
cmake `-`-build .
} catch {
Write-Warning "Oops: $_"
}
popd
Write-Host -ForegroundColor Yellow '>>> current directory is ' $(get-location).Path;
$ErrorActionPreference = 'Stop';
}
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%
- ps: |
$line='-------------------------------------------------------------------------------------';
$CPPUNIT_IGNORE='';
$CPPUNIT_IGNORE+='class CppUnit::TestCaller<class NTPClientTest>.testTimeSync';
$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 HTTPSClientSessionTest>.testProxy';
$CPPUNIT_IGNORE+=', class CppUnit::TestCaller<class HTTPSStreamFactoryTest>.testProxy';
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: |
$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")
if ($env:builder -eq "msbuild" -and $env:linkmode -eq "shared")
{
$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)
$suffix = '';
if ($env:platform -eq "Win32")
{
[string]$path = $component + "\testsuite\bin$suffix\TestSuite.exe";
$env:PATH = "$env:POCO_BASE\bin;" + $env:PATH;$suffix = '';
}
if ($env:platform -eq "x64")
{
$env:PATH = "$env:POCO_BASE\bin64;" + $env:PATH;$suffix = 64;
}
if (Test-Path -Path $path) {
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;
$excluded = @('Data', 'Data/MySQL', 'Data/ODBC','Redis', 'PDF')
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$builder $env:Platform $env:Configuration $env:linkmode '|' $tab $tab $component;
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";
$process = Start-Process -PassThru -nnw -Wait -FilePath "$path" -Args "-all" -RSO cout -RSE cerr;
$ended = Get-Date
$millisec = ($ended - $started).ticks
$millisec = ($ended - $started).totalmilliseconds
gc cout; gc cerr;
if ($process.ExitCode -gt 0)
{
if ($process.ExitCode -gt 0) {
$fails += 1;$failedTests += $component + ', ';
Add-AppveyorTest -Framework 'CppUnit' -Name $component -Outcome 'Failed' -Duration $millisec
}
else
{
} else {
Add-AppveyorTest -Framework 'CppUnit' -Name $component -Outcome 'Passed' -Duration $millisec
}
}
}
else
{
Add-AppveyorTest -Framework 'CppUnit' -Name $component -Outcome 'Skipped'
} else {
Add-AppveyorTest -Framework 'CppUnit' -Name $component -Outcome 'NotFound'
}
} else {
Add-AppveyorTest -Framework 'CppUnit' -Name $component -Outcome 'Skipped'
}
}
}
if ($env:builder -eq "cmake" -and $env:platform -eq "Win32")
{
pushd cmake-build;
Write-Host -ForegroundColor Yellow $line;
ctest -N
Write-Host -ForegroundColor Yellow $line;
Write-Host -ForegroundColor Yellow 'ctest -VV -E Data*'
ctest -VV -E Data*
popd
}
Write-Host $runs' runs, ' $fails' fails'
if ($fails -gt 0)
@ -242,15 +428,7 @@ notifications:
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: