merge dev and resolve conflicts

This commit is contained in:
Alex Fabijanic 2016-03-11 20:57:28 -08:00
commit 2a80322ecb
16 changed files with 65 additions and 52 deletions

View File

@ -47,8 +47,12 @@ before_script:
- chmod 755 ./travis/Linux/runtests.sh - chmod 755 ./travis/Linux/runtests.sh
- chmod 755 ./travis/OSX/runtests.sh - chmod 755 ./travis/OSX/runtests.sh
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then mysql -u root -e 'create database pocotestdb;'; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then mysql -u root -e 'create database pocotestdb;'; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then mysql --version; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then postgres --version; fi
matrix: matrix:
fast_finish: true
include: include:
- env: TEST_NAME="OSX clang (make) bundled" - env: TEST_NAME="OSX clang (make) bundled"
os: osx os: osx
@ -57,8 +61,7 @@ matrix:
- export CC="clang" - export CC="clang"
- export CXX="clang++" - export CXX="clang++"
- clang++ -x c++ /dev/null -dM -E - clang++ -x c++ /dev/null -dM -E
- ./configure --everything --omit=Data/ODBC,Data/MySQL,Data/PostgreSQL && make -s -j2 - ./configure --everything --omit=Data/ODBC,Data/MySQL,Data/SQLite,Data/PostgreSQL && make -s -j2 && sudo make install
- sudo make install
- ./travis/OSX/runtests.sh - ./travis/OSX/runtests.sh
- env: TEST_NAME="Linux gcc 4.6 (make) bundled" - env: TEST_NAME="Linux gcc 4.6 (make) bundled"
@ -101,10 +104,10 @@ matrix:
- ./configure --everything --config=Linux-clang && make -s -j2 - ./configure --everything --config=Linux-clang && make -s -j2
- ./travis/Linux/runtests.sh - ./travis/Linux/runtests.sh
#FIXME the -m64 option bring by the Linux config is not supported by arm-linux-gnueabi-g++ which makes this test failing - env: TEST_NAME="Linux arm-linux-gnueabi- (make)"
#FIXME - env: TEST_NAME="arm-linux-gnueabi- (make)" compiler: gcc
#FIXME script: script:
#FIXME - ./configure --omit=Data/ODBC,Data/MySQL,Crypto,NetSSL,PageCompiler && make -s -j2 CROSS_COMPILE=arm-linux-gnueabi- POCO_TARGET_OSARCH=armv7l - ./configure --omit=Data/ODBC,Data/MySQL,Data/PostgreSQL,Crypto,NetSSL,PageCompiler && make -s -j2 CROSS_COMPILE=arm-linux-gnueabi- POCO_TARGET_OSARCH=armv7l
- env: TEST_NAME="Linux gcc 4.6 (CMake)" - env: TEST_NAME="Linux gcc 4.6 (CMake)"
compiler: gcc compiler: gcc
@ -124,7 +127,7 @@ matrix:
- export POCO_BASE=`pwd` - export POCO_BASE=`pwd`
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_TESTS=ON .. && make -s -j2 && ctest -VV -E Data && cd .. - mkdir cmake-build && cd cmake-build && cmake -DENABLE_TESTS=ON .. && make -s -j2 && ctest -VV -E Data && cd ..
- env: TEST_NAME="clang 3.4 (CMake)" - env: TEST_NAME="Linux clang 3.4 (CMake)"
compiler: clang compiler: clang
script: script:
- source ./travis/ignored.sh - source ./travis/ignored.sh
@ -132,32 +135,25 @@ matrix:
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_TESTS=ON .. && make -s -j2 && ctest -VV -E Data && cd .. - 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)" - env: TEST_NAME="Linux arm-linux-gnueabi-g++ (CMake)"
compiler: gcc
script: script:
- export CC="arm-linux-gnueabi-gcc" - export CC="arm-linux-gnueabi-gcc"
- export CXX="arm-linux-gnueabi-g++" - export CXX="arm-linux-gnueabi-g++"
- source ./travis/ignored.sh - source ./travis/ignored.sh
- export POCO_BASE=`pwd` - export POCO_BASE=`pwd`
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=ON .. - mkdir cmake-build
- make -s -j2 && cd .. - 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)" - env: TEST_NAME="Linux arm-linux-gnueabihf-g++ (CMake)"
compiler: gcc
script: script:
- export CC="arm-linux-gnueabihf-gcc" - export CC="arm-linux-gnueabihf-gcc"
- export CXX="arm-linux-gnueabihf-g++" - export CXX="arm-linux-gnueabihf-g++"
- source ./travis/ignored.sh - source ./travis/ignored.sh
- export POCO_BASE=`pwd` - export POCO_BASE=`pwd`
- mkdir cmake-build && cd cmake-build && cmake -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=ON .. - mkdir cmake-build
- make -s -j2 && cd .. - cd cmake-build && cmake -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=ON .. && make -s -j2 && cd ..
# TODO osx build
# TODO run test suite
# script:
# - ./configure && make -s -i -j2
# - sudo ifconfig -a
# - sudo ifconfig venet0 multicast
# - sudo ifconfig -a
# - export POCO_BASE=`pwd`
# - sudo -E build/script/runtests.sh
# QA jobs for code analytics and metrics # QA jobs for code analytics and metrics
# build documentation and release # build documentation and release

View File

@ -140,7 +140,10 @@ include(DefinePlatformSpecifc)
# Collect the built libraries and include dirs, the will be used to create the PocoConfig.cmake file # Collect the built libraries and include dirs, the will be used to create the PocoConfig.cmake file
set(Poco_COMPONENTS "") set(Poco_COMPONENTS "")
if (ENABLE_CPPUNIT) # Pthreads/threads support
find_package(Threads REQUIRED)
if (ENABLE_TESTS)
add_subdirectory(CppUnit) add_subdirectory(CppUnit)
list(APPEND Poco_COMPONENTS "CppUnit") list(APPEND Poco_COMPONENTS "CppUnit")
endif () endif ()
@ -171,9 +174,6 @@ add_subdirectory(Net)
list(APPEND Poco_COMPONENTS "Net") list(APPEND Poco_COMPONENTS "Net")
endif() endif()
# Pthreads/threads support
find_package(Threads REQUIRED)
#NetSSL #NetSSL

View File

@ -55,8 +55,17 @@ void StatementExecutor::prepare(const std::string& query)
return; return;
} }
if (mysql_stmt_prepare(_pHandle, query.c_str(), static_cast<unsigned int>(query.length())) != 0) int rc = mysql_stmt_prepare(_pHandle, query.c_str(), static_cast<unsigned int>(query.length()));
throw StatementException("mysql_stmt_prepare error", _pHandle, query); if (rc != 0)
{
// retry if connection lost
int err = mysql_errno(_pSessionHandle);
if (err == 2006 /* CR_SERVER_GONE_ERROR */ || err == 2013 /* CR_SERVER_LOST */)
{
rc = mysql_stmt_prepare(_pHandle, query.c_str(), static_cast<unsigned int>(query.length()));
}
}
if (rc != 0) throw StatementException("mysql_stmt_prepare error", _pHandle, query);
_query = query; _query = query;
_state = STMT_COMPILED; _state = STMT_COMPILED;

View File

@ -18,4 +18,6 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
add_executable( ${TESTUNIT} ${TEST_SRCS} ) add_executable( ${TESTUNIT} ${TEST_SRCS} )
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
target_link_libraries( ${TESTUNIT} PocoDataSQLite PocoData PocoFoundation PocoCppUnit )
target_link_libraries( ${TESTUNIT} ${CMAKE_THREAD_LIBS_INIT} PocoDataSQLite PocoData PocoFoundation PocoCppUnit )

View File

@ -23,4 +23,6 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
add_executable( ${TESTUNIT} ${TEST_SRCS} ) add_executable( ${TESTUNIT} ${TEST_SRCS} )
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
target_link_libraries( ${TESTUNIT} PocoData PocoUtil PocoXML PocoFoundation PocoCppUnit)
target_link_libraries( ${TESTUNIT} ${CMAKE_THREAD_LIBS_INIT} PocoData PocoUtil PocoXML PocoFoundation PocoCppUnit)

View File

@ -111,14 +111,14 @@ endif(ANDROID)
# TODO: Why is this here? # TODO: Why is this here?
add_definitions( -DPCRE_STATIC) add_definitions( -DPCRE_STATIC)
# For SetAffinity # For POSIX threads on Unix
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
# We still need pthreads on Unix
set(SYSLIBS ${SYSLIBS} ${CMAKE_THREAD_LIBS_INIT})
INCLUDE (CheckFunctionExists) INCLUDE (CheckFunctionExists)
INCLUDE (CheckCXXSourceCompiles) INCLUDE (CheckCXXSourceCompiles)
INCLUDE (CheckLibraryExists) INCLUDE (CheckLibraryExists)
CHECK_LIBRARY_EXISTS(pthread pthread_setaffinity_np "pthread.h" HAVE_PTHREAD_SETAFFINITY_NP) CHECK_LIBRARY_EXISTS(pthread pthread_setaffinity_np "pthread.h" HAVE_PTHREAD_SETAFFINITY_NP)
#set(CMAKE_EXTRA_INCLUDE_FILES pthread.h)
#CHECK_FUNCTION_EXISTS(pthread_setaffinity_np HAVE_PTHREAD_SETAFFINITY_NP)
if(NOT HAVE_PTHREAD_SETAFFINITY_NP) if(NOT HAVE_PTHREAD_SETAFFINITY_NP)
message(STATUS "Platform has not PTHREAD_SETAFFINITY_NP") message(STATUS "Platform has not PTHREAD_SETAFFINITY_NP")
else(HAVE_PTHREAD_SETAFFINITY_NP) else(HAVE_PTHREAD_SETAFFINITY_NP)

View File

@ -98,7 +98,7 @@ public:
std::string toString() std::string toString()
{ {
std::string str; std::string str;
Var(*this).convert<std::string>(str); Var(*this).template convert<std::string>(str);
return str; return str;
} }

View File

@ -20,13 +20,6 @@
#include "Poco/UTFString.h" #include "Poco/UTFString.h"
using Poco::UnicodeConverter;
using Poco::UTF16Char;
using Poco::UTF16String;
using Poco::UTF32Char;
using Poco::UTF32String;
UnicodeConverterTest::UnicodeConverterTest(const std::string& rName): CppUnit::TestCase(rName) UnicodeConverterTest::UnicodeConverterTest(const std::string& rName): CppUnit::TestCase(rName)
{ {
} }
@ -39,14 +32,13 @@ UnicodeConverterTest::~UnicodeConverterTest()
void UnicodeConverterTest::testUTF16() void UnicodeConverterTest::testUTF16()
{ {
runTests<Poco::UTF16String>();
runTests<UTF16String>();
} }
void UnicodeConverterTest::testUTF32() void UnicodeConverterTest::testUTF32()
{ {
runTests<UTF32String>(); runTests<Poco::UTF32String>();
} }

View File

@ -18,7 +18,8 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
add_executable( ${TESTUNIT} ${TEST_SRCS} ) add_executable( ${TESTUNIT} ${TEST_SRCS} )
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
target_link_libraries( ${TESTUNIT} PocoJSON PocoFoundation PocoCppUnit )
target_link_libraries( ${TESTUNIT} ${CMAKE_THREAD_LIBS_INIT} PocoJSON PocoFoundation PocoCppUnit )
# The test is run in the build directory. So the test data is copied there too # The test is run in the build directory. So the test data is copied there too
add_custom_command(TARGET ${TESTUNIT} POST_BUILD add_custom_command(TARGET ${TESTUNIT} POST_BUILD

View File

@ -20,4 +20,6 @@ set(TESTUNIT "${LIBNAME}-testrunner")
add_executable( ${TESTUNIT} ${TEST_SRCS} ) add_executable( ${TESTUNIT} ${TEST_SRCS} )
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
target_link_libraries( ${TESTUNIT} PocoMongoDB PocoFoundation PocoCppUnit )
target_link_libraries( ${TESTUNIT} ${CMAKE_THREAD_LIBS_INIT} PocoMongoDB PocoFoundation PocoCppUnit )

View File

@ -18,4 +18,6 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
add_executable( ${TESTUNIT} ${TEST_SRCS} ) add_executable( ${TESTUNIT} ${TEST_SRCS} )
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
target_link_libraries( ${TESTUNIT} PocoNet PocoUtil PocoXML PocoFoundation PocoCppUnit)
target_link_libraries( ${TESTUNIT} ${CMAKE_THREAD_LIBS_INIT} PocoNet PocoUtil PocoXML PocoFoundation PocoCppUnit)

View File

@ -18,7 +18,8 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
add_executable( ${TESTUNIT} ${TEST_SRCS} ) add_executable( ${TESTUNIT} ${TEST_SRCS} )
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TESTUNIT} -all) add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TESTUNIT} -all)
target_link_libraries( ${TESTUNIT} PocoNetSSL PocoCrypto PocoNet PocoUtil PocoXML PocoFoundation PocoCppUnit)
target_link_libraries( ${TESTUNIT} ${CMAKE_THREAD_LIBS_INIT} PocoNetSSL PocoCrypto PocoNet PocoUtil PocoXML PocoFoundation PocoCppUnit)
# The test is run in the build directory. So the test data is copied there too # The test is run in the build directory. So the test data is copied there too
add_custom_command(TARGET ${TESTUNIT} POST_BUILD add_custom_command(TARGET ${TESTUNIT} POST_BUILD

View File

@ -20,4 +20,6 @@ set(TESTUNIT "${LIBNAME}-testrunner")
add_executable( ${TESTUNIT} ${TEST_SRCS} ) add_executable( ${TESTUNIT} ${TEST_SRCS} )
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
target_link_libraries( ${TESTUNIT} PocoRedis PocoFoundation PocoCppUnit )
target_link_libraries( ${TESTUNIT} ${CMAKE_THREAD_LIBS_INIT} PocoRedis PocoFoundation PocoCppUnit )

View File

@ -24,4 +24,6 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
add_executable( ${TESTUNIT} ${TEST_SRCS} ) add_executable( ${TESTUNIT} ${TEST_SRCS} )
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
target_link_libraries( ${TESTUNIT} PocoUtil PocoJSON PocoXML PocoFoundation PocoCppUnit)
target_link_libraries( ${TESTUNIT} ${CMAKE_THREAD_LIBS_INIT} PocoUtil PocoJSON PocoXML PocoFoundation PocoCppUnit)

View File

@ -18,4 +18,6 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
add_executable( ${TESTUNIT} ${TEST_SRCS} ) add_executable( ${TESTUNIT} ${TEST_SRCS} )
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
target_link_libraries( ${TESTUNIT} PocoXML PocoFoundation PocoCppUnit)
target_link_libraries( ${TESTUNIT} ${CMAKE_THREAD_LIBS_INIT} PocoXML PocoFoundation PocoCppUnit)

View File

@ -18,8 +18,8 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
add_executable( ${TESTUNIT} ${TEST_SRCS} ) add_executable( ${TESTUNIT} ${TEST_SRCS} )
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all) add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
#set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
target_link_libraries( ${TESTUNIT} PocoZip PocoNet PocoFoundation PocoCppUnit ) target_link_libraries( ${TESTUNIT} ${CMAKE_THREAD_LIBS_INIT} PocoZip PocoNet PocoFoundation PocoCppUnit )
# The test is run in the build directory. So the test data is copied there too # The test is run in the build directory. So the test data is copied there too
add_custom_command(TARGET ${TESTUNIT} POST_BUILD add_custom_command(TARGET ${TESTUNIT} POST_BUILD