The TS-GitLab will have to shut down towards the end of the year — please think about migrating your projects to GitLab.com or GitHub.
(This is still a very early message, meant to keep you informed. There will be more urgent ones in the future.)

CMakeLists.txt 3.46 KB
Newer Older
Dion Haefner's avatar
Dion Haefner committed
1
message(STATUS "Handling system tests")
2
MESSAGE(STATUS "DUNE Libraries: ${DUNE_LIBS}")
Dion Haefner's avatar
Dion Haefner committed
3

4 5 6 7 8 9 10 11 12
function(dorie_add_system_test target metaini)
	configure_file(${metaini}.in ${CMAKE_CURRENT_LIST_DIR}/${metaini})
	dune_add_system_test(TARGET ${target} INIFILE ${metaini} SCRIPT test_dorie.py)
endfunction()

function(dorie_add_system_test_dependency test1 test2)
	set_tests_properties(${test1} PROPERTIES DEPENDS ${test2})
endfunction()

13
# dorie run: ODE tests
14 15 16
dorie_add_system_test(dorie ode_homogeneous_sand.mini)
dorie_add_system_test(dorie ode_homogeneous_silt.mini)
dorie_add_system_test(dorie ode_layered.mini)
17
dorie_add_system_test(dorie ode_linear_interpolator.mini)
18

19 20 21
# add target for ODE tests
add_custom_target(test_run_ode
    COMMAND ctest --output-on-failure --tests-regex ^dorie_ode.+$)
22

23 24
# dorie run: Reference tests
dorie_add_system_test(dorie-rfg parfield_muphi.mini)
25
dorie_add_system_test(dorie muphi.mini)
26 27 28 29 30 31 32
set_tests_properties(dorie-rfg_ref_muphi_pfg PROPERTIES FIXTURES_SETUP muphi_ref)
set_tests_properties(dorie_ref_muphi PROPERTIES FIXTURES_REQUIRED muphi_ref)

add_custom_target(test_run_ref
	COMMAND ctest --output-on-failure --tests-regex ^.+_ref_.+$
)

33 34 35 36
# dorie_add_system_test(dorie reference_2d.mini)
# dorie_add_system_test(dorie reference_3d.mini)
# dorie_add_system_test(dorie reference_evaporation.mini)
# dorie_add_system_test(dorie reference_interpolators.mini)
37 38

# dorie in parallel
39 40
dorie_add_system_test(dorie parallel_reference.mini)
dorie_add_system_test(dorie parallel_reference_compare.mini)
41

42 43 44 45 46 47 48 49 50 51
set_tests_properties(dorie_parallel_reference_0000 PROPERTIES FIXTURES_SETUP dorie_par)
set_tests_properties(dorie_parallel_reference_0001 PROPERTIES FIXTURES_SETUP dorie_par)
set_tests_properties(dorie_parallel_reference_compare_0000 PROPERTIES FIXTURES_REQUIRED dorie_par)
set_tests_properties(dorie_parallel_reference_compare_0001 PROPERTIES FIXTURES_REQUIRED dorie_par)
set_tests_properties(dorie_parallel_reference_compare_0002 PROPERTIES FIXTURES_REQUIRED dorie_par)
set_tests_properties(dorie_parallel_reference_compare_0003 PROPERTIES FIXTURES_REQUIRED dorie_par)

add_custom_target(test_run_parallel
	COMMAND ctest --output-on-failure --tests-regex ^dorie_parallel_.+$
)
52

53
# dorie exec tests
54 55
dorie_add_system_test(dorie-rfg parfield.mini)

56
dorie_add_system_test(dorie run.mini)
57 58
set_tests_properties(dorie-rfg_exec_0000 PROPERTIES FIXTURES_SETUP dorie_run)
set_tests_properties(dorie_exec_run PROPERTIES FIXTURES_REQUIRED dorie_run)
59

60
dorie_add_system_test(dorie plot.mini)
61
dorie_add_system_test_dependency(dorie_exec_plot dorie_exec_run)
62 63
set_tests_properties(dorie_exec_run PROPERTIES FIXTURES_SETUP dorie_plot)
set_tests_properties(dorie_exec_plot PROPERTIES FIXTURES_REQUIRED dorie_plot)
64 65

dorie_add_system_test(dorie create.mini)
66

67 68
add_custom_target(test_dorie_exec
	COMMAND ctest --output-on-failure --tests-regex ^.+_exec.+$
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
)

# dorie mass conservation
configure_file(mass_conservation.mini.in ${CMAKE_CURRENT_SOURCE_DIR}/mass_conservation.mini)
dune_add_system_test(
	SOURCE test-mass-conservation.cc
	BASENAME dorie_mass_conservation
	CREATED_TARGETS mc_target
	INIFILE mass_conservation.mini
)
message(STATUS "target called ${mc_target}")
dune_target_link_libraries(${mc_target} ${DUNE_LIBS})

add_custom_target(test_mass_conservation
	COMMAND ctest --output-on-failure --tests-regex ^dorie_mass_conservation_.+$
)

86 87 88
# dune excludes test targets from 'make all'; undo that here where applicable
set_property(TARGET dorie PROPERTY EXCLUDE_FROM_ALL 0)
set_property(TARGET dorie-rfg PROPERTY EXCLUDE_FROM_ALL 0)