Skip to content
Snippets Groups Projects
Commit 68853233 authored by Timo Koch's avatar Timo Koch Committed by Christoph Grüninger
Browse files

[test] Use new upstream add_dune_test macro for 3.0+

parent 56e136a8
No related branches found
No related tags found
1 merge request!31Feature/colebrookwhiteboundarylayer
...@@ -31,20 +31,33 @@ macro(add_dumux_test dumux_test dumux_test_executable dumux_test_executable_sour ...@@ -31,20 +31,33 @@ macro(add_dumux_test dumux_test dumux_test_executable dumux_test_executable_sour
dune_symlink_to_source_files(FILES ${input_file}.input) dune_symlink_to_source_files(FILES ${input_file}.input)
endif() endif()
# get optional arguments
# cannot use ARGN directly with list() command, copy to a variable first
set(dumux_test_args ${ARGN})
list(LENGTH dumux_test_args num_dumux_test_args)
# add executable # add executable
# check whether executable already exists # check whether executable already exists
if(NOT TARGET ${dumux_test_executable}) if(NOT TARGET ${dumux_test_executable})
add_executable(${dumux_test_executable} ${dumux_test_executable_source}) add_executable(${dumux_test_executable} ${dumux_test_executable_source})
endif() endif()
# get optional arguments
# cannot use ARGN directly with list() command, copy to a variable first
set(dumux_test_args ${ARGN})
list(LENGTH dumux_test_args num_dumux_test_args)
# add test # add test
add_test(${dumux_test} ${dumux_test_args}) if(DUNE_COMMON_VERSION_MAJOR VERSION_GREATER 2.4)
dune_add_test(NAME ${dumux_test}
TARGET ${dumux_test_executable}
COMMAND ${dumux_test_args}
SKIP_ON_77)
# tests always require the executable to run
set_tests_properties(${dumux_test} PROPERTIES REQUIRED_FILES ${dumux_test})
else()
# add test
add_test(${dumux_test} ${dumux_test_args})
# return code 77 should be interpreted as skipped test # return code 77 should be interpreted as skipped test
set_tests_properties(${dumux_test} PROPERTIES SKIP_RETURN_CODE 77) set_tests_properties(${dumux_test} PROPERTIES SKIP_RETURN_CODE 77)
# tests always require the executable to run
set_tests_properties(${dumux_test} PROPERTIES REQUIRED_FILES ${dumux_test_executable})
endif()
endmacro() endmacro()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment