svn commit: r1922116 - /subversion/trunk/CMakeLists.txt

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <[email protected]>
Author: rinrab
Date: Tue Nov 26 13:16:00 2024
New Revision: 1922116

URL: http://svn.apache.org/viewvc?rev=1922116&view=rev
Log:
cmake: Let pytests to create their temporary data in the subdirectory of
the build-dir.

* CMakeLists.txt
  (add_py_test): Initialize test_root with the root directory, where the tests
   will run and create the 'subversion/tests/cmdline directory' subdir inside
   it. Subversion test-suite will create its stuff in this subdir. Change
   abs_builddir value from the build-dir to newly created test_root variable
   and run the test commands in this directory then. 
  (py_test_path): Make it to be relative to CMAKE_CURRENT_SOURCE_DIR.

Modified:
    subversion/trunk/CMakeLists.txt

Modified: subversion/trunk/CMakeLists.txt
URL: http://svn.apache.org/viewvc/subversion/trunk/CMakeLists.txt?rev=1922116&r1=1922115&r2=1922116&view=diff
==============================================================================
--- subversion/trunk/CMakeLists.txt (original)
+++ subversion/trunk/CMakeLists.txt Tue Nov 26 13:16:00 2024
@@ -772,6 +772,9 @@ if(SVN_ENABLE_TESTS)
   set(run_tests_script "${CMAKE_CURRENT_SOURCE_DIR}/build/run_tests.py")
 
   function(add_py_test name prog)
+    set(test_root "${CMAKE_CURRENT_BINARY_DIR}/Testing")
+    file(MAKE_DIRECTORY "${test_root}/subversion/tests/cmdline")
+
     add_test(
       NAME
         "${name}"
@@ -783,8 +786,10 @@ if(SVN_ENABLE_TESTS)
         --log-to-stdout
         --set-log-level=WARNING
         ${CMAKE_CURRENT_SOURCE_DIR}
-        ${binary_dir}
+        ${test_root}
         "${prog}"
+      WORKING_DIRECTORY
+        ${test_root}
     )
   endfunction()
 
@@ -795,6 +800,7 @@ if(SVN_ENABLE_TESTS)
   foreach(py_test_path ${PYTHON_TESTS})
     # Keep `.py'.
     get_filename_component(py_test_name ${py_test_path} NAME_WLE)
+    file(RELATIVE_PATH py_test_path ${CMAKE_CURRENT_SOURCE_DIR} ${py_test_path})
     set(binary_dir $<TARGET_FILE_DIR:svn>)
 
     if(EXPAND_TESTS)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.