Hi,
I would like to be able to add more tests to code I write in Tasks, typically code in cpp/hpp files I include in the Task.cpp. How?
Currently, the programs/tests framework only links against dune core, not the tasks. Is there a reason for this, or would you be willing to accept a PR on the matter?
Something like changing
|
macro(dune_test source) |
|
get_filename_component(executable ${source} NAME_WE) |
|
add_executable(${executable} ${source}) |
|
set_target_properties(${executable} PROPERTIES COMPILE_FLAGS |
|
"${DUNE_CXX_FLAGS}") |
|
target_link_libraries(${executable} dune-core ${DUNE_SYS_LIBS} |
|
${DUNE_VENDOR_LIBS}) |
|
ADD_TEST(${executable} ${executable}) |
|
endmacro(dune_test source) |
to
# Collect all task libraries for comprehensive test linking
macro(dune_test source)
get_filename_component(executable ${source} NAME_WE)
add_executable(${executable} ${source})
set_target_properties(${executable} PROPERTIES COMPILE_FLAGS
"${DUNE_CXX_FLAGS}")
add_dependencies(${executable} ${DUNE_STATIC_TASKS})
target_link_libraries(${executable} dune-core ${DUNE_STATIC_TASKS}
${DUNE_SYS_LIBS} ${DUNE_VENDOR_LIBS})
ADD_TEST(${executable} ${executable})
endmacro(dune_test source)
This also opens another question: should the task-level unit tests still be placed in programs/tests, or does it make more sense to put them in the task folder, along with Task.cpp and Task.cmake? (this of course requires further modification of CMakeLists.txt)
Hi,
I would like to be able to add more tests to code I write in Tasks, typically code in cpp/hpp files I include in the Task.cpp. How?
Currently, the programs/tests framework only links against dune core, not the tasks. Is there a reason for this, or would you be willing to accept a PR on the matter?
Something like changing
dune/CMakeLists.txt
Lines 452 to 460 in d6da27e
This also opens another question: should the task-level unit tests still be placed in programs/tests, or does it make more sense to put them in the task folder, along with Task.cpp and Task.cmake? (this of course requires further modification of CMakeLists.txt)