From a562274698ddfc707fd22abbdfc9ddba44da46ee Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Tue, 14 Jan 2020 10:28:52 +0100 Subject: [PATCH 1/5] Enable unit test in cmake build --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a88f94c3b..52c4a5e61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -107,12 +107,12 @@ matrix: - env: TEST_NAME="gcc-5.4.0 (CMake)" compiler: gcc script: - - cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all + - cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all && sudo -s PWD=`pwd` PATH=$PWD/cmake-3.5.1-Linux-x86_64/bin:$PATH POCO_BASE=$PWD CTEST_OUTPUT_ON_FAILURE=1 cmake --build cmake-build --target test - env: TEST_NAME="clang (CMake)" compiler: clang script: - - cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all + - cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all && sudo -s PWD=`pwd` PATH=$PWD/cmake-3.5.1-Linux-x86_64/bin:$PATH POCO_BASE=$PWD CTEST_OUTPUT_ON_FAILURE=1 cmake --build cmake-build --target test - env: TEST_NAME="arm-linux-gnueabi-g++ (CMake)" script: From 77f42f65e5609bd7f6c2fc79bf4f98deb08ccc99 Mon Sep 17 00:00:00 2001 From: Francis ANDRE Date: Tue, 14 Jan 2020 13:48:17 +0100 Subject: [PATCH 2/5] Add N7CppUnit10TestCallerI14ICMPSocketTestEE.testSendToReceiveFrom --- cppignore.lnx | 1 + 1 file changed, 1 insertion(+) diff --git a/cppignore.lnx b/cppignore.lnx index 78f8ca5cf..85a2b5411 100644 --- a/cppignore.lnx +++ b/cppignore.lnx @@ -13,3 +13,4 @@ N7CppUnit10TestCallerI9TimerTestEE.testScheduleInterval N7CppUnit10TestCallerI9TimerTestEE.testTimer N7CppUnit10TestCallerI15FileChannelTestEE.testPurgeAge N7CppUnit10TestCallerI8FileTestEE.testFileAttributes2 +N7CppUnit10TestCallerI14ICMPSocketTestEE.testSendToReceiveFrom From 885c5cbc55f01d5e679d7630bf88de3fffb51497 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Tue, 14 Jan 2020 21:45:56 +0100 Subject: [PATCH 3/5] Ignore tests in cmake from cppignore and set POCO_BASE environment. --- .travis.yml | 4 ++-- CppParser/testsuite/CMakeLists.txt | 3 ++- Crypto/testsuite/CMakeLists.txt | 3 ++- Data/MySQL/testsuite/CMakeLists.txt | 3 ++- Data/ODBC/testsuite/CMakeLists.txt | 3 ++- Data/PostgreSQL/testsuite/CMakeLists.txt | 3 ++- Data/SQLite/testsuite/CMakeLists.txt | 3 ++- Data/testsuite/CMakeLists.txt | 3 ++- Encodings/testsuite/CMakeLists.txt | 3 ++- Foundation/testsuite/CMakeLists.txt | 5 +++-- JSON/testsuite/CMakeLists.txt | 3 ++- JWT/testsuite/CMakeLists.txt | 3 ++- MongoDB/testsuite/CMakeLists.txt | 3 ++- Net/testsuite/CMakeLists.txt | 3 ++- NetSSL_OpenSSL/testsuite/CMakeLists.txt | 3 ++- NetSSL_Win/testsuite/CMakeLists.txt | 3 ++- PDF/testsuite/CMakeLists.txt | 3 ++- Redis/testsuite/CMakeLists.txt | 3 ++- Util/testsuite/CMakeLists.txt | 3 ++- XML/testsuite/CMakeLists.txt | 3 ++- Zip/testsuite/CMakeLists.txt | 3 ++- 21 files changed, 43 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index 52c4a5e61..ea1625611 100644 --- a/.travis.yml +++ b/.travis.yml @@ -107,12 +107,12 @@ matrix: - env: TEST_NAME="gcc-5.4.0 (CMake)" compiler: gcc script: - - cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all && sudo -s PWD=`pwd` PATH=$PWD/cmake-3.5.1-Linux-x86_64/bin:$PATH POCO_BASE=$PWD CTEST_OUTPUT_ON_FAILURE=1 cmake --build cmake-build --target test + - cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all && sudo -s PWD=`pwd` PATH=$PWD/cmake-3.5.1-Linux-x86_64/bin:$PATH CTEST_OUTPUT_ON_FAILURE=1 cmake --build cmake-build --target test - env: TEST_NAME="clang (CMake)" compiler: clang script: - - cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all && sudo -s PWD=`pwd` PATH=$PWD/cmake-3.5.1-Linux-x86_64/bin:$PATH POCO_BASE=$PWD CTEST_OUTPUT_ON_FAILURE=1 cmake --build cmake-build --target test + - cmake -H. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all && sudo -s PWD=`pwd` PATH=$PWD/cmake-3.5.1-Linux-x86_64/bin:$PATH CTEST_OUTPUT_ON_FAILURE=1 cmake --build cmake-build --target test - env: TEST_NAME="arm-linux-gnueabi-g++ (CMake)" script: diff --git a/CppParser/testsuite/CMakeLists.txt b/CppParser/testsuite/CMakeLists.txt index 5bee88ad6..5a1d0929f 100644 --- a/CppParser/testsuite/CMakeLists.txt +++ b/CppParser/testsuite/CMakeLists.txt @@ -15,6 +15,7 @@ if(ANDROID) add_test(NAME CppParser WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/CppParser-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME CppParser WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND CppParser-testrunner -all) + add_test(NAME CppParser WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND CppParser-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(CppParser PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) endif() target_link_libraries(CppParser-testrunner PUBLIC Poco::CppParser CppUnit) diff --git a/Crypto/testsuite/CMakeLists.txt b/Crypto/testsuite/CMakeLists.txt index be7c05b8f..89cb393f8 100644 --- a/Crypto/testsuite/CMakeLists.txt +++ b/Crypto/testsuite/CMakeLists.txt @@ -19,7 +19,8 @@ if(ANDROID) add_test(NAME Crypto WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Crypto-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME Crypto WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Crypto-testrunner -all) + add_test(NAME Crypto WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Crypto-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(Crypto PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) endif() target_link_libraries(Crypto-testrunner PUBLIC Poco::NetSSL Poco::XML CppUnit) if(UNIX AND NOT ANDROID) diff --git a/Data/MySQL/testsuite/CMakeLists.txt b/Data/MySQL/testsuite/CMakeLists.txt index 35a735e6a..34fe5b51a 100644 --- a/Data/MySQL/testsuite/CMakeLists.txt +++ b/Data/MySQL/testsuite/CMakeLists.txt @@ -15,6 +15,7 @@ if(ANDROID) add_test(NAME DataMySQL WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/DataMySQL-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME DataMySQL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND DataMySQL-testrunner -all) + add_test(NAME DataMySQL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND DataMySQL-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(DataMySQL PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) endif() target_link_libraries(DataMySQL-testrunner PUBLIC Poco::DataMySQL CppUnit) diff --git a/Data/ODBC/testsuite/CMakeLists.txt b/Data/ODBC/testsuite/CMakeLists.txt index afc723cf8..55d65f7ff 100644 --- a/Data/ODBC/testsuite/CMakeLists.txt +++ b/Data/ODBC/testsuite/CMakeLists.txt @@ -15,6 +15,7 @@ if(ANDROID) add_test(NAME DataODBC WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/DataODBC-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME DataODBC WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND DataODBC-testrunner -all) + add_test(NAME DataODBC WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND DataODBC-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(DataODBC PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) endif() target_link_libraries(DataODBC-testrunner PUBLIC Poco::DataODBC CppUnit) diff --git a/Data/PostgreSQL/testsuite/CMakeLists.txt b/Data/PostgreSQL/testsuite/CMakeLists.txt index 6e0f140e6..f2fe47dbd 100644 --- a/Data/PostgreSQL/testsuite/CMakeLists.txt +++ b/Data/PostgreSQL/testsuite/CMakeLists.txt @@ -11,5 +11,6 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF ) add_executable(DataPostgreSQL-testrunner ${TEST_SRCS} ) -add_test(NAME DataPostgreSQL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND DataPostgreSQL-testrunner -all) +add_test(NAME DataPostgreSQL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND DataPostgreSQL-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) +set_tests_properties(DataPostgreSQL PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) target_link_libraries(DataPostgreSQL-testrunner PUBLIC Poco::DataPostgreSQL CppUnit) diff --git a/Data/SQLite/testsuite/CMakeLists.txt b/Data/SQLite/testsuite/CMakeLists.txt index 3734acf6a..72a16199e 100644 --- a/Data/SQLite/testsuite/CMakeLists.txt +++ b/Data/SQLite/testsuite/CMakeLists.txt @@ -19,6 +19,7 @@ if(ANDROID) add_test(NAME DataSQLite WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/DataSQLite-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME DataSQLite WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND DataSQLite-testrunner -all) + add_test(NAME DataSQLite WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND DataSQLite-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(DataSQLite PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) endif() target_link_libraries(DataSQLite-testrunner PUBLIC Poco::DataSQLite CppUnit) diff --git a/Data/testsuite/CMakeLists.txt b/Data/testsuite/CMakeLists.txt index e02b601c9..7d5502031 100644 --- a/Data/testsuite/CMakeLists.txt +++ b/Data/testsuite/CMakeLists.txt @@ -24,6 +24,7 @@ if(ANDROID) add_test(NAME Data WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Data-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME Data WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Data-testrunner -all) + add_test(NAME Data WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Data-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(Data PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) endif() target_link_libraries(Data-testrunner PUBLIC Poco::Data CppUnit) diff --git a/Encodings/testsuite/CMakeLists.txt b/Encodings/testsuite/CMakeLists.txt index 4c1969a2e..8d7abf38b 100644 --- a/Encodings/testsuite/CMakeLists.txt +++ b/Encodings/testsuite/CMakeLists.txt @@ -19,7 +19,8 @@ if(ANDROID) add_test(NAME Encodings WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Encodings-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME Encodings WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Encodings-testrunner -all) + add_test(NAME Encodings WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Encodings-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(Encodings PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) endif() target_link_libraries(Encodings-testrunner PUBLIC Poco::Encodings CppUnit) diff --git a/Foundation/testsuite/CMakeLists.txt b/Foundation/testsuite/CMakeLists.txt index 368ea82d6..acab3e996 100644 --- a/Foundation/testsuite/CMakeLists.txt +++ b/Foundation/testsuite/CMakeLists.txt @@ -29,8 +29,9 @@ if(ANDROID) add_test(NAME Foundation WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;${CMAKE_BINARY_DIR}/bin/TestApp;${CMAKE_BINARY_DIR}/bin/TestLibrary.so" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Foundation-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME Foundation WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND Foundation-testrunner -all) - set_tests_properties(Foundation PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=.") # The SharedLibaryTest has to look for shared libraries in the working directory + add_test(NAME Foundation WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND Foundation-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(Foundation PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=.") # The SharedLibaryTest has to look for shared libraries in the working directory + set_property(TEST Foundation APPEND PROPERTY ENVIRONMENT "POCO_BASE=${CMAKE_SOURCE_DIR}") # The test is run in the runtime directory. So the test data is copied there too add_custom_command(TARGET Foundation-testrunner POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/data ) diff --git a/JSON/testsuite/CMakeLists.txt b/JSON/testsuite/CMakeLists.txt index 2b7b1b638..81988fb83 100644 --- a/JSON/testsuite/CMakeLists.txt +++ b/JSON/testsuite/CMakeLists.txt @@ -19,7 +19,8 @@ if(ANDROID) add_test(NAME JSON WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/JSON-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME JSON WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND JSON-testrunner -all) + add_test(NAME JSON WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND JSON-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(JSON PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) # The test is run in the build directory. So the test data is copied there too add_custom_command(TARGET JSON-testrunner POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data ) diff --git a/JWT/testsuite/CMakeLists.txt b/JWT/testsuite/CMakeLists.txt index b671d8318..9d7c32625 100644 --- a/JWT/testsuite/CMakeLists.txt +++ b/JWT/testsuite/CMakeLists.txt @@ -19,7 +19,8 @@ if(ANDROID) add_test(NAME JWT WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/JWT-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME JWT WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND JWT-testrunner -all) + add_test(NAME JWT WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND JWT-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(JWT PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) endif() target_link_libraries(JWT-testrunner PUBLIC Poco::JWT Poco::Crypto CppUnit) if(UNIX AND NOT ANDROID) diff --git a/MongoDB/testsuite/CMakeLists.txt b/MongoDB/testsuite/CMakeLists.txt index 45f98477d..01fb30fd5 100644 --- a/MongoDB/testsuite/CMakeLists.txt +++ b/MongoDB/testsuite/CMakeLists.txt @@ -19,6 +19,7 @@ if(ANDROID) add_test(NAME MongoDB WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/MongoDB-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME MongoDB WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND MongoDB-testrunner -all) + add_test(NAME MongoDB WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND MongoDB-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(MongoDB PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) endif() target_link_libraries(MongoDB-testrunner PUBLIC Poco::MongoDB CppUnit) diff --git a/Net/testsuite/CMakeLists.txt b/Net/testsuite/CMakeLists.txt index af3423d59..fc3b21e4f 100644 --- a/Net/testsuite/CMakeLists.txt +++ b/Net/testsuite/CMakeLists.txt @@ -19,6 +19,7 @@ if(ANDROID) add_test(NAME Net WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Net-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME Net WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Net-testrunner -all) + add_test(NAME Net WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Net-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(Net PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) endif() target_link_libraries(Net-testrunner PUBLIC Poco::Net Poco::Util Poco::XML CppUnit) diff --git a/NetSSL_OpenSSL/testsuite/CMakeLists.txt b/NetSSL_OpenSSL/testsuite/CMakeLists.txt index 4adf281ab..c4e0c81a2 100644 --- a/NetSSL_OpenSSL/testsuite/CMakeLists.txt +++ b/NetSSL_OpenSSL/testsuite/CMakeLists.txt @@ -19,7 +19,8 @@ if(ANDROID) add_test(NAME NetSSL WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/any.pem;${CMAKE_CURRENT_SOURCE_DIR}/rootcert.pem;${CMAKE_CURRENT_SOURCE_DIR}/testrunner.xml" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/NetSSL-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME NetSSL WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND NetSSL-testrunner -all) + add_test(NAME NetSSL WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND NetSSL-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(NetSSL PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) # The test is run in the build directory. So the test data is copied there too add_custom_command(TARGET NetSSL-testrunner POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/any.pem ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} diff --git a/NetSSL_Win/testsuite/CMakeLists.txt b/NetSSL_Win/testsuite/CMakeLists.txt index e707ac373..3d528820a 100644 --- a/NetSSL_Win/testsuite/CMakeLists.txt +++ b/NetSSL_Win/testsuite/CMakeLists.txt @@ -15,7 +15,8 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE ) add_executable(NetSSLWin-testrunner ${TEST_SRCS} ) -add_test(NAME NetSSLWin WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND NetSSLWin-testrunner -all) +add_test(NAME NetSSLWin WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND NetSSLWin-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) +set_tests_properties(NetSSLWin PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) target_link_libraries(NetSSLWin-testrunner PUBLIC Poco::NetSSL Poco::Util Poco::XML CppUnit) # The test is run in the build directory. So the test data is copied there too diff --git a/PDF/testsuite/CMakeLists.txt b/PDF/testsuite/CMakeLists.txt index 46829d4fa..bbc661b01 100644 --- a/PDF/testsuite/CMakeLists.txt +++ b/PDF/testsuite/CMakeLists.txt @@ -15,6 +15,7 @@ if(ANDROID) add_test(NAME PDF WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/PDF-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME PDF WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND PDF-testrunner -all) + add_test(NAME PDF WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND PDF-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(PDF PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) endif() target_link_libraries(PDF-testrunner PUBLIC Poco::PDF CppUnit ) diff --git a/Redis/testsuite/CMakeLists.txt b/Redis/testsuite/CMakeLists.txt index 4c3411730..77005bd7c 100644 --- a/Redis/testsuite/CMakeLists.txt +++ b/Redis/testsuite/CMakeLists.txt @@ -19,7 +19,8 @@ if(ANDROID) add_test(NAME Redis WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Redis-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME Redis WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Redis-testrunner -all) + add_test(NAME Redis WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Redis-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(Redis PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) endif() target_link_libraries(Redis-testrunner PUBLIC ${CMAKE_THREAD_LIBS_INIT} Poco::Redis CppUnit ) diff --git a/Util/testsuite/CMakeLists.txt b/Util/testsuite/CMakeLists.txt index 20621b452..1e52a2822 100644 --- a/Util/testsuite/CMakeLists.txt +++ b/Util/testsuite/CMakeLists.txt @@ -26,6 +26,7 @@ if(ANDROID) add_test(NAME Util WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Util-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME Util WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Util-testrunner -all) + add_test(NAME Util WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Util-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(Util PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) endif() target_link_libraries(Util-testrunner PUBLIC Poco::Util Poco::JSON Poco::XML CppUnit) diff --git a/XML/testsuite/CMakeLists.txt b/XML/testsuite/CMakeLists.txt index f15d3b069..7ded39a35 100644 --- a/XML/testsuite/CMakeLists.txt +++ b/XML/testsuite/CMakeLists.txt @@ -19,6 +19,7 @@ if(ANDROID) add_test(NAME XML WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/XML-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME XML WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND XML-testrunner -all) + add_test(NAME XML WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND XML-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(XML PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) endif() target_link_libraries(XML-testrunner PUBLIC Poco::XML CppUnit) diff --git a/Zip/testsuite/CMakeLists.txt b/Zip/testsuite/CMakeLists.txt index 61eb3e4fc..981fb4ea6 100644 --- a/Zip/testsuite/CMakeLists.txt +++ b/Zip/testsuite/CMakeLists.txt @@ -19,7 +19,8 @@ if(ANDROID) add_test(NAME Zip WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_FILES=${CMAKE_CURRENT_SOURCE_DIR}/data;" -DLIBRARY_DIR=${CMAKE_BINARY_DIR}/lib -DUNITTEST=${CMAKE_BINARY_DIR}/bin/Zip-testrunner -DTEST_PARAMETER=-all -P ${CMAKE_SOURCE_DIR}/cmake/ExecuteOnAndroid.cmake) else() - add_test(NAME Zip WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Zip-testrunner -all) + add_test(NAME Zip WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND Zip-testrunner -ignore ${CMAKE_SOURCE_DIR}/cppignore.lnx -all) + set_tests_properties(Zip PROPERTIES ENVIRONMENT POCO_BASE=${CMAKE_SOURCE_DIR}) # The test is run in the build directory. So the test data is copied there too add_custom_command(TARGET Zip-testrunner POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data ) From a31877372e16bd3aa6d255d977744dff628b6b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Wed, 15 Jan 2020 09:35:59 +0100 Subject: [PATCH 4/5] additional move support for Nullable and Optional --- Foundation/include/Poco/Nullable.h | 22 ++++++++++++++++ Foundation/include/Poco/Optional.h | 40 ++++++++++++++++++++++-------- 2 files changed, 52 insertions(+), 10 deletions(-) diff --git a/Foundation/include/Poco/Nullable.h b/Foundation/include/Poco/Nullable.h index 6e01ed303..cba9a6c6d 100644 --- a/Foundation/include/Poco/Nullable.h +++ b/Foundation/include/Poco/Nullable.h @@ -82,6 +82,14 @@ public: { } + Nullable(C&& value): + /// Creates a Nullable by moving the given value. + _value(value), + _isNull(false), + _null() + { + } + Nullable(const Nullable& other): /// Creates a Nullable by copying another one. _value(other._value), @@ -112,6 +120,14 @@ public: return *this; } + Nullable& assign(C&& value) + /// Assigns a value to the Nullable. + { + _value = value; + _isNull = false; + return *this; + } + Nullable& assign(const Nullable& other) /// Assigns another Nullable. { @@ -133,6 +149,12 @@ public: return assign(value); } + Nullable& operator = (C&& value) + /// Move-assigns a value to the Nullable. + { + return assign(value); + } + Nullable& operator = (const Nullable& other) /// Assigns another Nullable. { diff --git a/Foundation/include/Poco/Optional.h b/Foundation/include/Poco/Optional.h index 4f73d5e0a..acfff7fc7 100644 --- a/Foundation/include/Poco/Optional.h +++ b/Foundation/include/Poco/Optional.h @@ -32,7 +32,7 @@ class Optional /// that allows to introduce a specified/unspecified state /// to value objects. /// - /// An Optional can be default constructed. In this case, + /// An Optional can be default constructed. In this case, /// the Optional will have a Null value and isSpecified() will /// return false. Calling value()(without default value) on /// a Null object will throw a NullValueException. @@ -53,20 +53,27 @@ class Optional /// nillable == true. { public: - Optional(): + Optional(): /// Creates an empty Optional. _value(), _isSpecified(false) { } - Optional(const C& value): + Optional(const C& value): /// Creates a Optional with the given value. - _value(value), + _value(value), _isSpecified(true) { } - + + Optional(C&& value): + /// Creates a Optional by moving the given value. + _value(value), + _isSpecified(true) + { + } + Optional(const Optional& other): /// Creates a Optional by copying another one. _value(other._value), @@ -90,11 +97,19 @@ public: Optional& assign(const C& value) /// Assigns a value to the Optional. { - _value = value; + _value = value; _isSpecified = true; return *this; } - + + Optional& assign(C&& value) + /// Moves a value into the Optional. + { + _value = value; + _isSpecified = true; + return *this; + } + Optional& assign(const Optional& other) /// Assigns another Optional. { @@ -102,12 +117,17 @@ public: swap(tmp); return *this; } - + Optional& operator = (const C& value) { return assign(value); } + Optional& operator = (C&& value) + { + return assign(value); + } + Optional& operator = (const Optional& other) { return assign(other); @@ -140,7 +160,7 @@ public: const C& value(const C& deflt) const /// Returns the Optional's value, or the - /// given default value if the Optional's + /// given default value if the Optional's /// value has not been specified. { return _isSpecified ? _value : deflt; @@ -151,7 +171,7 @@ public: { return _isSpecified; } - + void clear() /// Clears the Optional. { From 04c52793cc2d61290d2bc3bbb23dbc9b27635546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Wed, 15 Jan 2020 10:18:56 +0100 Subject: [PATCH 5/5] update copyright date --- PageCompiler/src/PageCompiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PageCompiler/src/PageCompiler.cpp b/PageCompiler/src/PageCompiler.cpp index 1fd7e51ba..f013c5bb9 100644 --- a/PageCompiler/src/PageCompiler.cpp +++ b/PageCompiler/src/PageCompiler.cpp @@ -216,7 +216,7 @@ protected: helpFormatter.setHeader( "\n" "The POCO C++ Server Page Compiler.\n" - "Copyright (c) 2008-2019 by Applied Informatics Software Engineering GmbH.\n" + "Copyright (c) 2008-2020 by Applied Informatics Software Engineering GmbH.\n" "All rights reserved.\n\n" "This program compiles web pages containing embedded C++ code " "into a C++ class that can be used with the HTTP server "