You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ts...@apache.org on 2020/08/26 13:36:20 UTC

[logging-log4cxx] branch logcxx_510_cmake_vs2019_compat updated: Changes from https://github.com/apache/logging-log4cxx/commit/5ba150cbab4bda72288254aea8b02c8bb67926f5.

This is an automated email from the ASF dual-hosted git repository.

tschoening pushed a commit to branch logcxx_510_cmake_vs2019_compat
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git


The following commit(s) were added to refs/heads/logcxx_510_cmake_vs2019_compat by this push:
     new 8e3b950  Changes from https://github.com/apache/logging-log4cxx/commit/5ba150cbab4bda72288254aea8b02c8bb67926f5.
8e3b950 is described below

commit 8e3b9506745982ec928e815e5ffbb35b69e33c04
Author: Thorsten Schöning <ts...@am-soft.de>
AuthorDate: Wed Aug 26 15:36:12 2020 +0200

    Changes from https://github.com/apache/logging-log4cxx/commit/5ba150cbab4bda72288254aea8b02c8bb67926f5.
---
 src/test/cpp/CMakeLists.txt | 46 ++++++++++++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 19 deletions(-)

diff --git a/src/test/cpp/CMakeLists.txt b/src/test/cpp/CMakeLists.txt
index ad96032..643046b 100644
--- a/src/test/cpp/CMakeLists.txt
+++ b/src/test/cpp/CMakeLists.txt
@@ -50,6 +50,30 @@ add_subdirectory(spi)
 add_subdirectory(varia)
 add_subdirectory(xml)
 
+# Note: we need to include the APR DLLs on our path so that the tests will run.
+# The way that CMake sets the environment is that it actually generates a secondary file,
+# CTestTestfile.cmake, which sets the final properties of the test.
+# However, this results in a secondary quirk to the running of the tests: CMake uses
+# a semicolon to deliminate entries in a list!  Since the Windows PATH is semicolon-delimited
+# as well, CMake uses only the first entry in the list when setting the path.
+# So, we need to do a triple escape on the PATH that we want to set in order for CMake to
+# properly interpret the PATH
+if( WIN32 )
+	get_filename_component(APR_DLL_DIR "${APR_DLL}" DIRECTORY)
+	get_filename_component(APR_UTIL_DLL_DIR "${APR_UTIL_DLL}" DIRECTORY)
+
+	set(LOG4CXX_DLL_DIR "${CMAKE_INSTALL_PREFIX}\\bin")
+	set(XMLLIB_DLL_DIR  "C:\\Users\\tschoening\\Documents\\Svn\\Src\\Libs\\trunk\\C\\XML\\libexpat\\2.2.9\\src\\expat\\out\\install\\x64-Debug\\bin")
+
+	set(PATH_FOR_TESTS ${APR_DLL_DIR};${APR_UTIL_DLL_DIR};${LOG4CXX_DLL_DIR};${XMLLIB_DLL_DIR}\;)
+	list(REMOVE_DUPLICATES PATH_FOR_TESTS)
+	set(NORMAL_PATH $ENV{PATH})
+	set(ESCAPED_PATH "")
+	foreach( ENTRY ${PATH_FOR_TESTS}${NORMAL_PATH} )
+		set(ESCAPED_PATH "${ESCAPED_PATH}${ENTRY}\\\;")
+	endforeach()
+endif( WIN32 )
+
 foreach(testName IN LISTS ALL_LOG4CXX_TESTS)
     target_compile_definitions(${testName} PRIVATE ${LOG4CXX_COMPILE_DEFINITIONS} ${APR_COMPILE_DEFINITIONS} ${APR_UTIL_COMPILE_DEFINITIONS} )
     target_include_directories(${testName} PRIVATE ${CMAKE_CURRENT_LIST_DIR} $<TARGET_PROPERTY:log4cxx,INCLUDE_DIRECTORIES>)
@@ -58,32 +82,16 @@ foreach(testName IN LISTS ALL_LOG4CXX_TESTS)
         COMMAND ${testName} -v
         WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../resources
     )
+    set_tests_properties( ${testName} PROPERTIES TIMEOUT 120 )
 
     if(WIN32)
-        get_filename_component(APR_DLL_DIR "${APR_DLL}" DIRECTORY)
-        get_filename_component(APR_UTIL_DLL_DIR "${APR_UTIL_DLL}" DIRECTORY)
-        get_filename_component(LOG4CXX_DLL_DIR "${CMAKE_INSTALL_PREFIX}\\bin" DIRECTORY)
-        get_filename_component(XMLLIB_DLL_DIR "${XMLLIB_DLL}" DIRECTORY)
-
-        set(PATH_FOR_TESTS ${APR_DLL_DIR}\\$<SEMICOLON>${APR_UTIL_DLL_DIR}\\$<SEMICOLON>${LOG4CXX_DLL_DIR}\\$<SEMICOLON>C:\\Users\\tschoening\\Documents\\Svn\\Src\\Libs\\trunk\\C\\XML\\libexpat\\2.2.9\\src\\expat\\out\\install\\x64-Debug\\bin)
-        list(REMOVE_DUPLICATES PATH_FOR_TESTS)
-message( "${PATH_FOR_TESTS}" )
         if(${testName} STREQUAL socketservertestcase)
             set_tests_properties(socketservertestcase PROPERTIES
-                ENVIRONMENT "SOCKET_SERVER_PARAMETER_FILE=${START_SOCKET_SERVER_PARAMETER_FILE};PATH=${PATH_FOR_TESTS}"
+                ENVIRONMENT "SOCKET_SERVER_PARAMETER_FILE=${START_SOCKET_SERVER_PARAMETER_FILE};PATH=${ESCAPED_PATH}"
             )
         else()
-           set_property(TEST ${testName} APPEND PROPERTY
-                ENVIRONMENT "PATH=${APR_DLL_DIR}"
-           )
-           set_property(TEST ${testName} APPEND PROPERTY
-                ENVIRONMENT "PATH=${APR_UTIL_DLL_DIR}"
-           )
-           set_property(TEST ${testName} APPEND PROPERTY
-                ENVIRONMENT "PATH=${LOG4CXX_DLL_DIR}"
-           )
            set_tests_properties(${testName} PROPERTIES
-                ENVIRONMENT "TOTO=wonderful;key1=value1;key2=value2"
+                ENVIRONMENT "TOTO=wonderful;key1=value1;key2=value2;PATH=${ESCAPED_PATH}"
            )
         endif()
     else()