|
From: <log...@li...> - 2026-02-11 22:46:25
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Log4cpp Git repository.".
The branch, master has been updated
via 95bb9cc7e65302754f1d14ba81d47e6ce7bd95fb (commit)
via f473c4542e1ee7c60ca6cb2ebcd9e88a523a09fa (commit)
via ec038de18f8db6f49f4a7b4e3d38bd8084e3bb20 (commit)
via 5b1d56f234254000db81062acb07b7e51a7b6e12 (commit)
from f88cdf00ece1dbe04cd97bf78b614775e72e2e98 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/log4cpp/codegit/ci/
commit 95bb9cc7e65302754f1d14ba81d47e6ce7bd95fb
Author: Alexander Perepelkin <san...@us...>
Date: Wed Feb 11 23:13:37 2026 +0100
CMake: add test build support using CTest
Collect test*.cpp sources, build them against log4cpp (shared or static), and register tests with CTest.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9a3efe..bf1527e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -220,6 +220,8 @@ INSTALL (
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/log4cpp
)
+ENABLE_TESTING()
+ADD_SUBDIRECTORY ( tests )
IF ( LOG4CPP_BUILD_EXAMPLES AND LOG4CPP_IS_TOP_LEVEL )
ADD_SUBDIRECTORY ( examples )
ENDIF ()
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 0000000..5746144
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,104 @@
+# CMakeLists.txt
+#
+# Alexander Perepelkin san...@us...
+#
+# Builds tests for log4cpp.
+# Collects all test source files in this directory and builds them against the log4cpp library and threading support.
+# Tests can be executed using CTest.
+
+cmake_minimum_required(VERSION 3.10)
+
+project(log4cpp_tests LANGUAGES CXX)
+
+if(NOT TARGET log4cpp::log4cpp_shared)
+ message(STATUS "log4cpp::log4cpp_shared target not defined")
+endif()
+
+# pthread is needed on POSIX for threading
+find_package(Threads REQUIRED)
+
+# There are few CppUnit based test cases to include yet:
+#find_package(CppUnit REQUIRED)
+
+# Gather test sources
+file(GLOB TEST_EXECUTABLE_SOURCES "test*.cpp")
+# Remove CppUnit-based file for now
+list(REMOVE_ITEM TEST_EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/testNDCMain.cpp")
+
+if(WIN32)
+ list(REMOVE_ITEM TEST_EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/testbench.cpp")
+else()
+ list(REMOVE_ITEM TEST_EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/testNTEventLog.cpp")
+endif()
+
+# Helper sources (with no main function)
+set(TEST_AUX_SOURCES)
+
+if(NOT WIN32)
+list(APPEND TEST_AUX_SOURCES
+ Clock.cpp
+)
+endif()
+
+if(TEST_EXECUTABLE_SOURCES)
+ message(STATUS "Found test source files: ${TEST_EXECUTABLE_SOURCES}")
+else()
+ message(WARNING "No test sources found in ${CMAKE_CURRENT_SOURCE_DIR}")
+endif()
+
+if(TARGET log4cpp::log4cpp_shared)
+ set(LOG4CPP_TEST_LIB log4cpp::log4cpp_shared)
+elseif(TARGET log4cpp::log4cpp_static)
+ set(LOG4CPP_TEST_LIB log4cpp::log4cpp_static)
+else()
+ message(FATAL_ERROR "No log4cpp::log4cpp_shared or log4cpp::log4cpp_static library target found")
+endif()
+
+# Build each test as an executable
+foreach(test_source IN LISTS TEST_EXECUTABLE_SOURCES)
+ # Remove extension to form target name
+ get_filename_component(test_name ${test_source} NAME_WE)
+
+ add_executable(${test_name} ${test_source} ${TEST_AUX_SOURCES})
+
+ # include src dir for "Properties.hh"
+ TARGET_INCLUDE_DIRECTORIES ( ${test_name}
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+ )
+ # Link against log4cpp (shared or static) and threads; includes are added automatically
+ target_link_libraries(${test_name} PRIVATE ${LOG4CPP_TEST_LIB} Threads::Threads)
+
+ # Add test to CTest
+ add_test(NAME ${test_name} COMMAND ${test_name})
+ set_tests_properties(${test_name} PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+endforeach()
+
+# List of resource files to copy
+set(TEST_RESOURCE_FILES
+ "${CMAKE_CURRENT_SOURCE_DIR}/log4cpp.init"
+ "${CMAKE_CURRENT_SOURCE_DIR}/log4cpp.nt.property"
+ "${CMAKE_CURRENT_SOURCE_DIR}/log4cpp.properties"
+ "${CMAKE_CURRENT_SOURCE_DIR}/log4cpp.property"
+ "${CMAKE_CURRENT_SOURCE_DIR}/testConfig.log4cpp.dailyroll.properties"
+ "${CMAKE_CURRENT_SOURCE_DIR}/testConfig.log4cpp.dailyroll.nt.properties"
+ "${CMAKE_CURRENT_SOURCE_DIR}/testConfig.log4cpp.properties"
+ "${CMAKE_CURRENT_SOURCE_DIR}/testProperties.properties"
+)
+
+# Directory where resources will be copied
+set(TEST_RESOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+
+# Copy all resources at once
+add_custom_target(copy_test_resources ALL
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_RESOURCE_DIR}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${TEST_RESOURCE_FILES}
+ ${TEST_RESOURCE_DIR}
+ # Copy directory nesteddir
+ COMMAND ${CMAKE_COMMAND} -E copy_directory
+ ${CMAKE_CURRENT_SOURCE_DIR}/nesteddir
+ ${TEST_RESOURCE_DIR}/nesteddir
+ COMMENT "Copying test resource files to ${TEST_RESOURCE_DIR}"
+)
http://sourceforge.net/p/log4cpp/codegit/ci/
commit 95bb9cc7e65302754f1d14ba81d47e6ce7bd95fb
Author: Alexander Perepelkin <san...@us...>
Date: Wed Feb 11 23:13:37 2026 +0100
CMake: add test build support using CTest
Collect test*.cpp sources, build them against log4cpp (shared or static), and register tests with CTest.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9a3efe..bf1527e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -220,6 +220,8 @@ INSTALL (
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/log4cpp
)
+ENABLE_TESTING()
+ADD_SUBDIRECTORY ( tests )
IF ( LOG4CPP_BUILD_EXAMPLES AND LOG4CPP_IS_TOP_LEVEL )
ADD_SUBDIRECTORY ( examples )
ENDIF ()
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 0000000..5746144
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,104 @@
+# CMakeLists.txt
+#
+# Alexander Perepelkin san...@us...
+#
+# Builds tests for log4cpp.
+# Collects all test source files in this directory and builds them against the log4cpp library and threading support.
+# Tests can be executed using CTest.
+
+cmake_minimum_required(VERSION 3.10)
+
+project(log4cpp_tests LANGUAGES CXX)
+
+if(NOT TARGET log4cpp::log4cpp_shared)
+ message(STATUS "log4cpp::log4cpp_shared target not defined")
+endif()
+
+# pthread is needed on POSIX for threading
+find_package(Threads REQUIRED)
+
+# There are few CppUnit based test cases to include yet:
+#find_package(CppUnit REQUIRED)
+
+# Gather test sources
+file(GLOB TEST_EXECUTABLE_SOURCES "test*.cpp")
+# Remove CppUnit-based file for now
+list(REMOVE_ITEM TEST_EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/testNDCMain.cpp")
+
+if(WIN32)
+ list(REMOVE_ITEM TEST_EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/testbench.cpp")
+else()
+ list(REMOVE_ITEM TEST_EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/testNTEventLog.cpp")
+endif()
+
+# Helper sources (with no main function)
+set(TEST_AUX_SOURCES)
+
+if(NOT WIN32)
+list(APPEND TEST_AUX_SOURCES
+ Clock.cpp
+)
+endif()
+
+if(TEST_EXECUTABLE_SOURCES)
+ message(STATUS "Found test source files: ${TEST_EXECUTABLE_SOURCES}")
+else()
+ message(WARNING "No test sources found in ${CMAKE_CURRENT_SOURCE_DIR}")
+endif()
+
+if(TARGET log4cpp::log4cpp_shared)
+ set(LOG4CPP_TEST_LIB log4cpp::log4cpp_shared)
+elseif(TARGET log4cpp::log4cpp_static)
+ set(LOG4CPP_TEST_LIB log4cpp::log4cpp_static)
+else()
+ message(FATAL_ERROR "No log4cpp::log4cpp_shared or log4cpp::log4cpp_static library target found")
+endif()
+
+# Build each test as an executable
+foreach(test_source IN LISTS TEST_EXECUTABLE_SOURCES)
+ # Remove extension to form target name
+ get_filename_component(test_name ${test_source} NAME_WE)
+
+ add_executable(${test_name} ${test_source} ${TEST_AUX_SOURCES})
+
+ # include src dir for "Properties.hh"
+ TARGET_INCLUDE_DIRECTORIES ( ${test_name}
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+ )
+ # Link against log4cpp (shared or static) and threads; includes are added automatically
+ target_link_libraries(${test_name} PRIVATE ${LOG4CPP_TEST_LIB} Threads::Threads)
+
+ # Add test to CTest
+ add_test(NAME ${test_name} COMMAND ${test_name})
+ set_tests_properties(${test_name} PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+endforeach()
+
+# List of resource files to copy
+set(TEST_RESOURCE_FILES
+ "${CMAKE_CURRENT_SOURCE_DIR}/log4cpp.init"
+ "${CMAKE_CURRENT_SOURCE_DIR}/log4cpp.nt.property"
+ "${CMAKE_CURRENT_SOURCE_DIR}/log4cpp.properties"
+ "${CMAKE_CURRENT_SOURCE_DIR}/log4cpp.property"
+ "${CMAKE_CURRENT_SOURCE_DIR}/testConfig.log4cpp.dailyroll.properties"
+ "${CMAKE_CURRENT_SOURCE_DIR}/testConfig.log4cpp.dailyroll.nt.properties"
+ "${CMAKE_CURRENT_SOURCE_DIR}/testConfig.log4cpp.properties"
+ "${CMAKE_CURRENT_SOURCE_DIR}/testProperties.properties"
+)
+
+# Directory where resources will be copied
+set(TEST_RESOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+
+# Copy all resources at once
+add_custom_target(copy_test_resources ALL
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_RESOURCE_DIR}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${TEST_RESOURCE_FILES}
+ ${TEST_RESOURCE_DIR}
+ # Copy directory nesteddir
+ COMMAND ${CMAKE_COMMAND} -E copy_directory
+ ${CMAKE_CURRENT_SOURCE_DIR}/nesteddir
+ ${TEST_RESOURCE_DIR}/nesteddir
+ COMMENT "Copying test resource files to ${TEST_RESOURCE_DIR}"
+)
http://sourceforge.net/p/log4cpp/codegit/ci/
commit 95bb9cc7e65302754f1d14ba81d47e6ce7bd95fb
Author: Alexander Perepelkin <san...@us...>
Date: Wed Feb 11 23:13:37 2026 +0100
CMake: add test build support using CTest
Collect test*.cpp sources, build them against log4cpp (shared or static), and register tests with CTest.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9a3efe..bf1527e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -220,6 +220,8 @@ INSTALL (
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/log4cpp
)
+ENABLE_TESTING()
+ADD_SUBDIRECTORY ( tests )
IF ( LOG4CPP_BUILD_EXAMPLES AND LOG4CPP_IS_TOP_LEVEL )
ADD_SUBDIRECTORY ( examples )
ENDIF ()
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 0000000..5746144
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,104 @@
+# CMakeLists.txt
+#
+# Alexander Perepelkin san...@us...
+#
+# Builds tests for log4cpp.
+# Collects all test source files in this directory and builds them against the log4cpp library and threading support.
+# Tests can be executed using CTest.
+
+cmake_minimum_required(VERSION 3.10)
+
+project(log4cpp_tests LANGUAGES CXX)
+
+if(NOT TARGET log4cpp::log4cpp_shared)
+ message(STATUS "log4cpp::log4cpp_shared target not defined")
+endif()
+
+# pthread is needed on POSIX for threading
+find_package(Threads REQUIRED)
+
+# There are few CppUnit based test cases to include yet:
+#find_package(CppUnit REQUIRED)
+
+# Gather test sources
+file(GLOB TEST_EXECUTABLE_SOURCES "test*.cpp")
+# Remove CppUnit-based file for now
+list(REMOVE_ITEM TEST_EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/testNDCMain.cpp")
+
+if(WIN32)
+ list(REMOVE_ITEM TEST_EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/testbench.cpp")
+else()
+ list(REMOVE_ITEM TEST_EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/testNTEventLog.cpp")
+endif()
+
+# Helper sources (with no main function)
+set(TEST_AUX_SOURCES)
+
+if(NOT WIN32)
+list(APPEND TEST_AUX_SOURCES
+ Clock.cpp
+)
+endif()
+
+if(TEST_EXECUTABLE_SOURCES)
+ message(STATUS "Found test source files: ${TEST_EXECUTABLE_SOURCES}")
+else()
+ message(WARNING "No test sources found in ${CMAKE_CURRENT_SOURCE_DIR}")
+endif()
+
+if(TARGET log4cpp::log4cpp_shared)
+ set(LOG4CPP_TEST_LIB log4cpp::log4cpp_shared)
+elseif(TARGET log4cpp::log4cpp_static)
+ set(LOG4CPP_TEST_LIB log4cpp::log4cpp_static)
+else()
+ message(FATAL_ERROR "No log4cpp::log4cpp_shared or log4cpp::log4cpp_static library target found")
+endif()
+
+# Build each test as an executable
+foreach(test_source IN LISTS TEST_EXECUTABLE_SOURCES)
+ # Remove extension to form target name
+ get_filename_component(test_name ${test_source} NAME_WE)
+
+ add_executable(${test_name} ${test_source} ${TEST_AUX_SOURCES})
+
+ # include src dir for "Properties.hh"
+ TARGET_INCLUDE_DIRECTORIES ( ${test_name}
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+ )
+ # Link against log4cpp (shared or static) and threads; includes are added automatically
+ target_link_libraries(${test_name} PRIVATE ${LOG4CPP_TEST_LIB} Threads::Threads)
+
+ # Add test to CTest
+ add_test(NAME ${test_name} COMMAND ${test_name})
+ set_tests_properties(${test_name} PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+endforeach()
+
+# List of resource files to copy
+set(TEST_RESOURCE_FILES
+ "${CMAKE_CURRENT_SOURCE_DIR}/log4cpp.init"
+ "${CMAKE_CURRENT_SOURCE_DIR}/log4cpp.nt.property"
+ "${CMAKE_CURRENT_SOURCE_DIR}/log4cpp.properties"
+ "${CMAKE_CURRENT_SOURCE_DIR}/log4cpp.property"
+ "${CMAKE_CURRENT_SOURCE_DIR}/testConfig.log4cpp.dailyroll.properties"
+ "${CMAKE_CURRENT_SOURCE_DIR}/testConfig.log4cpp.dailyroll.nt.properties"
+ "${CMAKE_CURRENT_SOURCE_DIR}/testConfig.log4cpp.properties"
+ "${CMAKE_CURRENT_SOURCE_DIR}/testProperties.properties"
+)
+
+# Directory where resources will be copied
+set(TEST_RESOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+
+# Copy all resources at once
+add_custom_target(copy_test_resources ALL
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_RESOURCE_DIR}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${TEST_RESOURCE_FILES}
+ ${TEST_RESOURCE_DIR}
+ # Copy directory nesteddir
+ COMMAND ${CMAKE_COMMAND} -E copy_directory
+ ${CMAKE_CURRENT_SOURCE_DIR}/nesteddir
+ ${TEST_RESOURCE_DIR}/nesteddir
+ COMMENT "Copying test resource files to ${TEST_RESOURCE_DIR}"
+)
http://sourceforge.net/p/log4cpp/codegit/ci/
commit 95bb9cc7e65302754f1d14ba81d47e6ce7bd95fb
Author: Alexander Perepelkin <san...@us...>
Date: Wed Feb 11 23:13:37 2026 +0100
CMake: add test build support using CTest
Collect test*.cpp sources, build them against log4cpp (shared or static), and register tests with CTest.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9a3efe..bf1527e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -220,6 +220,8 @@ INSTALL (
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/log4cpp
)
+ENABLE_TESTING()
+ADD_SUBDIRECTORY ( tests )
IF ( LOG4CPP_BUILD_EXAMPLES AND LOG4CPP_IS_TOP_LEVEL )
ADD_SUBDIRECTORY ( examples )
ENDIF ()
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 0000000..5746144
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,104 @@
+# CMakeLists.txt
+#
+# Alexander Perepelkin san...@us...
+#
+# Builds tests for log4cpp.
+# Collects all test source files in this directory and builds them against the log4cpp library and threading support.
+# Tests can be executed using CTest.
+
+cmake_minimum_required(VERSION 3.10)
+
+project(log4cpp_tests LANGUAGES CXX)
+
+if(NOT TARGET log4cpp::log4cpp_shared)
+ message(STATUS "log4cpp::log4cpp_shared target not defined")
+endif()
+
+# pthread is needed on POSIX for threading
+find_package(Threads REQUIRED)
+
+# There are few CppUnit based test cases to include yet:
+#find_package(CppUnit REQUIRED)
+
+# Gather test sources
+file(GLOB TEST_EXECUTABLE_SOURCES "test*.cpp")
+# Remove CppUnit-based file for now
+list(REMOVE_ITEM TEST_EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/testNDCMain.cpp")
+
+if(WIN32)
+ list(REMOVE_ITEM TEST_EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/testbench.cpp")
+else()
+ list(REMOVE_ITEM TEST_EXECUTABLE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/testNTEventLog.cpp")
+endif()
+
+# Helper sources (with no main function)
+set(TEST_AUX_SOURCES)
+
+if(NOT WIN32)
+list(APPEND TEST_AUX_SOURCES
+ Clock.cpp
+)
+endif()
+
+if(TEST_EXECUTABLE_SOURCES)
+ message(STATUS "Found test source files: ${TEST_EXECUTABLE_SOURCES}")
+else()
+ message(WARNING "No test sources found in ${CMAKE_CURRENT_SOURCE_DIR}")
+endif()
+
+if(TARGET log4cpp::log4cpp_shared)
+ set(LOG4CPP_TEST_LIB log4cpp::log4cpp_shared)
+elseif(TARGET log4cpp::log4cpp_static)
+ set(LOG4CPP_TEST_LIB log4cpp::log4cpp_static)
+else()
+ message(FATAL_ERROR "No log4cpp::log4cpp_shared or log4cpp::log4cpp_static library target found")
+endif()
+
+# Build each test as an executable
+foreach(test_source IN LISTS TEST_EXECUTABLE_SOURCES)
... 62 lines suppressed ...
hooks/post-receive
--
Log4cpp Git repository.
|