diff --git a/CppUnit/include/Poco/CppUnit/CppUnitException.h b/CppUnit/include/Poco/CppUnit/CppUnitException.h index 670290c58..46fc44bbd 100644 --- a/CppUnit/include/Poco/CppUnit/CppUnitException.h +++ b/CppUnit/include/Poco/CppUnit/CppUnitException.h @@ -68,17 +68,17 @@ inline CppUnitException::CppUnitException(const CppUnitException& other): except } -inline CppUnitException::CppUnitException (const std::string& message, long lineNumber, const std::string& fileName): _message(message), _lineNumber(lineNumber), _data1lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _data2lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _fileName(fileName) +inline CppUnitException::CppUnitException (const std::string& message, long line, const std::string& rFileName): _message(message), _lineNumber(line), _data1lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _data2lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _fileName(rFileName) { } -inline CppUnitException::CppUnitException (const std::string& message, long lineNumber, long data1lineNumber, const std::string& fileName): _message(message), _lineNumber(lineNumber), _data1lineNumber(data1lineNumber), _data2lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _fileName(fileName) +inline CppUnitException::CppUnitException (const std::string& message, long line, long data1lineNumber, const std::string& rFileName): _message(message), _lineNumber(line), _data1lineNumber(data1lineNumber), _data2lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _fileName(rFileName) { } -inline CppUnitException::CppUnitException (const std::string& message, long lineNumber, long data1lineNumber, long data2lineNumber, const std::string& fileName): _message(message), _lineNumber(lineNumber), _data1lineNumber(data1lineNumber), _data2lineNumber(data2lineNumber), _fileName(fileName) +inline CppUnitException::CppUnitException (const std::string& message, long line, long data1lineNumber, long data2lineNumber, const std::string& rFileName): _message(message), _lineNumber(line), _data1lineNumber(data1lineNumber), _data2lineNumber(data2lineNumber), _fileName(rFileName) { } diff --git a/CppUnit/include/Poco/CppUnit/TestCaller.h b/CppUnit/include/Poco/CppUnit/TestCaller.h index d859bb7ce..cfafaa2ce 100644 --- a/CppUnit/include/Poco/CppUnit/TestCaller.h +++ b/CppUnit/include/Poco/CppUnit/TestCaller.h @@ -56,10 +56,10 @@ class TestCaller: public TestCase typedef void (Fixture::*TestMethod)(); public: - TestCaller(const std::string& name, TestMethod test): - TestCase(name), + TestCaller(const std::string& rName, TestMethod test): + TestCase(rName), _test(test), - _fixture(new Fixture(name)) + _fixture(new Fixture(rName)) { } diff --git a/CppUnit/include/Poco/CppUnit/TestCase.h b/CppUnit/include/Poco/CppUnit/TestCase.h index cbe648a57..b1ede419f 100644 --- a/CppUnit/include/Poco/CppUnit/TestCase.h +++ b/CppUnit/include/Poco/CppUnit/TestCase.h @@ -173,7 +173,7 @@ protected: // Constructs a test case -inline TestCase::TestCase(const std::string& name): _name (name) +inline TestCase::TestCase(const std::string& rName): _name (rName) { } diff --git a/CppUnit/include/Poco/CppUnit/TestFailure.h b/CppUnit/include/Poco/CppUnit/TestFailure.h index 830dec1c8..eb391a6bb 100644 --- a/CppUnit/include/Poco/CppUnit/TestFailure.h +++ b/CppUnit/include/Poco/CppUnit/TestFailure.h @@ -52,7 +52,7 @@ protected: // Constructs a TestFailure with the given test and exception. -inline TestFailure::TestFailure(Test* failedTest, CppUnitException* thrownException): _failedTest(failedTest), _thrownException(thrownException) +inline TestFailure::TestFailure(Test* pFailedTest, CppUnitException* pThrownException): _failedTest(pFailedTest), _thrownException(pThrownException) { } diff --git a/Data/src/RecordSet.cpp b/Data/src/RecordSet.cpp index e3788706d..b630a3153 100644 --- a/Data/src/RecordSet.cpp +++ b/Data/src/RecordSet.cpp @@ -103,8 +103,8 @@ void RecordSet::reset(const Statement& stmt) _totalRowCount = UNKNOWN_TOTAL_ROW_COUNT; RowMap::iterator it = _rowMap.begin(); - RowMap::iterator itEnd = _rowMap.end(); - for (; it != itEnd; ++it) delete it->second; + RowMap::iterator end = _rowMap.end(); + for (; it != end; ++it) delete it->second; _rowMap.clear(); Statement::operator = (stmt); diff --git a/Foundation/src/DirectoryIteratorStrategy.cpp b/Foundation/src/DirectoryIteratorStrategy.cpp index 6823354c1..44699239d 100644 --- a/Foundation/src/DirectoryIteratorStrategy.cpp +++ b/Foundation/src/DirectoryIteratorStrategy.cpp @@ -72,12 +72,19 @@ const std::string ChildrenFirstTraverse::next(Stack* itStack, bool* isFinished) bool isDepthLimitReached = isFiniteDepth() && _depthDeterminer(*itStack) >= _maxDepth; if (!isDepthLimitReached && isDirectory(*itStack->top())) { - DirectoryIterator child_it(itStack->top().path()); - // check if directory is empty - if (child_it != _itEnd) + // check the dir is iterable + try + { + DirectoryIterator child_it(itStack->top().path()); + // check if directory is empty + if (child_it != _itEnd) + { + itStack->push(child_it); + return child_it->path(); + } + } + catch (...) { - itStack->push(child_it); - return child_it->path(); } } @@ -140,7 +147,17 @@ const std::string SiblingsFirstTraverse::next(Stack* itStack, bool* isFinished) { std::string dir = _dirsStack.top().front(); _dirsStack.top().pop(); - DirectoryIterator child_it(dir); + DirectoryIterator child_it; + + // check the dir is iterable + try + { + child_it = dir; + } + catch (...) + { + continue; + } // check if directory is empty if (child_it != _itEnd) diff --git a/Zip/src/Compress.cpp b/Zip/src/Compress.cpp index b335a3074..ed558d771 100644 --- a/Zip/src/Compress.cpp +++ b/Zip/src/Compress.cpp @@ -155,8 +155,8 @@ void Compress::addFileRaw(std::istream& in, const ZipLocalFileHeader& h, const P if(hdr.hasExtraField()) // Update sizes in header extension. hdr.setZip64Data(); _out.seekp(hdr.getStartPos(), std::ios_base::beg); - std::string header = hdr.createHeader(); - _out.write(header.c_str(), static_cast(header.size())); + std::string headerString = hdr.createHeader(); + _out.write(headerString.c_str(), static_cast(headerString.size())); _out.seekp(0, std::ios_base::end); } @@ -273,8 +273,8 @@ void Compress::addRecursive(const Poco::Path& entry, ZipCommon::CompressionMetho { Poco::Path realFile(entry, *it); Poco::Path renamedFile(aName, *it); - Poco::File aFile(realFile); - if (aFile.isDirectory()) + Poco::File file(realFile); + if (file.isDirectory()) { realFile.makeDirectory(); renamedFile.makeDirectory(); diff --git a/Zip/src/ZipLocalFileHeader.cpp b/Zip/src/ZipLocalFileHeader.cpp index 64dae2b90..805f60d42 100644 --- a/Zip/src/ZipLocalFileHeader.cpp +++ b/Zip/src/ZipLocalFileHeader.cpp @@ -31,7 +31,7 @@ const char ZipLocalFileHeader::HEADER[ZipCommon::HEADER_SIZE] = {'\x50', '\x4b', ZipLocalFileHeader::ZipLocalFileHeader(const Poco::Path& fileName, - const Poco::DateTime& lastModifiedAt, + const Poco::DateTime& lastModified, ZipCommon::CompressionMethod cm, ZipCommon::CompressionLevel cl, bool forceZip64): @@ -62,7 +62,7 @@ ZipLocalFileHeader::ZipLocalFileHeader(const Poco::Path& fileName, setHostSystem(hs); setEncryption(false); setExtraFieldSize(0); - setLastModifiedAt(lastModifiedAt); + setLastModifiedAt(lastModified); init(fileName, cm, cl); } @@ -197,12 +197,12 @@ bool ZipLocalFileHeader::searchCRCAndSizesAfterData() const } -void ZipLocalFileHeader::setFileName(const std::string& fileName, bool isDirectory) +void ZipLocalFileHeader::setFileName(const std::string& fileName, bool directory) { poco_assert (!fileName.empty()); Poco::Path aPath(fileName); - if (isDirectory) + if (directory) { aPath.makeDirectory(); setCRC(0); @@ -218,7 +218,7 @@ void ZipLocalFileHeader::setFileName(const std::string& fileName, bool isDirecto _fileName = aPath.toString(Poco::Path::PATH_UNIX); if (_fileName[0] == '/') _fileName = _fileName.substr(1); - if (isDirectory) + if (directory) { poco_assert_dbg (_fileName[_fileName.size()-1] == '/'); } diff --git a/Zip/testsuite/src/CompressTest.cpp b/Zip/testsuite/src/CompressTest.cpp index d14a4a959..664c1cf3b 100644 --- a/Zip/testsuite/src/CompressTest.cpp +++ b/Zip/testsuite/src/CompressTest.cpp @@ -28,7 +28,7 @@ using namespace Poco::Zip; -CompressTest::CompressTest(const std::string& name): CppUnit::TestCase(name) +CompressTest::CompressTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Zip/testsuite/src/PartialStreamTest.cpp b/Zip/testsuite/src/PartialStreamTest.cpp index 619472306..336ab12cb 100644 --- a/Zip/testsuite/src/PartialStreamTest.cpp +++ b/Zip/testsuite/src/PartialStreamTest.cpp @@ -20,7 +20,7 @@ using namespace Poco::Zip; -PartialStreamTest::PartialStreamTest(const std::string& name): CppUnit::TestCase(name) +PartialStreamTest::PartialStreamTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Zip/testsuite/src/ZipTest.cpp b/Zip/testsuite/src/ZipTest.cpp index 5ef109286..e697290bb 100644 --- a/Zip/testsuite/src/ZipTest.cpp +++ b/Zip/testsuite/src/ZipTest.cpp @@ -35,7 +35,7 @@ using namespace Poco::Zip; -ZipTest::ZipTest(const std::string& name): CppUnit::TestCase(name) +ZipTest::ZipTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/appveyor.yml b/appveyor.yml index e79fee5ff..3dbdaae3e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,7 +6,17 @@ cache: - C:\OpenSSL-Win32 - C:\OpenSSL-Win64 - C:\Program Files (x86)\PostgreSQL\9.4 - + + +branches: + except: + - /.*ravis.*/ + + +skip_commits: + message: /Merge pull request.*/ + + hosts: localhost: 127.0.0.1 db.server.com: 127.0.0.2 @@ -48,6 +58,8 @@ environment: matrix: + - builder: cygwin + - builder: msbuild vsver: 120 linkmode: shared @@ -91,11 +103,28 @@ matrix: fast_finish: true install: + - C:\cygwin\setup-x86.exe -qnNdO -R C:/cygwin -s http://cygwin.mirror.constant.com -l C:/cygwin/var/cache/setup -P openssl-devel -P libiodbc-devel -P libiodbc2 -P odbc-mysql -P odbc-pgsql -P odbc-sqlite3 -P libmysqlclient-devel -P libsqlite3-devel +# +# C:Cygwin64 is not yet available on Build Worker image. +# - C:\cygwin64\setup-x86_64.exe -B -q -n -N -d -l C:/cygwin64/var/cache/setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P openssl-devel + - set POCO_BASE=%CD% - set PATH=C:\ProgramData\chocolatey\bin;%PATH% - - c:\cygwin\bin\uname -a - - c:\cygwin\bin\cat /proc/cpuinfo - - c:\cygwin\bin\cat /proc/meminfo + - 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 + } + } + - uname -a + - cat /proc/cpuinfo + - cat /proc/meminfo - ps: | if ($env:builder -eq "cmake") { @@ -119,8 +148,8 @@ install: - ps: | if ($env:builder -eq "cmake") { - $env:PATH = $env:ChocolateyInstall + "\bin" + ";" + $env:PATH - $env:PATH = $env:ChocolateyInstall + "\lib\jom\content" + ";" + $env:PATH + $env:PATH = $env:ChocolateyInstall + "\bin;" + $env:PATH + $env:PATH = $env:ChocolateyInstall + "\lib\jom\content;" + $env:PATH } # ------------------------------------------------------------------------------------------- @@ -160,7 +189,7 @@ install: # MySQL 32 bit is not available by default on AppVeyor # ------------------------------------------------------------------------------------------- - ps: | - if ($env:platform -eq "Win32") + if (($env:platform -eq "Win32") -and !($env:builder -eq "cygwin")) { if (Test-Path $env:MYSQL32) { echo "using $env:MYSQL32 from cache" @@ -180,7 +209,7 @@ install: # http://www.enterprisedb.com/products-services-training/pgdownload#windows # ------------------------------------------------------------------------------------------- - ps: | - if ($env:platform -eq "Win32") + if (($env:platform -eq "Win32") -and !($env:builder -eq "cygwin")) { if (Test-Path $env:POSTGRES32) { echo "using $env:POSTGRES32 from cache" @@ -244,48 +273,54 @@ before_build: # & C:\cygwin\bin\ls -lR $env:MYSQL64 # ------------------------------------------------------------------------------------------- - ps: | - if ($env:platform -eq "Win32") + if (!($env:builder -eq "cygwin")) { - $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 "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 + 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" } - $env:MYSQL_PWD="Password12!" - $cmd = 'mysql -e "create database pocotestdb;" --user=root'; - iex "& $cmd" # ------------------------------------------------------------------------------------------- # ------------------------------------------------------------------------------------------- # PostgreSQL # ------------------------------------------------------------------------------------------- - ps: | - if ($env:platform -eq "Win32") + if (!($env:builder -eq "cygwin")) { - $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 + 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 + } } # ------------------------------------------------------------------------------------------- @@ -339,6 +374,11 @@ build_script: # Command executed with exception: MC: Compiling C:/projects/poco/Foundation/src/pocomsg.mc # ------------------------------------------------------------------------------------------- - ps: | + if (($env:builder -eq "cygwin") -and ($env:platform -eq "Win32")) + { + $cmd = 'bash.exe configure --everything';iex "& $cmd" + $cmd = 'make.exe -s';iex "& $cmd" + } if ($env:builder -eq "msbuild") { $logger='"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"'; @@ -410,6 +450,11 @@ test_script: $line='-------------------------------------------------------------------------------------'; if ($env:configuration -eq "release") { + if (($env:builder -eq "cygwin") -and ($env:platform -eq "Win32")) + { + $cmd = 'C:\cygwin\usr\sbin\cygserver.exe "&"';iex "& $cmd" + $cmd = 'bash.exe -c "appveyor/Cygwin/runtests.sh"';iex "& $cmd" + } if ($env:builder -eq "msbuild" -and $env:linkmode -eq "shared") { $suffix = ''; diff --git a/appveyor/Cygwin/excluded.sh b/appveyor/Cygwin/excluded.sh new file mode 100644 index 000000000..e3c76c1cb --- /dev/null +++ b/appveyor/Cygwin/excluded.sh @@ -0,0 +1,2 @@ +export EXCLUDE_TESTS="Foundation Data/ODBC Data/MySQL Redis PDF" + diff --git a/appveyor/Cygwin/runtests.sh b/appveyor/Cygwin/runtests.sh new file mode 100644 index 000000000..31f228362 --- /dev/null +++ b/appveyor/Cygwin/runtests.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# +# set -ev +# +set -v +export POCO_BASE=`pwd` +export PATH=$PATH:. +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. +source ./appveyor/ignored.sh +source ./appveyor/Cygwin/excluded.sh +build/script/runtests.sh diff --git a/appveyor/ignored.sh b/appveyor/ignored.sh new file mode 100644 index 000000000..57aa2c2a4 --- /dev/null +++ b/appveyor/ignored.sh @@ -0,0 +1,10 @@ +export CPPUNIT_IGNORE="\ + N7CppUnit10TestCallerI8PathTestEE.testExpand, \ + N7CppUnit10TestCallerI13RawSocketTestEE.testEchoIPv4, \ + N7CppUnit10TestCallerI13RawSocketTestEE.testSendToReceiveFromIPv4, \ + N7CppUnit10TestCallerI14ICMPClientTestEE.testPing, \ + N7CppUnit10TestCallerI22HTTPSClientSessionTestEE.testProxy, \ + N7CppUnit10TestCallerI22HTTPSStreamFactoryTestEE.testProxy, \ + N7CppUnit10TestCallerI19MulticastSocketTestEE.testMulticast, \ + N7CppUnit10TestCallerI13NTPClientTestEE.testTimeSync" +