diff --git a/cmake/modules/DumuxTestMacros.cmake b/cmake/modules/DumuxTestMacros.cmake index aaf6e745e491c42cadbe80d4f2a7ccc5f674f4d6..cd8d9b860d54c751a03245f942d6126c8e3a5982 100644 --- a/cmake/modules/DumuxTestMacros.cmake +++ b/cmake/modules/DumuxTestMacros.cmake @@ -19,8 +19,24 @@ macro(add_dumux_test dumux_test dumux_test_executable dumux_test_executable_sour add_directory_test_target(_test_target) set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TEST_INCLUDE_FILE ${CMAKE_CURRENT_BINARY_DIR}/BuildTests.cmake) + + # if present, copy grids folder + set(grids_directory ${CMAKE_CURRENT_SOURCE_DIR}/grids) + if(EXISTS ${grids_directory} AND IS_DIRECTORY ${grids_directory}) + file(COPY ${grids_directory} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + endif() endif(NOT TARGET ${potential_test_target}) + # if present, copy input file + set(input_file ${CMAKE_CURRENT_SOURCE_DIR}/${dumux_test_executable}.input) + if(NOT EXISTS ${input_file}) + get_filename_component(base_source_name ${dumux_test_executable_source} NAME_WE) + set(input_file ${CMAKE_CURRENT_SOURCE_DIR}/${base_source_name}.input) + endif() + if(EXISTS ${input_file}) + file(COPY ${input_file} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + endif() + # add executable # check whether executable already exists if(NOT TARGET ${dumux_test_executable})