File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
src/core/io/tests/test_files/has_includes/folder2 Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,12 @@ endfunction()
213213##
214214# Copy support files to the test directory. The support files are copied to a directory that is shared by all tests
215215# that use the given test base name.
216+ #
217+ # Usage: four_c_add_support_files_to_test(TEST_NAME_BASE [SUPPORT_FILES <file1> <file2> ...])
218+ #
219+ # TEST_NAME_BASE: The base name of the test. Returned by four_c_auto_define_tests().
220+ # SUPPORT_FILES: A list of files to be copied. The files are copied to the test directory. If any of the files
221+ # have an .in suffix, they are configured (replacing all @VAR@ expressions) before copying.
216222##
217223function (four_c_add_support_files_to_test _test_name_base)
218224 if (NOT FOUR_C_WITH_GOOGLETEST)
@@ -245,7 +251,15 @@ function(four_c_add_support_files_to_test _test_name_base)
245251 "Copying support file ${_support_file} to ${FOUR_C_TEST_SUPPORT_FILE_DIR} /${_support_file} "
246252 )
247253
248- configure_file (${_support_file} ${FOUR_C_TEST_SUPPORT_FILE_DIR} /${_support_file} )
254+ # If the file is an .in file that requires configuration, do so.
255+ if (_support_file MATCHES ".in$" )
256+ # Strip the .in suffix
257+ string (REGEX REPLACE ".in$" "" _support_file_wo_in ${_support_file} )
258+ configure_file (${_support_file} ${FOUR_C_TEST_SUPPORT_FILE_DIR} /${_support_file_wo_in} @ONLY)
259+ # Otherwise, just copy the file
260+ else ()
261+ configure_file (${_support_file} ${FOUR_C_TEST_SUPPORT_FILE_DIR} /${_support_file} COPYONLY )
262+ endif ()
249263 endforeach ()
250264
251265endfunction ()
File renamed without changes.
You can’t perform that action at this time.
0 commit comments