mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 19:10:20 +01:00
119
.travis.yml
119
.travis.yml
@@ -3,113 +3,140 @@ 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
|
||||
# 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 -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 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 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 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
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y sloccount cppcheck; fi
|
||||
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; 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 g++-4.8; fi
|
||||
|
||||
services:
|
||||
- mongodb
|
||||
- redis-server
|
||||
- mysql
|
||||
|
||||
notifications:
|
||||
slack:
|
||||
rooms:
|
||||
- pocoproject:4iwY1QpB8fdU2WqpcZ6PpZhz#travis
|
||||
- kampbell:v4ARuptk0ETzwUsKDdV6Gspb#poco
|
||||
- pocoproject:ItIUZvs8aJGyPdaKxIKMnS1t#travis
|
||||
|
||||
env:
|
||||
global: TEST_NAME=""
|
||||
|
||||
global:
|
||||
TEST_NAME=""
|
||||
|
||||
before_script:
|
||||
- echo ${TEST_NAME}
|
||||
- sqlite3 -version
|
||||
- chmod 755 ./travis/Linux/runtests.sh
|
||||
- chmod 755 ./travis/OSX/runtests.sh
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- env: TEST_NAME="OSX clang (make) bundled"
|
||||
compiler: clang
|
||||
os: osx
|
||||
compiler: clang
|
||||
script:
|
||||
- ./configure --everything --omit=Data/ODBC,Data/MySQL,Data/SQLite && make -j2
|
||||
- cat config.*
|
||||
- export CC="clang"
|
||||
- export CXX="clang++"
|
||||
- clang++ -x c++ /dev/null -dM -E
|
||||
- ./configure --everything --omit=Data/ODBC,Data/MySQL,Data/SQLite && make -s -j2
|
||||
- sudo make install
|
||||
- ls -l /usr/local/lib/*Poco*
|
||||
- find . -name "*testrunner*"
|
||||
- ./travis/runtests.sh
|
||||
- ./travis/OSX/runtests.sh
|
||||
|
||||
- env: TEST_NAME="Linux gcc (make) bundled"
|
||||
- env: TEST_NAME="Linux gcc 4.6 (make) bundled"
|
||||
compiler: gcc
|
||||
script:
|
||||
- export CC="gcc"
|
||||
- export CXX="g++"
|
||||
- ./configure --everything && make -s -j2
|
||||
- sudo make install
|
||||
- ./travis/runtests.sh
|
||||
- ./travis/Linux/runtests.sh
|
||||
|
||||
- env: TEST_NAME="Linux gcc (make) unbundled"
|
||||
- env: TEST_NAME="Linux gcc 4.8 (make) bundled"
|
||||
compiler: gcc
|
||||
script:
|
||||
- export CC="gcc-4.8"
|
||||
- export CXX="g++-4.8"
|
||||
- ./configure --everything && make -s -j2
|
||||
- ./travis/Linux/runtests.sh
|
||||
|
||||
- env: TEST_NAME="Linux gcc 4.6 (make) unbundled"
|
||||
compiler: gcc
|
||||
script:
|
||||
- export CC="gcc"
|
||||
- export CXX="g++"
|
||||
- sudo apt-get install -qq -y libpcre3-dev libssl-dev libexpat1-dev
|
||||
- ./configure --everything --unbundled && make -s -j2
|
||||
- ./travis/Linux/runtests.sh
|
||||
|
||||
- env: TEST_NAME="Linux gcc 4.8 (make) unbundled"
|
||||
compiler: gcc
|
||||
script:
|
||||
- sudo apt-get install -qq -y libpcre3-dev libssl-dev libexpat1-dev
|
||||
- export CC="gcc-4.8"
|
||||
- export CXX="g++-4.8"
|
||||
- ./configure --everything --unbundled && make -s -j2
|
||||
- sudo make install
|
||||
- ./travis/runtests.sh
|
||||
- ./travis/Linux/runtests.sh
|
||||
|
||||
- env: TEST_NAME="Linux clang (make)"
|
||||
- env: TEST_NAME="Linux clang 3.4 (make)"
|
||||
compiler: clang
|
||||
script:
|
||||
- ./configure --everything --config=Linux-clang && make -s -j2
|
||||
- sudo make install
|
||||
- ./travis/runtests.sh
|
||||
- ./travis/Linux/runtests.sh
|
||||
|
||||
- env: TEST_NAME="Linux arm-linux-gnueabi- (make)"
|
||||
script:
|
||||
- ./configure --omit=Data/ODBC,Data/MySQL,Crypto,NetSSL,PageCompiler && make -s -j2 CROSS_COMPILE=arm-linux-gnueabi- POCO_TARGET_OSARCH=armv7l
|
||||
#FIXME the -m64 option bring by the Linux config is not supported by arm-linux-gnueabi-g++ which makes this test failing
|
||||
#FIXME - env: TEST_NAME="arm-linux-gnueabi- (make)"
|
||||
#FIXME script:
|
||||
#FIXME - ./configure --omit=Data/ODBC,Data/MySQL,Crypto,NetSSL,PageCompiler && make -s -j2 CROSS_COMPILE=arm-linux-gnueabi- POCO_TARGET_OSARCH=armv7l
|
||||
|
||||
- env: TEST_NAME="Linux gcc (CMake)"
|
||||
- env: TEST_NAME="Linux gcc 4.6 (CMake)"
|
||||
compiler: gcc
|
||||
script:
|
||||
# disable tests, gcc-4.6 gets an internal compiler error
|
||||
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_TESTS=OFF .. && make -j2 && cd ..
|
||||
- export CC="gcc"
|
||||
- export CXX="g++"
|
||||
- source ./travis/ignored.sh
|
||||
- export POCO_BASE=`pwd`
|
||||
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_TESTS=ON .. && make -s -j2 && ctest -VV -E Data && cd ..
|
||||
|
||||
- env: TEST_NAME="gcc-4.8 (CMake)"
|
||||
- env: TEST_NAME="Linux gcc 4.8 (CMake)"
|
||||
compiler: gcc
|
||||
script:
|
||||
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq -y g++-4.8
|
||||
- export CC="gcc-4.8"
|
||||
- export CXX="g++-4.8"
|
||||
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_TESTS=ON .. && make -j2 && cd ..
|
||||
- source ./travis/ignored.sh
|
||||
- export POCO_BASE=`pwd`
|
||||
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_TESTS=ON .. && make -s -j2 && ctest -VV -E Data && cd ..
|
||||
|
||||
- env: TEST_NAME="Linux clang (CMake)"
|
||||
- env: TEST_NAME="clang 3.4 (CMake)"
|
||||
compiler: clang
|
||||
script:
|
||||
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_TESTS=ON .. && make -j2 && cd ..
|
||||
- source ./travis/ignored.sh
|
||||
- export POCO_BASE=`pwd`
|
||||
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_TESTS=ON .. && make -s -j2 && ctest -VV -E Data && cd ..
|
||||
|
||||
- env: TEST_NAME="Linux arm-linux-gnueabi-g++ (CMake)"
|
||||
script:
|
||||
- export CC="arm-linux-gnueabi-gcc"
|
||||
- export CXX="arm-linux-gnueabi-g++"
|
||||
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=OFF .. && make -j2 && cd ..
|
||||
- source ./travis/ignored.sh
|
||||
- export POCO_BASE=`pwd`
|
||||
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=ON ..
|
||||
- make -s -j2 && cd ..
|
||||
|
||||
- env: TEST_NAME="Linux arm-linux-gnueabihf-g++ (CMake)"
|
||||
script:
|
||||
- export CC="arm-linux-gnueabihf-gcc"
|
||||
- export CXX="arm-linux-gnueabihf-g++"
|
||||
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=OFF .. && make -j2 && cd ..
|
||||
- source ./travis/ignored.sh
|
||||
- export POCO_BASE=`pwd`
|
||||
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=ON ..
|
||||
- make -s -j2 && cd ..
|
||||
|
||||
# TODO osx build
|
||||
# TODO run test suite
|
||||
@@ -123,9 +150,11 @@ matrix:
|
||||
|
||||
# QA jobs for code analytics and metrics
|
||||
# build documentation and release
|
||||
- env: TEST_NAME="documentation & release"
|
||||
- env: TEST_NAME="Linux documentation & release"
|
||||
compiler: gcc
|
||||
script:
|
||||
- export CC="gcc"
|
||||
- export CXX="g++"
|
||||
- . env.sh && mkdoc all && mkrel all
|
||||
|
||||
# static code analysis with cppcheck (we can add --enable=all later)
|
||||
|
||||
@@ -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 exceptionLineNumber, const std::string& rFileName): _message(message), _lineNumber(exceptionLineNumber), _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 exceptionLineNumber, long data1lineNumber, const std::string& rFileName): _message(message), _lineNumber(exceptionLineNumber), _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 exceptionLineNumber, long data1lineNumber, long data2lineNumber, const std::string& rFileName): _message(message), _lineNumber(exceptionLineNumber), _data1lineNumber(data1lineNumber), _data2lineNumber(data2lineNumber), _fileName(rFileName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -21,21 +21,21 @@ namespace Poco {
|
||||
namespace Crypto {
|
||||
|
||||
|
||||
CipherKey::CipherKey(const std::string& name, const std::string& passphrase, const std::string& salt, int iterationCount,
|
||||
const std::string &digest):
|
||||
_pImpl(new CipherKeyImpl(name, passphrase, salt, iterationCount, digest))
|
||||
CipherKey::CipherKey(const std::string& rName, const std::string& passphrase, const std::string& salt, int iterationCount,
|
||||
const std::string & rDigest):
|
||||
_pImpl(new CipherKeyImpl(rName, passphrase, salt, iterationCount, rDigest))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
CipherKey::CipherKey(const std::string& name, const ByteVec& key, const ByteVec& iv):
|
||||
_pImpl(new CipherKeyImpl(name, key, iv))
|
||||
CipherKey::CipherKey(const std::string& rName, const ByteVec& key, const ByteVec& iv):
|
||||
_pImpl(new CipherKeyImpl(rName, key, iv))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
CipherKey::CipherKey(const std::string& name):
|
||||
_pImpl(new CipherKeyImpl(name))
|
||||
CipherKey::CipherKey(const std::string& rName):
|
||||
_pImpl(new CipherKeyImpl(rName))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -27,28 +27,28 @@ namespace Poco {
|
||||
namespace Crypto {
|
||||
|
||||
|
||||
CipherKeyImpl::CipherKeyImpl(const std::string& name,
|
||||
CipherKeyImpl::CipherKeyImpl(const std::string& rName,
|
||||
const std::string& passphrase,
|
||||
const std::string& salt,
|
||||
int iterationCount,
|
||||
const std::string& digest):
|
||||
const std::string& rDigest):
|
||||
_pCipher(0),
|
||||
_pDigest(0),
|
||||
_name(name),
|
||||
_name(rName),
|
||||
_key(),
|
||||
_iv()
|
||||
{
|
||||
// dummy access to Cipherfactory so that the EVP lib is initilaized
|
||||
CipherFactory::defaultFactory();
|
||||
_pCipher = EVP_get_cipherbyname(name.c_str());
|
||||
_pCipher = EVP_get_cipherbyname(rName.c_str());
|
||||
|
||||
if (!_pCipher)
|
||||
throw Poco::NotFoundException("Cipher " + name + " was not found");
|
||||
throw Poco::NotFoundException("Cipher " + rName + " was not found");
|
||||
|
||||
_pDigest = EVP_get_digestbyname(digest.c_str());
|
||||
_pDigest = EVP_get_digestbyname(rDigest.c_str());
|
||||
|
||||
if (!_pDigest)
|
||||
throw Poco::NotFoundException("Digest " + name + " was not found");
|
||||
throw Poco::NotFoundException("Digest " + rName + " was not found");
|
||||
|
||||
|
||||
_key = ByteVec(keySize());
|
||||
@@ -57,35 +57,35 @@ CipherKeyImpl::CipherKeyImpl(const std::string& name,
|
||||
}
|
||||
|
||||
|
||||
CipherKeyImpl::CipherKeyImpl(const std::string& name,
|
||||
CipherKeyImpl::CipherKeyImpl(const std::string& rName,
|
||||
const ByteVec& key,
|
||||
const ByteVec& iv):
|
||||
_pCipher(0),
|
||||
_name(name),
|
||||
_name(rName),
|
||||
_key(key),
|
||||
_iv(iv)
|
||||
{
|
||||
// dummy access to Cipherfactory so that the EVP lib is initilaized
|
||||
CipherFactory::defaultFactory();
|
||||
_pCipher = EVP_get_cipherbyname(name.c_str());
|
||||
_pCipher = EVP_get_cipherbyname(rName.c_str());
|
||||
|
||||
if (!_pCipher)
|
||||
throw Poco::NotFoundException("Cipher " + name + " was not found");
|
||||
throw Poco::NotFoundException("Cipher " + rName + " was not found");
|
||||
}
|
||||
|
||||
|
||||
CipherKeyImpl::CipherKeyImpl(const std::string& name):
|
||||
CipherKeyImpl::CipherKeyImpl(const std::string& rName):
|
||||
_pCipher(0),
|
||||
_name(name),
|
||||
_name(rName),
|
||||
_key(),
|
||||
_iv()
|
||||
{
|
||||
// dummy access to Cipherfactory so that the EVP lib is initilaized
|
||||
CipherFactory::defaultFactory();
|
||||
_pCipher = EVP_get_cipherbyname(name.c_str());
|
||||
_pCipher = EVP_get_cipherbyname(rName.c_str());
|
||||
|
||||
if (!_pCipher)
|
||||
throw Poco::NotFoundException("Cipher " + name + " was not found");
|
||||
throw Poco::NotFoundException("Cipher " + rName + " was not found");
|
||||
_key = ByteVec(keySize());
|
||||
_iv = ByteVec(ivSize());
|
||||
generateKey();
|
||||
@@ -165,7 +165,7 @@ void CipherKeyImpl::generateKey(
|
||||
}
|
||||
|
||||
// Now create the key and IV, using the digest set in the constructor.
|
||||
int keySize = EVP_BytesToKey(
|
||||
int cipherKeySize = EVP_BytesToKey(
|
||||
_pCipher,
|
||||
_pDigest,
|
||||
(salt.empty() ? 0 : saltBytes),
|
||||
@@ -176,7 +176,7 @@ void CipherKeyImpl::generateKey(
|
||||
ivBytes);
|
||||
|
||||
// Copy the buffers to our member byte vectors.
|
||||
_key.assign(keyBytes, keyBytes + keySize);
|
||||
_key.assign(keyBytes, keyBytes + cipherKeySize);
|
||||
|
||||
if (ivSize() == 0)
|
||||
_iv.clear();
|
||||
|
||||
@@ -87,10 +87,10 @@ RSAKeyImpl::RSAKeyImpl(
|
||||
RSA* pubKey = PEM_read_bio_RSAPublicKey(bio, &_pRSA, 0, 0);
|
||||
if (!pubKey)
|
||||
{
|
||||
int rc = BIO_reset(bio);
|
||||
int ret = BIO_reset(bio);
|
||||
// BIO_reset() normally returns 1 for success and 0 or -1 for failure.
|
||||
// File BIOs are an exception, they return 0 for success and -1 for failure.
|
||||
if (rc != 0) throw Poco::FileException("Failed to load public key", publicKeyFile);
|
||||
if (ret != 0) throw Poco::FileException("Failed to load public key", publicKeyFile);
|
||||
pubKey = PEM_read_bio_RSA_PUBKEY(bio, &_pRSA, 0, 0);
|
||||
}
|
||||
BIO_free(bio);
|
||||
@@ -287,8 +287,8 @@ void RSAKeyImpl::save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyS
|
||||
throw Poco::WriteFileException("Failed to write public key to stream");
|
||||
}
|
||||
char* pData;
|
||||
long size = BIO_get_mem_data(bio, &pData);
|
||||
pPublicKeyStream->write(pData, static_cast<std::streamsize>(size));
|
||||
long keySize = BIO_get_mem_data(bio, &pData);
|
||||
pPublicKeyStream->write(pData, static_cast<std::streamsize>(keySize));
|
||||
BIO_free(bio);
|
||||
}
|
||||
|
||||
@@ -309,8 +309,8 @@ void RSAKeyImpl::save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyS
|
||||
throw Poco::FileException("Failed to write private key to stream");
|
||||
}
|
||||
char* pData;
|
||||
long size = BIO_get_mem_data(bio, &pData);
|
||||
pPrivateKeyStream->write(pData, static_cast<std::streamsize>(size));
|
||||
long keySize = BIO_get_mem_data(bio, &pData);
|
||||
pPrivateKeyStream->write(pData, static_cast<std::streamsize>(keySize));
|
||||
BIO_free(bio);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,9 @@ void Utility::throwException(int rc, const std::string& addErrMsg)
|
||||
throw ExecutionAbortedException(std::string("Callback routine requested an abort"), addErrMsg);
|
||||
case SQLITE_BUSY:
|
||||
case SQLITE_BUSY_RECOVERY:
|
||||
#if defined(SQLITE_BUSY_SNAPSHOT)
|
||||
case SQLITE_BUSY_SNAPSHOT:
|
||||
#endif
|
||||
throw DBLockedException(std::string("The database file is locked"), addErrMsg);
|
||||
case SQLITE_LOCKED:
|
||||
throw TableLockedException(std::string("A table in the database is locked"), addErrMsg);
|
||||
|
||||
@@ -42,11 +42,12 @@ class Foundation_API Path
|
||||
public:
|
||||
enum Style
|
||||
{
|
||||
PATH_UNIX, /// Unix-style path
|
||||
PATH_WINDOWS, /// Windows-style path
|
||||
PATH_VMS, /// VMS-style path
|
||||
PATH_NATIVE, /// The current platform's native style
|
||||
PATH_GUESS /// Guess the style by examining the path
|
||||
PATH_UNIX, /// Unix-style path
|
||||
PATH_URI = PATH_UNIX, /// URI-style path, same as Unix-style
|
||||
PATH_WINDOWS, /// Windows-style path
|
||||
PATH_VMS, /// VMS-style path
|
||||
PATH_NATIVE, /// The current platform's native style
|
||||
PATH_GUESS /// Guess the style by examining the path
|
||||
};
|
||||
|
||||
typedef std::vector<std::string> StringVec;
|
||||
|
||||
@@ -166,7 +166,11 @@
|
||||
#elif defined(__PPC) || defined(__POWERPC__) || defined(__powerpc) || defined(__PPC__) || \
|
||||
defined(__powerpc__) || defined(__ppc__) || defined(__ppc) || defined(_ARCH_PPC) || defined(_M_PPC)
|
||||
#define POCO_ARCH POCO_ARCH_PPC
|
||||
#define POCO_ARCH_BIG_ENDIAN 1
|
||||
#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
||||
#define POCO_ARCH_LITTLE_ENDIAN 1
|
||||
#else
|
||||
#define POCO_ARCH_BIG_ENDIAN 1
|
||||
#endif
|
||||
#elif defined(_POWER) || defined(_ARCH_PWR) || defined(_ARCH_PWR2) || defined(_ARCH_PWR3) || \
|
||||
defined(_ARCH_PWR4) || defined(__THW_RS6000)
|
||||
#define POCO_ARCH POCO_ARCH_POWER
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/Event.h"
|
||||
#include "Poco/Mutex.h"
|
||||
#include "Poco/Optional.h"
|
||||
#include "Poco/RefCountedObject.h"
|
||||
#include <unistd.h>
|
||||
#include <vector>
|
||||
@@ -41,9 +44,13 @@ public:
|
||||
|
||||
pid_t id() const;
|
||||
int wait() const;
|
||||
int wait(int options) const;
|
||||
|
||||
private:
|
||||
pid_t _pid;
|
||||
const pid_t _pid;
|
||||
mutable FastMutex _mutex;
|
||||
mutable Event _event;
|
||||
mutable Optional<int> _status;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ class WorkNotification: public Notification
|
||||
public:
|
||||
typedef AutoPtr<WorkNotification> Ptr;
|
||||
|
||||
WorkNotification(int data):
|
||||
_data(data)
|
||||
WorkNotification(int workData):
|
||||
_data(workData)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/NumberFormatter.h"
|
||||
#include "Poco/Pipe.h"
|
||||
#include "Poco/Thread.h"
|
||||
#include <limits>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
@@ -42,7 +43,10 @@ namespace Poco {
|
||||
// ProcessHandleImpl
|
||||
//
|
||||
ProcessHandleImpl::ProcessHandleImpl(pid_t pid):
|
||||
_pid(pid)
|
||||
_pid(pid),
|
||||
_mutex(),
|
||||
_event(Event::EVENT_MANUALRESET),
|
||||
_status()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -60,24 +64,60 @@ pid_t ProcessHandleImpl::id() const
|
||||
|
||||
int ProcessHandleImpl::wait() const
|
||||
{
|
||||
int status;
|
||||
int rc;
|
||||
do
|
||||
{
|
||||
rc = waitpid(_pid, &status, 0);
|
||||
}
|
||||
while (rc < 0 && errno == EINTR);
|
||||
if (rc != _pid)
|
||||
if (wait(0) != _pid)
|
||||
throw SystemException("Cannot wait for process", NumberFormatter::format(_pid));
|
||||
|
||||
const int status = _status.value();
|
||||
if (WIFEXITED(status))
|
||||
return WEXITSTATUS(status);
|
||||
if (WIFSIGNALED(status))
|
||||
return -WTERMSIG(status);
|
||||
|
||||
// This line should never be reached.
|
||||
return std::numeric_limits<int>::max();
|
||||
}
|
||||
|
||||
|
||||
int ProcessHandleImpl::wait(int options) const
|
||||
{
|
||||
{
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
if (_status.isSpecified())
|
||||
{
|
||||
return _pid;
|
||||
}
|
||||
}
|
||||
|
||||
int status;
|
||||
int rc;
|
||||
do
|
||||
{
|
||||
rc = waitpid(_pid, &status, options);
|
||||
}
|
||||
while (rc < 0 && errno == EINTR);
|
||||
|
||||
if (rc == _pid)
|
||||
{
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
_status = status;
|
||||
_event.set();
|
||||
}
|
||||
else if (rc < 0 && errno == ECHILD)
|
||||
{
|
||||
// Looks like another thread was lucky and it should update the status for us shortly
|
||||
_event.wait();
|
||||
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
if (_status.isSpecified())
|
||||
{
|
||||
rc = _pid;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// ProcessImpl
|
||||
//
|
||||
@@ -251,7 +291,7 @@ void ProcessImpl::killImpl(PIDImpl pid)
|
||||
|
||||
bool ProcessImpl::isRunningImpl(const ProcessHandleImpl& handle)
|
||||
{
|
||||
return isRunningImpl(handle.id());
|
||||
return handle.wait(WNOHANG) == 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace
|
||||
}
|
||||
|
||||
|
||||
ActiveDispatcherTest::ActiveDispatcherTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ActiveDispatcherTest::ActiveDispatcherTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace
|
||||
}
|
||||
|
||||
|
||||
ActiveMethodTest::ActiveMethodTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ActiveMethodTest::ActiveMethodTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace
|
||||
}
|
||||
|
||||
|
||||
ActivityTest::ActivityTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ActivityTest::ActivityTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
AnyTest::AnyTest(const std::string& name): CppUnit::TestCase(name)
|
||||
AnyTest::AnyTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
|
||||
ArrayTest::ArrayTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ArrayTest::ArrayTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace
|
||||
}
|
||||
|
||||
|
||||
AutoPtrTest::AutoPtrTest(const std::string& name): CppUnit::TestCase(name)
|
||||
AutoPtrTest::AutoPtrTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace
|
||||
}
|
||||
|
||||
|
||||
AutoReleasePoolTest::AutoReleasePoolTest(const std::string& name): CppUnit::TestCase(name)
|
||||
AutoReleasePoolTest::AutoReleasePoolTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ using Poco::Base32Decoder;
|
||||
using Poco::DataFormatException;
|
||||
|
||||
|
||||
Base32Test::Base32Test(const std::string& name): CppUnit::TestCase(name)
|
||||
Base32Test::Base32Test(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ using Poco::Base64Decoder;
|
||||
using Poco::DataFormatException;
|
||||
|
||||
|
||||
Base64Test::Base64Test(const std::string& name): CppUnit::TestCase(name)
|
||||
Base64Test::Base64Test(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ using namespace Poco;
|
||||
#define LARGEINC 100
|
||||
|
||||
|
||||
BasicEventTest::BasicEventTest(const std::string& name): CppUnit::TestCase(name)
|
||||
BasicEventTest::BasicEventTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ using Poco::Int64;
|
||||
using Poco::UInt64;
|
||||
|
||||
|
||||
BinaryReaderWriterTest::BinaryReaderWriterTest(const std::string& name): CppUnit::TestCase(name)
|
||||
BinaryReaderWriterTest::BinaryReaderWriterTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ using Poco::UInt64;
|
||||
#endif
|
||||
|
||||
|
||||
ByteOrderTest::ByteOrderTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ByteOrderTest::ByteOrderTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
ChannelTest::ChannelTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ChannelTest::ChannelTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ using Poco::NotFoundException;
|
||||
using Poco::InvalidAccessException;
|
||||
|
||||
|
||||
ClassLoaderTest::ClassLoaderTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ClassLoaderTest::ClassLoaderTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ using Poco::Clock;
|
||||
using Poco::Thread;
|
||||
|
||||
|
||||
ClockTest::ClockTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ClockTest::ClockTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace
|
||||
}
|
||||
|
||||
|
||||
ConditionTest::ConditionTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ConditionTest::ConditionTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ struct Large
|
||||
#define ENABLE_BUGCHECK_TEST 0
|
||||
|
||||
|
||||
CoreTest::CoreTest(const std::string& name): CppUnit::TestCase(name)
|
||||
CoreTest::CoreTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ using Poco::CountingInputStream;
|
||||
using Poco::CountingOutputStream;
|
||||
|
||||
|
||||
CountingStreamTest::CountingStreamTest(const std::string& name): CppUnit::TestCase(name)
|
||||
CountingStreamTest::CountingStreamTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ using Poco::DateTimeFormat;
|
||||
using Poco::DateTimeFormatter;
|
||||
|
||||
|
||||
DateTimeFormatterTest::DateTimeFormatterTest(const std::string& name)
|
||||
: CppUnit::TestCase(name)
|
||||
DateTimeFormatterTest::DateTimeFormatterTest(const std::string& rName)
|
||||
: CppUnit::TestCase(rName)
|
||||
{
|
||||
// Linker regresion SF #3288584
|
||||
std::string message;
|
||||
|
||||
@@ -27,7 +27,7 @@ using Poco::Timestamp;
|
||||
using Poco::SyntaxException;
|
||||
|
||||
|
||||
DateTimeParserTest::DateTimeParserTest(const std::string& name): CppUnit::TestCase(name)
|
||||
DateTimeParserTest::DateTimeParserTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ using Poco::Timespan;
|
||||
using Poco::AssertionViolationException;
|
||||
|
||||
|
||||
DateTimeTest::DateTimeTest(const std::string& name): CppUnit::TestCase(name)
|
||||
DateTimeTest::DateTimeTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ using Poco::DigestEngine;
|
||||
using Poco::MD5Engine;
|
||||
|
||||
|
||||
DigestStreamTest::DigestStreamTest(const std::string& name): CppUnit::TestCase(name)
|
||||
DigestStreamTest::DigestStreamTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
using namespace Poco;
|
||||
|
||||
|
||||
DirectoryIteratorsTest::DirectoryIteratorsTest(const std::string& name):
|
||||
CppUnit::TestCase(name)
|
||||
DirectoryIteratorsTest::DirectoryIteratorsTest(const std::string& rName):
|
||||
CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
using Poco::DirectoryWatcher;
|
||||
|
||||
|
||||
DirectoryWatcherTest::DirectoryWatcherTest(const std::string& name):
|
||||
CppUnit::TestCase(name),
|
||||
DirectoryWatcherTest::DirectoryWatcherTest(const std::string& rName):
|
||||
CppUnit::TestCase(rName),
|
||||
_error(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace
|
||||
}
|
||||
|
||||
|
||||
DynamicFactoryTest::DynamicFactoryTest(const std::string& name): CppUnit::TestCase(name)
|
||||
DynamicFactoryTest::DynamicFactoryTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ using namespace Poco;
|
||||
#define DURWAIT 300
|
||||
|
||||
|
||||
ExpireCacheTest::ExpireCacheTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ExpireCacheTest::ExpireCacheTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ using namespace Poco;
|
||||
#define DURWAIT 300
|
||||
|
||||
|
||||
ExpireLRUCacheTest::ExpireLRUCacheTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ExpireLRUCacheTest::ExpireLRUCacheTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ using Poco::FIFOBufferStream;
|
||||
using Poco::delegate;
|
||||
|
||||
|
||||
FIFOBufferStreamTest::FIFOBufferStreamTest(const std::string& name): CppUnit::TestCase(name)
|
||||
FIFOBufferStreamTest::FIFOBufferStreamTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ using Poco::delegate;
|
||||
using std::memcpy;
|
||||
|
||||
|
||||
FIFOBufferTest::FIFOBufferTest(const std::string& name):
|
||||
CppUnit::TestCase(name),
|
||||
FIFOBufferTest::FIFOBufferTest(const std::string& rName):
|
||||
CppUnit::TestCase(rName),
|
||||
_notToReadable(0),
|
||||
_notToWritable(0),
|
||||
_readableToNot(0),
|
||||
|
||||
@@ -26,7 +26,7 @@ using namespace Poco;
|
||||
#define LARGEINC 100
|
||||
|
||||
|
||||
FIFOEventTest::FIFOEventTest(const std::string& name): CppUnit::TestCase(name)
|
||||
FIFOEventTest::FIFOEventTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
using Poco::FPE;
|
||||
|
||||
|
||||
FPETest::FPETest(const std::string& name): CppUnit::TestCase(name)
|
||||
FPETest::FPETest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ using Poco::DirectoryIterator;
|
||||
using Poco::InvalidArgumentException;
|
||||
|
||||
|
||||
FileChannelTest::FileChannelTest(const std::string& name): CppUnit::TestCase(name)
|
||||
FileChannelTest::FileChannelTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "Poco/Exception.h"
|
||||
|
||||
|
||||
FileStreamTest::FileStreamTest(const std::string& name): CppUnit::TestCase(name)
|
||||
FileStreamTest::FileStreamTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ using Poco::Timestamp;
|
||||
using Poco::Thread;
|
||||
|
||||
|
||||
FileTest::FileTest(const std::string& name): CppUnit::TestCase(name)
|
||||
FileTest::FileTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ using Poco::Int64;
|
||||
using Poco::UInt64;
|
||||
|
||||
|
||||
FormatTest::FormatTest(const std::string& name): CppUnit::TestCase(name)
|
||||
FormatTest::FormatTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ using Poco::File;
|
||||
using Poco::Path;
|
||||
|
||||
|
||||
GlobTest::GlobTest(const std::string& name): CppUnit::TestCase(name)
|
||||
GlobTest::GlobTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ using Poco::MD5Engine;
|
||||
using Poco::DigestEngine;
|
||||
|
||||
|
||||
HMACEngineTest::HMACEngineTest(const std::string& name): CppUnit::TestCase(name)
|
||||
HMACEngineTest::HMACEngineTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
using Poco::HashMap;
|
||||
|
||||
|
||||
HashMapTest::HashMapTest(const std::string& name): CppUnit::TestCase(name)
|
||||
HashMapTest::HashMapTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ using Poco::Hash;
|
||||
using Poco::HashSet;
|
||||
|
||||
|
||||
HashSetTest::HashSetTest(const std::string& name): CppUnit::TestCase(name)
|
||||
HashSetTest::HashSetTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
using namespace Poco;
|
||||
|
||||
|
||||
HashTableTest::HashTableTest(const std::string& name): CppUnit::TestCase(name)
|
||||
HashTableTest::HashTableTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ using Poco::HexBinaryDecoder;
|
||||
using Poco::DataFormatException;
|
||||
|
||||
|
||||
HexBinaryTest::HexBinaryTest(const std::string& name): CppUnit::TestCase(name)
|
||||
HexBinaryTest::HexBinaryTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
using namespace Poco;
|
||||
|
||||
|
||||
LRUCacheTest::LRUCacheTest(const std::string& name): CppUnit::TestCase(name)
|
||||
LRUCacheTest::LRUCacheTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ using Poco::OutputLineEndingConverter;
|
||||
using Poco::StreamCopier;
|
||||
|
||||
|
||||
LineEndingConverterTest::LineEndingConverterTest(const std::string& name): CppUnit::TestCase(name)
|
||||
LineEndingConverterTest::LineEndingConverterTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ using Poco::Stopwatch;
|
||||
using Poco::NumberFormatter;
|
||||
|
||||
|
||||
LinearHashTableTest::LinearHashTableTest(const std::string& name): CppUnit::TestCase(name)
|
||||
LinearHashTableTest::LinearHashTableTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
using Poco::ListMap;
|
||||
|
||||
|
||||
ListMapTest::ListMapTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ListMapTest::ListMapTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ using std::strftime;
|
||||
#endif
|
||||
|
||||
|
||||
LocalDateTimeTest::LocalDateTimeTest(const std::string& name): CppUnit::TestCase(name)
|
||||
LocalDateTimeTest::LocalDateTimeTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ using Poco::Message;
|
||||
using Poco::AutoPtr;
|
||||
|
||||
|
||||
LogStreamTest::LogStreamTest(const std::string& name): CppUnit::TestCase(name)
|
||||
LogStreamTest::LogStreamTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ using Poco::Message;
|
||||
using Poco::AutoPtr;
|
||||
|
||||
|
||||
LoggerTest::LoggerTest(const std::string& name): CppUnit::TestCase(name)
|
||||
LoggerTest::LoggerTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace
|
||||
}
|
||||
|
||||
|
||||
LoggingFactoryTest::LoggingFactoryTest(const std::string& name): CppUnit::TestCase(name)
|
||||
LoggingFactoryTest::LoggingFactoryTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ using Poco::PatternFormatter;
|
||||
using Poco::AutoPtr;
|
||||
|
||||
|
||||
LoggingRegistryTest::LoggingRegistryTest(const std::string& name): CppUnit::TestCase(name)
|
||||
LoggingRegistryTest::LoggingRegistryTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ using Poco::MD4Engine;
|
||||
using Poco::DigestEngine;
|
||||
|
||||
|
||||
MD4EngineTest::MD4EngineTest(const std::string& name): CppUnit::TestCase(name)
|
||||
MD4EngineTest::MD4EngineTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ using Poco::MD5Engine;
|
||||
using Poco::DigestEngine;
|
||||
|
||||
|
||||
MD5EngineTest::MD5EngineTest(const std::string& name): CppUnit::TestCase(name)
|
||||
MD5EngineTest::MD5EngineTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class MfTestObject: public MfTestBase
|
||||
};
|
||||
|
||||
|
||||
ManifestTest::ManifestTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ManifestTest::ManifestTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
using Poco::MemoryPool;
|
||||
|
||||
|
||||
MemoryPoolTest::MemoryPoolTest(const std::string& name): CppUnit::TestCase(name)
|
||||
MemoryPoolTest::MemoryPoolTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ using Poco::MemoryInputStream;
|
||||
using Poco::MemoryOutputStream;
|
||||
|
||||
|
||||
MemoryStreamTest::MemoryStreamTest(const std::string& name): CppUnit::TestCase(name)
|
||||
MemoryStreamTest::MemoryStreamTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace
|
||||
}
|
||||
|
||||
|
||||
MutexTest::MutexTest(const std::string& name): CppUnit::TestCase(name)
|
||||
MutexTest::MutexTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
using Poco::NDC;
|
||||
|
||||
|
||||
NDCTest::NDCTest(const std::string& name): CppUnit::TestCase(name)
|
||||
NDCTest::NDCTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace
|
||||
}
|
||||
|
||||
|
||||
NamedEventTest::NamedEventTest(const std::string& name): CppUnit::TestCase(name)
|
||||
NamedEventTest::NamedEventTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace
|
||||
}
|
||||
|
||||
|
||||
NamedMutexTest::NamedMutexTest(const std::string& name): CppUnit::TestCase(name)
|
||||
NamedMutexTest::NamedMutexTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ using Poco::NotFoundException;
|
||||
using Poco::InvalidArgumentException;
|
||||
|
||||
|
||||
NamedTuplesTest::NamedTuplesTest(const std::string& name): CppUnit::TestCase(name)
|
||||
NamedTuplesTest::NamedTuplesTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class TestNotification: public Notification
|
||||
};
|
||||
|
||||
|
||||
NotificationCenterTest::NotificationCenterTest(const std::string& name): CppUnit::TestCase(name)
|
||||
NotificationCenterTest::NotificationCenterTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace
|
||||
}
|
||||
|
||||
|
||||
NotificationQueueTest::NotificationQueueTest(const std::string& name): CppUnit::TestCase(name)
|
||||
NotificationQueueTest::NotificationQueueTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ using Poco::NullInputStream;
|
||||
using Poco::NullOutputStream;
|
||||
|
||||
|
||||
NullStreamTest::NullStreamTest(const std::string& name): CppUnit::TestCase(name)
|
||||
NullStreamTest::NullStreamTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ using Poco::Int64;
|
||||
using Poco::UInt64;
|
||||
|
||||
|
||||
NumberFormatterTest::NumberFormatterTest(const std::string& name): CppUnit::TestCase(name)
|
||||
NumberFormatterTest::NumberFormatterTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ using Poco::decimalSeparator;
|
||||
using Poco::thousandSeparator;
|
||||
|
||||
|
||||
NumberParserTest::NumberParserTest(const std::string& name): CppUnit::TestCase(name)
|
||||
NumberParserTest::NumberParserTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
using Poco::ObjectPool;
|
||||
|
||||
|
||||
ObjectPoolTest::ObjectPoolTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ObjectPoolTest::ObjectPoolTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ using Poco::SHA1Engine;
|
||||
using Poco::DigestEngine;
|
||||
|
||||
|
||||
PBKDF2EngineTest::PBKDF2EngineTest(const std::string& name): CppUnit::TestCase(name)
|
||||
PBKDF2EngineTest::PBKDF2EngineTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ using Poco::PathSyntaxException;
|
||||
using Poco::Environment;
|
||||
|
||||
|
||||
PathTest::PathTest(const std::string& name): CppUnit::TestCase(name)
|
||||
PathTest::PathTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1511,15 +1511,15 @@ void PathTest::testForDirectory()
|
||||
void PathTest::testExpand()
|
||||
{
|
||||
#if defined(POCO_OS_FAMILY_UNIX)
|
||||
std::string s = Path::expand("~/.bashrc");
|
||||
assert (s == Path::expand("$HOME/.bashrc"));
|
||||
assert (s == Environment::get("HOME") + "/.bashrc" ||
|
||||
s == Environment::get("HOME") + "//.bashrc");
|
||||
std::string s = Path::expand("~/.profile");
|
||||
assert (s == Path::expand("$HOME/.profile"));
|
||||
assert (s == Environment::get("HOME") + "/.profile" ||
|
||||
s == Environment::get("HOME") + "//.profile");
|
||||
Path p(s);
|
||||
s = Path::expand("$HOME/.bashrc");
|
||||
assert (s == Path::expand("~/.bashrc"));
|
||||
s = Path::expand("${HOME}/.bashrc");
|
||||
assert (s == Path::expand("~/.bashrc"));
|
||||
s = Path::expand("$HOME/.profile");
|
||||
assert (s == Path::expand("~/.profile"));
|
||||
s = Path::expand("${HOME}/.profile");
|
||||
assert (s == Path::expand("~/.profile"));
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
std::string s = Path::expand("%TMP%\\foo");
|
||||
assert (s == Environment::get("TMP") + "\\foo");
|
||||
|
||||
@@ -23,7 +23,7 @@ using Poco::Message;
|
||||
using Poco::DateTime;
|
||||
|
||||
|
||||
PatternFormatterTest::PatternFormatterTest(const std::string& name): CppUnit::TestCase(name)
|
||||
PatternFormatterTest::PatternFormatterTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ using namespace Poco;
|
||||
#define LARGEINC 100
|
||||
|
||||
|
||||
PriorityEventTest::PriorityEventTest(const std::string& name): CppUnit::TestCase(name)
|
||||
PriorityEventTest::PriorityEventTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace
|
||||
}
|
||||
|
||||
|
||||
PriorityNotificationQueueTest::PriorityNotificationQueueTest(const std::string& name): CppUnit::TestCase(name)
|
||||
PriorityNotificationQueueTest::PriorityNotificationQueueTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "Poco/Process.h"
|
||||
#include "Poco/Pipe.h"
|
||||
#include "Poco/PipeStream.h"
|
||||
#include "Poco/Thread.h"
|
||||
#include <csignal>
|
||||
|
||||
|
||||
@@ -26,7 +27,7 @@ using Poco::PipeInputStream;
|
||||
using Poco::PipeOutputStream;
|
||||
|
||||
|
||||
ProcessTest::ProcessTest(const std::string& name): CppUnit::TestCase(name)
|
||||
ProcessTest::ProcessTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -176,6 +177,27 @@ void ProcessTest::testIsRunning()
|
||||
}
|
||||
|
||||
|
||||
void ProcessTest::testIsRunningAllowsForTermination()
|
||||
{
|
||||
#if !defined(_WIN32_WCE)
|
||||
std::string name("TestApp");
|
||||
std::string cmd;
|
||||
|
||||
#if defined(POCO_OS_FAMILY_UNIX)
|
||||
cmd = "./";
|
||||
cmd += name;
|
||||
#else
|
||||
cmd = name;
|
||||
#endif
|
||||
|
||||
std::vector<std::string> args;
|
||||
ProcessHandle ph = Process::launch(cmd, args, 0, 0, 0);
|
||||
while (Process::isRunning(ph))
|
||||
Poco::Thread::sleep(100);
|
||||
#endif // !defined(_WIN32_WCE)
|
||||
}
|
||||
|
||||
|
||||
void ProcessTest::testSignalExitCode()
|
||||
{
|
||||
#if defined(POCO_OS_FAMILY_UNIX)
|
||||
@@ -213,6 +235,7 @@ CppUnit::Test* ProcessTest::suite()
|
||||
CppUnit_addTest(pSuite, ProcessTest, testLaunchRedirectOut);
|
||||
CppUnit_addTest(pSuite, ProcessTest, testLaunchEnv);
|
||||
CppUnit_addTest(pSuite, ProcessTest, testIsRunning);
|
||||
CppUnit_addTest(pSuite, ProcessTest, testIsRunningAllowsForTermination);
|
||||
CppUnit_addTest(pSuite, ProcessTest, testSignalExitCode);
|
||||
|
||||
return pSuite;
|
||||
|
||||
@@ -31,6 +31,7 @@ public:
|
||||
void testLaunchRedirectOut();
|
||||
void testLaunchEnv();
|
||||
void testIsRunning();
|
||||
void testIsRunningAllowsForTermination();
|
||||
void testSignalExitCode();
|
||||
|
||||
void setUp();
|
||||
|
||||
@@ -121,7 +121,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
RWLockTest::RWLockTest(const std::string& name): CppUnit::TestCase(name)
|
||||
RWLockTest::RWLockTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
using Poco::RandomInputStream;
|
||||
|
||||
|
||||
RandomStreamTest::RandomStreamTest(const std::string& name): CppUnit::TestCase(name)
|
||||
RandomStreamTest::RandomStreamTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
using Poco::UInt32;
|
||||
|
||||
|
||||
RandomTest::RandomTest(const std::string& name): CppUnit::TestCase(name)
|
||||
RandomTest::RandomTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ using Poco::RegularExpression;
|
||||
using Poco::RegularExpressionException;
|
||||
|
||||
|
||||
RegularExpressionTest::RegularExpressionTest(const std::string& name): CppUnit::TestCase(name)
|
||||
RegularExpressionTest::RegularExpressionTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ using Poco::SHA1Engine;
|
||||
using Poco::DigestEngine;
|
||||
|
||||
|
||||
SHA1EngineTest::SHA1EngineTest(const std::string& name): CppUnit::TestCase(name)
|
||||
SHA1EngineTest::SHA1EngineTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
SemaphoreTest::SemaphoreTest(const std::string& name): CppUnit::TestCase(name)
|
||||
SemaphoreTest::SemaphoreTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ using Poco::LibraryAlreadyLoadedException;
|
||||
typedef int (*GimmeFiveFunc)();
|
||||
|
||||
|
||||
SharedLibraryTest::SharedLibraryTest(const std::string& name): CppUnit::TestCase(name)
|
||||
SharedLibraryTest::SharedLibraryTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
using Poco::SharedMemory;
|
||||
|
||||
|
||||
SharedMemoryTest::SharedMemoryTest(const std::string& name): CppUnit::TestCase(name)
|
||||
SharedMemoryTest::SharedMemoryTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace
|
||||
class TestObject
|
||||
{
|
||||
public:
|
||||
TestObject(const std::string& data): _data(data)
|
||||
TestObject(const std::string& rData): _data(rData)
|
||||
{
|
||||
++_count;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ namespace
|
||||
}
|
||||
|
||||
|
||||
SharedPtrTest::SharedPtrTest(const std::string& name): CppUnit::TestCase(name)
|
||||
SharedPtrTest::SharedPtrTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ using Poco::DateTimeFormatter;
|
||||
using Poco::AutoPtr;
|
||||
|
||||
|
||||
SimpleFileChannelTest::SimpleFileChannelTest(const std::string& name): CppUnit::TestCase(name)
|
||||
SimpleFileChannelTest::SimpleFileChannelTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
using namespace Poco;
|
||||
|
||||
|
||||
SimpleHashTableTest::SimpleHashTableTest(const std::string& name): CppUnit::TestCase(name)
|
||||
SimpleHashTableTest::SimpleHashTableTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ using Poco::Timestamp;
|
||||
using Poco::Thread;
|
||||
|
||||
|
||||
StopwatchTest::StopwatchTest(const std::string& name): CppUnit::TestCase(name)
|
||||
StopwatchTest::StopwatchTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ using Poco::ASCIIEncoding;
|
||||
using Poco::StreamCopier;
|
||||
|
||||
|
||||
StreamConverterTest::StreamConverterTest(const std::string& name): CppUnit::TestCase(name)
|
||||
StreamConverterTest::StreamConverterTest(const std::string& rName): CppUnit::TestCase(rName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user