Author: rinrab
Date: Thu Aug 1 18:55:24 2024
New Revision: 1919625
URL: http://svn.apache.org/viewvc?rev=1919625&view=rev
Log:
On the 'cmake' branch: Add Python tests using the add_test() command.
We are currently, using built-in CMake tool for testing, CTest. In this
commit, the Python tests will be also added into it, as addition to the
C-Tests. Also, add finding of Python executable, which is required for
running the Python test-suite. These tests will be added only if the
SVN_BUILD_TESTS enabled, at the same time with c-tests. For retrieving
the tests, we will simply enumerate all *.py files in the
subversion/tests/cmdline directory. Afterwards, we will use the
run_tests.py script for running the tests and streaming the output.
* CMakeLists.txt
(tests): Use add_test() command for each python test file to run them.
Modified:
subversion/branches/cmake/CMakeLists.txt
Modified: subversion/branches/cmake/CMakeLists.txt
URL:
http://svn.apache.org/viewvc/subversion/branches/cmake/CMakeLists.txt?rev=1919625&r1=1919624&r2=1919625&view=diff
==============================================================================
--- subversion/branches/cmake/CMakeLists.txt (original)
+++ subversion/branches/cmake/CMakeLists.txt Thu Aug 1 18:55:24 2024
@@ -446,6 +446,34 @@ set(CMAKE_STATIC_LIBRARY_PREFIX "")
include("build/cmake/targets.cmake")
+if(SVN_BUILD_TESTS)
+ find_package(Python3 COMPONENTS Interpreter REQUIRED)
+
+ file(GLOB PYTHON_TESTS
+ "subversion/tests/cmdline/*.py"
+ )
+
+ foreach(py_test_path ${PYTHON_TESTS})
+ # Keep `.py'.
+ get_filename_component(py_test_name ${py_test_path} NAME)
+
+ add_test(
+ NAME
+ ${py_test_name}
+ COMMAND
+ "${Python3_EXECUTABLE}"
"${CMAKE_CURRENT_SOURCE_DIR}/build/run_tests.py"
+ --bin ${CMAKE_CURRENT_BINARY_DIR}
+ --tools-bin ${CMAKE_CURRENT_BINARY_DIR}
+ --verbose
+ --log-to-stdout
+ --set-log-level=WARNING
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${py_test_path}
+ )
+ endforeach()
+endif()
+
if (SVN_BUILD_SVNXX)
target_include_directories(libsvnxx PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/subversion/bindings/cxx/include"