diff --git a/.gitignore b/.gitignore index 284f903cf..6d1f1e024 100644 --- a/.gitignore +++ b/.gitignore @@ -121,7 +121,8 @@ XSD stage/ releases/ Zip/testsuite/data*.bin - +Foundation/testsuite/globtest/ +TestConfiguration/ # openssl binaries # #################### @@ -134,6 +135,7 @@ openssl/packages/ !openssl/win32/bin/debug/*.lib !openssl/win32/bin/release/*.dll !openssl/win32/bin/release/*.lib + !openssl/win64/bin/debug/*.dll !openssl/win64/bin/debug/*.lib !openssl/win64/bin/release/*.dll @@ -142,6 +144,8 @@ openssl/packages/ !openssl/win32/lib/debug/*.lib !openssl/win32/lib/debug/*.pdb !openssl/win32/lib/release/*.lib + !openssl/win64/lib/debug/*.lib !openssl/win64/lib/debug/*.pdb !openssl/win64/lib/release/*.lib + diff --git a/.travis.yml b/.travis.yml index 208654e29..562133463 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,8 @@ before_install: # - sudo add-apt-repository -y ppa:andykimpe/cmake3 # linux prereqisite packages - if [ "$TRAVIS_OS_NAME" == "linux" ]; then wget --no-check-certificate https://www.cmake.org/files/v3.2/cmake-3.2.3-Linux-x86_64.tar.gz; fi - - if [ "$TRAVIS_OS_NAME" == "linux" ]; then tar -xzvf cmake-3.2.3-Linux-x86_64.tar.gz; fi - - if [ "$TRAVIS_OS_NAME" == "linux" ]; then export PATH=$PWD/cmake-3.2.3-Linux-x86_64/bin:$PATH; fi + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then tar -xzf cmake-3.2.3-Linux-x86_64.tar.gz -C ..; fi + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then export PATH=$PWD/../cmake-3.2.3-Linux-x86_64/bin:$PATH; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y unixodbc-dev libmysqlclient-dev libsqlite3-dev; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y g++-arm-linux-gnueabi g++-arm-linux-gnueabihf clang-3.5; fi @@ -19,6 +19,7 @@ before_install: services: - mongodb - redis-server + - mysql notifications: slack: @@ -39,7 +40,10 @@ matrix: compiler: clang os: osx script: - - ./configure --everything --omit=Data/ODBC,Data/MySQL,Data/SQLite && make install -s -j2 + - ./configure --everything --omit=Data/ODBC,Data/MySQL,Data/SQLite + - cat config.* + - make install -j2 + - find . -name "*testrunner*" - ./travis/runtests.sh - env: TEST_NAME="Linux gcc (make) bundled" diff --git a/CppUnit/include/CppUnit/TestCaller.h b/CppUnit/include/CppUnit/TestCaller.h index 0a4a8db87..1c555939d 100644 --- a/CppUnit/include/CppUnit/TestCaller.h +++ b/CppUnit/include/CppUnit/TestCaller.h @@ -62,6 +62,14 @@ public: _fixture(new Fixture(name)) { } + + // Returns the name of the test case instance + virtual std::string toString() + { + const std::type_info& thisClass = typeid(*this); + return std::string(thisClass.name()) + "." + name(); + } + protected: void runTest() diff --git a/CppUnit/include/CppUnit/TestCase.h b/CppUnit/include/CppUnit/TestCase.h index 1811d428d..60b07b811 100644 --- a/CppUnit/include/CppUnit/TestCase.h +++ b/CppUnit/include/CppUnit/TestCase.h @@ -95,7 +95,7 @@ public: virtual TestResult* run(); virtual int countTestCases(); const std::string& name() const; - std::string toString(); + virtual std::string toString(); virtual void setUp(); virtual void tearDown(); @@ -167,7 +167,7 @@ protected: const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); -private: +protected: const std::string _name; }; diff --git a/CppUnit/src/TextTestResult.cpp b/CppUnit/src/TextTestResult.cpp index b77318941..25d74c65f 100644 --- a/CppUnit/src/TextTestResult.cpp +++ b/CppUnit/src/TextTestResult.cpp @@ -43,9 +43,10 @@ void TextTestResult::setup() std::string::const_iterator end = ignored.end(); while (it != end) { - while (it != end && std::isspace(*it)) ++it; + while (it != end && (std::isspace(*it) || *it == '"')) ++it; std::string test; - while (it != end && !std::isspace(*it)) test += *it++; + while (it != end && *it != ',' && *it != '"') test += *it++; + if (it != end && (*it == ',' || *it == '"')) ++it; if (!test.empty()) _ignored.insert(test); } } diff --git a/NetSSL_OpenSSL/testsuite/src/HTTPSClientSessionTest.cpp b/NetSSL_OpenSSL/testsuite/src/HTTPSClientSessionTest.cpp index f8e48f7d9..7f0508cc0 100644 --- a/NetSSL_OpenSSL/testsuite/src/HTTPSClientSessionTest.cpp +++ b/NetSSL_OpenSSL/testsuite/src/HTTPSClientSessionTest.cpp @@ -38,6 +38,7 @@ #include #include #include +#include using namespace Poco::Net; @@ -306,22 +307,27 @@ void HTTPSClientSessionTest::testInterop() void HTTPSClientSessionTest::testProxy() { - 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"); + 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; + } } @@ -477,8 +483,8 @@ CppUnit::Test* HTTPSClientSessionTest::suite() should use a public proxy server http://www.publicproxyservers.com/proxy/list1.html Really working public proxy servers - page 1 of 6. - CppUnit_addTest(pSuite, HTTPSClientSessionTest, testProxy); #endif + CppUnit_addTest(pSuite, HTTPSClientSessionTest, testProxy); CppUnit_addTest(pSuite, HTTPSClientSessionTest, testCachedSession); CppUnit_addTest(pSuite, HTTPSClientSessionTest, testUnknownContentLength); CppUnit_addTest(pSuite, HTTPSClientSessionTest, testServerAbort); diff --git a/NetSSL_OpenSSL/testsuite/src/HTTPSStreamFactoryTest.cpp b/NetSSL_OpenSSL/testsuite/src/HTTPSStreamFactoryTest.cpp index 7b62a7b14..91dee0a4c 100644 --- a/NetSSL_OpenSSL/testsuite/src/HTTPSStreamFactoryTest.cpp +++ b/NetSSL_OpenSSL/testsuite/src/HTTPSStreamFactoryTest.cpp @@ -21,6 +21,7 @@ #include "Poco/Exception.h" #include "Poco/StreamCopier.h" #include "HTTPSTestServer.h" +#include #include #include @@ -84,16 +85,21 @@ void HTTPSStreamFactoryTest::testRedirect() void HTTPSStreamFactoryTest::testProxy() { - 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 pStr(factory.open(uri)); - std::ostringstream ostr; - StreamCopier::copyStream(*pStr.get(), ostr); - assert (ostr.str().length() > 0); + 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 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; + } } @@ -136,8 +142,8 @@ CppUnit::Test* HTTPSStreamFactoryTest::suite() should use a public proxy server http://www.publicproxyservers.com/proxy/list1.html Really working public proxy servers - page 1 of 6. - CppUnit_addTest(pSuite, HTTPSStreamFactoryTest, testProxy); #endif + CppUnit_addTest(pSuite, HTTPSStreamFactoryTest, testProxy); CppUnit_addTest(pSuite, HTTPSStreamFactoryTest, testError); return pSuite; diff --git a/NetSSL_Win/testsuite/TestSuite.xml b/NetSSL_Win/testsuite/TestSuite.xml index 8f78c9490..250c7e52a 100644 --- a/NetSSL_Win/testsuite/TestSuite.xml +++ b/NetSSL_Win/testsuite/TestSuite.xml @@ -1,7 +1,7 @@ - any.pfx + ${application.configDir}any.pfx none false @@ -34,8 +34,8 @@ - proxy.aon.at - 8080 - + freeproxyserver.net + 80 + diff --git a/NetSSL_Win/testsuite/TestSuitemt.xml b/NetSSL_Win/testsuite/TestSuitemt.xml index 2c03eb7be..0b8c9c3f2 100644 --- a/NetSSL_Win/testsuite/TestSuitemt.xml +++ b/NetSSL_Win/testsuite/TestSuitemt.xml @@ -22,8 +22,8 @@ - proxy.aon.at - 8080 + freeproxyserver.net + 80 diff --git a/NetSSL_Win/testsuite/src/HTTPSClientSessionTest.cpp b/NetSSL_Win/testsuite/src/HTTPSClientSessionTest.cpp index 64eb7f4be..0e2fb1df3 100644 --- a/NetSSL_Win/testsuite/src/HTTPSClientSessionTest.cpp +++ b/NetSSL_Win/testsuite/src/HTTPSClientSessionTest.cpp @@ -37,6 +37,7 @@ #include #include #include +#include using namespace Poco::Net; @@ -313,22 +314,27 @@ void HTTPSClientSessionTest::testInterop() void HTTPSClientSessionTest::testProxy() { - 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"); + 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; + } } diff --git a/NetSSL_Win/testsuite/src/HTTPSStreamFactoryTest.cpp b/NetSSL_Win/testsuite/src/HTTPSStreamFactoryTest.cpp index 6357eacfc..bfb96a93b 100644 --- a/NetSSL_Win/testsuite/src/HTTPSStreamFactoryTest.cpp +++ b/NetSSL_Win/testsuite/src/HTTPSStreamFactoryTest.cpp @@ -21,6 +21,7 @@ #include "Poco/Exception.h" #include "Poco/StreamCopier.h" #include "HTTPSTestServer.h" +#include #include #include @@ -84,16 +85,21 @@ void HTTPSStreamFactoryTest::testRedirect() void HTTPSStreamFactoryTest::testProxy() { - 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 pStr(factory.open(uri)); - std::ostringstream ostr; - StreamCopier::copyStream(*pStr.get(), ostr); - assert (ostr.str().length() > 0); + 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 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; + } } diff --git a/NetSSL_Win/testsuite/testrunner.xml b/NetSSL_Win/testsuite/testrunner.xml index 8f78c9490..250c7e52a 100644 --- a/NetSSL_Win/testsuite/testrunner.xml +++ b/NetSSL_Win/testsuite/testrunner.xml @@ -1,7 +1,7 @@ - any.pfx + ${application.configDir}any.pfx none false @@ -34,8 +34,8 @@ - proxy.aon.at - 8080 - + freeproxyserver.net + 80 + diff --git a/Zip/testsuite/src/CompressTest.cpp b/Zip/testsuite/src/CompressTest.cpp index 62102b8c1..d52124ce4 100644 --- a/Zip/testsuite/src/CompressTest.cpp +++ b/Zip/testsuite/src/CompressTest.cpp @@ -161,9 +161,9 @@ void CompressTest::testZip64() { std::cout << std::endl; std::map files; - files["data1.bin"] = static_cast(MB)*4096+1; - files["data2.bin"] = static_cast(MB)*16; - files["data3.bin"] = static_cast(MB)*4096-1; + files["data1.bin"] = static_cast(KB)*4096+1; + files["data2.bin"] = static_cast(KB)*16; + files["data3.bin"] = static_cast(KB)*4096-1; for(std::map::const_iterator it = files.begin(); it != files.end(); it++) { diff --git a/Zip/testsuite/src/CompressTest.h b/Zip/testsuite/src/CompressTest.h index 0d24921a7..2a7cba5a4 100644 --- a/Zip/testsuite/src/CompressTest.h +++ b/Zip/testsuite/src/CompressTest.h @@ -33,7 +33,8 @@ public: void testManipulatorReplace(); void testSetZipComment(); - static const Poco::UInt64 MB = (1024*1024); + static const Poco::UInt64 KB = 1024; + static const Poco::UInt64 MB = 1024*KB; void createDataFile(const std::string& path, Poco::UInt64 size); void testZip64(); diff --git a/Zip/testsuite/src/ZipTest.cpp b/Zip/testsuite/src/ZipTest.cpp index e56c61bc6..c73b5568c 100644 --- a/Zip/testsuite/src/ZipTest.cpp +++ b/Zip/testsuite/src/ZipTest.cpp @@ -211,9 +211,9 @@ void ZipTest::verifyDataFile(const std::string& path, Poco::UInt64 size) void ZipTest::testDecompressZip64() { std::map files; - files["data1.bin"] = static_cast(MB)*4096+1; - files["data2.bin"] = static_cast(MB)*16; - files["data3.bin"] = static_cast(MB)*4096-1; + files["data1.bin"] = static_cast(KB)*4096+1; + files["data2.bin"] = static_cast(KB)*16; + files["data3.bin"] = static_cast(KB)*4096-1; for(std::map::const_iterator it = files.begin(); it != files.end(); it++) { diff --git a/Zip/testsuite/src/ZipTest.h b/Zip/testsuite/src/ZipTest.h index 180b8ed53..caf2fd30d 100644 --- a/Zip/testsuite/src/ZipTest.h +++ b/Zip/testsuite/src/ZipTest.h @@ -36,7 +36,8 @@ public: void testDecompressFlat(); - static const Poco::UInt64 MB = (1024*1024); + static const Poco::UInt64 KB = 1024; + static const Poco::UInt64 MB = 1024*KB; void verifyDataFile(const std::string& path, Poco::UInt64 size); void testDecompressZip64(); diff --git a/appveyor.yml b/appveyor.yml index 0e516162f..e9bc36af3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,19 +1,23 @@ -version: '{build}' +version: poco-1.7.0 {branch}-{build} cache: - - c:\OpenSSL-Win32 - - c:\OpenSSL-Win64 - - c:\ProgramData\chocolatey - c:\mysql-5.7.9-win32 +hosts: + localhost: 127.0.0.1 + db.server.com: 127.0.0.2 + services: - - mysql +# - mysql - mongodb - - mssql2014 +platform: + - Win32 + - x64 + configuration: - - Release - - Debug + - release + - debug install: - systeminfo @@ -21,64 +25,210 @@ install: - c:\cygwin\bin\cat /proc/cpuinfo - c:\cygwin\bin\cat /proc/meminfo - set - - cinst cmake - - ps: | - if (Test-Path "c:\OpenSSL-$env:ssl") - { - echo "using openssl from cache" - } - else - { - echo "downloading openssl" - Invoke-WebRequest "https://slproweb.com/download/$($env:ssl)OpenSSL-$($env:openssl).exe" -OutFile c:\openssl-setup.exe - echo "installing openssl" - Start-Process -Wait -FilePath c:\openssl-setup.exe -ArgumentList "/silent /verysilent /sp- /suppressmsgboxes" - } -# chocolatey brokes jom, here's workaround -# see https://github.com/jcfr/qt-easy-build/commit/6366f4275562bdaf4f686838600f46894579c41e) +# MySQL 32 bit is not available by default on AppVeyor - ps: | - if ($env:builder -eq "cmake") + if ($env:platform -eq "Win32") { - $env:PATH = $env:ChocolateyInstall + "\bin" + ";" + $env:PATH - $env:PATH = $env:ChocolateyInstall + "\lib\jom\content" + ";" + $env:PATH + 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:\ + } } environment: bundling: bundled - openssl: 1_0_2e + logger: 'C:\Progra~1\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll' + samples: samples + tests: tests + verbosity: minimal matrix: - - builder: cmake - ssl: Win32 - vc: amd64_x86 - target: x86 - + - builder: 120 + linkmode: shared + +# - builder: 120 +# linkmode: static_md + +# - builder: 120 +# linkmode: static_mt + + - builder: 140 + linkmode: shared + +# - builder: 140 +# linkmode: static_md + +# - builder: 140 +# linkmode: static_mt + + +matrix: + fast_finish: true + + before_build: + - 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: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 + } + } + +# 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: - - set PATH=C:\ProgramData\chocolatey\bin;%PATH% - - mkdir cmake-build - - cd cmake-build - - cmake .. -G "Visual Studio 12 2013" -DENABLE_DATA_MYSQL=OFF -DENABLE_REDIS=OFF -DENABLE_TESTS=ON - - cmake --build . --config %configuration% -- /nologo /v:minimal - - + - buildwin %builder% build %linkmode% %configuration% %platform% %samples% %tests% msbuild %verbosity% %logger% + + before_test: + - set PATH=%CD%\bin;%PATH% + - set PATH=%CD%\bin64;%PATH% + - set CPPUNIT_IGNORE="class CppUnit::TestCaller.testTimeSync" + - set POCO_BASE=%CD% after_test: test_script: -# - set PATH=%CD%\cmake-build\bin\Release;%PATH% -# - set EXCLUDE_TESTS=Crypto,NetSLL_Win,Data/ODBC,Data/MySQL -# - build\script\runtests2.cmd - - ctest -VV -C %configuration% -E "Data*" + - 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) + { + [string]$path = $component + "\testsuite\bin$suffix\TestSuite.exe"; - - -on_success: + 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 $line; + + $started = Get-Date + $process = Start-Process -PassThru -NoNewWindow -Wait -FilePath "$path" -Args "-all" -RSO "cout" -RSE "cerr"; + $ended = Get-Date + $millisec = ($ended - $started).ticks + + 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: @@ -87,7 +237,6 @@ on_failure: on_finish: - echo finish - notifications: - provider: Email on_build_success: false @@ -100,8 +249,15 @@ notifications: secure: xoOlP1UHshqjvh/INwMcNhZ5UHsTVKLGY5maTSjaxDc0fvRwoWIdYvY/CofQEuy2wOIBQK4eLD+tA0xG78ZgqQ== channel: poco on_build_success: false - on_build_status_changed: false + on_build_status_changed: true - provider: Slack incoming_webhook: https://hooks.slack.com/services/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 - \ No newline at end of file + auth_token: + secure: Xsss/K3VV9wZI9Ffwvafa67kyohNA437xJ3WA9fVI4w= + channel: appveyor + on_build_success: false + on_build_failure: true + on_build_status_changed: true + + diff --git a/build/script/runtests2.cmd b/build/script/runtests2.cmd index fae591ede..283b715d9 100644 --- a/build/script/runtests2.cmd +++ b/build/script/runtests2.cmd @@ -25,7 +25,7 @@ if "%1"=="64" ( shift ) if "%1" =="-d" ( - set SUFFIX=d + set DEBUG=d shift ) @@ -36,7 +36,7 @@ if not "%1" == "" ( ) ) -set TESTRUNNER=TestSuite%SUFFIX%.exe +set TESTRUNNER=TestSuite%DEBUG%.exe set runs=0 set failures=0 diff --git a/buildwin.cmd b/buildwin.cmd index 81385767c..154b5586d 100644 --- a/buildwin.cmd +++ b/buildwin.cmd @@ -17,7 +17,7 @@ rem Modified by Guenter Obiltschnig. rem rem Usage: rem ------ -rem buildwin VS_VERSION [ACTION] [LINKMODE] [CONFIGURATION] [PLATFORM] [SAMPLES] [TESTS] [TOOL] +rem buildwin VS_VERSION [ACTION] [LINKMODE] [CONFIGURATION] [PLATFORM] [SAMPLES] [TESTS] [TOOL [VERBOSITY [LOGGER] ] ] rem VS_VERSION: 90|100|110|120|140 rem ACTION: build|rebuild|clean rem LINKMODE: static_mt|static_md|shared|all @@ -26,6 +26,8 @@ rem PLATFORM: Win32|x64|WinCE|WEC2013 rem SAMPLES: samples|nosamples rem TESTS: tests|notests rem TOOL: devenv|vcexpress|wdexpress|msbuild +rem VERBOSITY quiet|minimal|normal|detailed|diagnostic +rem LOGGER see msbuild /? rem rem VS_VERSION is required argument. Default is build all. @@ -43,9 +45,10 @@ rem VS_VERSION {90 | 100 | 110 | 120 | 140} if "%1"=="" goto usage set VS_VERSION=vs%1 set VS_64_BIT_ENV=VC\bin\x86_amd64\vcvarsx86_amd64.bat +shift /1 rem PLATFORM [Win32|x64|WinCE|WEC2013] -set PLATFORM=%5 +set PLATFORM=%4 if "%PLATFORM%"=="" (set PLATFORM=Win32) if not "%PLATFORM%"=="Win32" ( if not "%PLATFORM%"=="x64" ( @@ -101,14 +104,26 @@ if not defined VSINSTALLDIR ( goto :EOF ) +rem VERBOSITY quiet|minimal|normal|detailed +set VERBOSITY=%8 +if "%VERBOSITY%"=="" (set VERBOSITY=minimal) +if not "%VERBOSITY%"=="quiet" ( +if not "%VERBOSITY%"=="minimal" ( +if not "%VERBOSITY%"=="normal" ( +if not "%VERBOSITY%"=="detailed" ( +if not "%VERBOSITY%"=="diagnostic" goto usage)))) + +rem LOGGER see msbuild /? +set LOGGER=%9 + set VCPROJ_EXT=vcproj if %VS_VERSION%==vs100 (set VCPROJ_EXT=vcxproj) if %VS_VERSION%==vs110 (set VCPROJ_EXT=vcxproj) if %VS_VERSION%==vs120 (set VCPROJ_EXT=vcxproj) if %VS_VERSION%==vs140 (set VCPROJ_EXT=vcxproj) -if "%8"=="" goto use_devenv -set BUILD_TOOL=%8 +if "%7"=="" goto use_devenv +set BUILD_TOOL=%7 goto use_custom :use_devenv set BUILD_TOOL=devenv @@ -123,7 +138,12 @@ if "%BUILD_TOOL%"=="msbuild" ( set CONFIGSW=/p:Configuration= set EXTRASW=/m set USEENV=/p:UseEnv=true - set BUILD_TOOL_FLAGS=/clp:NoSummary /nologo /v:minimal + + set BUILD_TOOL_FLAGS=/clp:NoSummary + set BUILD_TOOL_FLAGS=!BUILD_TOOL_FLAGS! /nologo /v:%VERBOSITY% + if not %LOGGER%X==X ( + set BUILD_TOOL_FLAGS=!BUILD_TOOL_FLAGS! /logger:%LOGGER% + ) ) if not "%BUILD_TOOL%"=="msbuild" ( set ACTIONSW=/ @@ -139,14 +159,14 @@ if "%BUILD_TOOL%"=="msbuild" ( :msbuildok rem ACTION [build|rebuild|clean] -set ACTION=%2 +set ACTION=%1 if "%ACTION%"=="" (set ACTION=build) if not "%ACTION%"=="build" ( if not "%ACTION%"=="rebuild" ( if not "%ACTION%"=="clean" goto usage)) rem LINKMODE [static_mt|static_md|shared|all] -set LINK_MODE=%3 +set LINK_MODE=%2 if "%LINK_MODE%"=="" (set LINK_MODE=all) if not "%LINK_MODE%"=="static_mt" ( if not "%LINK_MODE%"=="static_md" ( @@ -154,7 +174,7 @@ if not "%LINK_MODE%"=="shared" ( if not "%LINK_MODE%"=="all" goto usage))) rem CONFIGURATION [release|debug|both] -set CONFIGURATION=%4 +set CONFIGURATION=%3 if "%CONFIGURATION%"=="" (set CONFIGURATION=both) if not "%CONFIGURATION%"=="release" ( if not "%CONFIGURATION%"=="debug" ( @@ -178,11 +198,11 @@ if %VS_VERSION%==vs140 (set EXTRASW=/m /p:VisualStudioVersion=14.0) ) rem SAMPLES [samples|nosamples] -set SAMPLES=%6 +set SAMPLES=%5 if "%SAMPLES%"=="" (set SAMPLES=samples) rem TESTS [tests|notests] -set TESTS=%7 +set TESTS=%6 if "%TESTS%"=="" (set TESTS=notests) @@ -280,6 +300,8 @@ echo #### echo ######################################################################## echo. echo. +echo buildwin %VS_VERSION% %ACTION% %LINK_MODE% %CONFIGURATION% %PLATFORM% %SAMPLES% %TESTS% !BUILD_TOOL! %VERBOSITY% +echo. echo The following configurations will be built: if %DEBUG_SHARED%==1 (echo debug_shared) @@ -547,7 +569,7 @@ exit /b 1 :usage echo Usage: echo ------ -echo buildwin VS_VERSION [ACTION] [LINKMODE] [CONFIGURATION] [PLATFORM] [SAMPLES] [TESTS] [TOOL] +echo buildwin VS_VERSION [ACTION] [LINKMODE] [CONFIGURATION] [PLATFORM] [SAMPLES] [TESTS] [TOOL [VERBOSITY] ] echo VS_VERSION: "90|100|110|120|140" echo ACTION: "build|rebuild|clean" echo LINKMODE: "static_mt|static_md|shared|all" @@ -556,6 +578,7 @@ echo PLATFORM: "Win32|x64|WinCE|WEC2013" echo SAMPLES: "samples|nosamples" echo TESTS: "tests|notests" echo TOOL: "devenv|vcexpress|wdexpress|msbuild" +echo VERBOSITY: "quiet|minimal|normal|detailed|diagnostic" only for msbuild echo. echo Default is build all. endlocal diff --git a/components b/components index 28ab43383..a415f7da3 100644 --- a/components +++ b/components @@ -11,7 +11,7 @@ NetSSL_Win Data Data/SQLite Data/ODBC -#Data/MySQL +Data/MySQL Zip PageCompiler PageCompiler/File2Page diff --git a/travis/runtests.sh b/travis/runtests.sh index 92204ec77..05b69b0bc 100755 --- a/travis/runtests.sh +++ b/travis/runtests.sh @@ -2,16 +2,16 @@ trap -p set -ev export POCO_BASE=`pwd` export CPPUNIT_IGNORE="\ - N7CppUnit10TestCallerI8PathTestEE.testExpand \ - N7CppUnit10TestCallerI13RawSocketTestEE.testEchoIPv4 \ - N7CppUnit10TestCallerI13RawSocketTestEE.testSendToReceiveFromIPv4 \ - N7CppUnit10TestCallerI14ICMPClientTestEE.testPing \ - N7CppUnit10TestCallerI22HTTPSClientSessionTestEE.testProxy \ - N7CppUnit10TestCallerI22HTTPSStreamFactoryTestEE.testProxy \ - N7CppUnit10TestCallerI19MulticastSocketTestEE.testMulticast \ - N7CppUnit10TestCallerI13NTPClientTestEE.testTimeSync \ - N7CppUnit10TestCallerI12CompressTestEE.testZip64" -export EXCLUDE_TESTS="Data/MySQL Data/ODBC MongoDB PDF" + N7CppUnit10TestCallerI8PathTestEE.testExpand, \ + N7CppUnit10TestCallerI13RawSocketTestEE.testEchoIPv4, \ + N7CppUnit10TestCallerI13RawSocketTestEE.testSendToReceiveFromIPv4, \ + N7CppUnit10TestCallerI14ICMPClientTestEE.testPing, \ + N7CppUnit10TestCallerI22HTTPSClientSessionTestEE.testProxy, \ + N7CppUnit10TestCallerI22HTTPSStreamFactoryTestEE.testProxy, \ + N7CppUnit10TestCallerI19MulticastSocketTestEE.testMulticast, \ + N7CppUnit10TestCallerI13NTPClientTestEE.testTimeSync" + +export EXCLUDE_TESTS="Data/MySQL Data/ODBC PDF" export PATH=$PATH:. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. build/script/runtests.sh