2021-11-17 14:00:35 +01:00
|
|
|
|
2021-11-30 16:33:30 +01:00
|
|
|
# ================= TESTING =================
|
2021-11-17 14:00:35 +01:00
|
|
|
|
|
|
|
# Create a list of tests for TEXT back end.
|
|
|
|
set(Tests_text
|
|
|
|
open_text
|
|
|
|
io_dset_float_text
|
|
|
|
io_dset_str_text
|
2021-11-30 16:33:30 +01:00
|
|
|
io_dset_sparse_text
|
2022-04-12 00:45:59 +02:00
|
|
|
io_determinant_text
|
2021-11-17 14:00:35 +01:00
|
|
|
io_safe_dset_float_text
|
|
|
|
io_dset_int_text
|
|
|
|
io_num_text
|
|
|
|
io_str_text
|
2022-01-24 10:12:44 +01:00
|
|
|
delete_group_text
|
2021-11-17 14:00:35 +01:00
|
|
|
overwrite_all_text
|
2022-04-13 10:44:58 +02:00
|
|
|
pre_close
|
2021-11-17 14:00:35 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
if(ENABLE_HDF5)
|
|
|
|
# Create a list of tests for HDF5 back end.
|
|
|
|
set(Tests_hdf5
|
|
|
|
open_hdf5
|
|
|
|
io_dset_float_hdf5
|
|
|
|
io_dset_str_hdf5
|
2021-12-08 17:24:16 +01:00
|
|
|
io_dset_sparse_hdf5
|
2022-04-12 00:45:59 +02:00
|
|
|
io_determinant_hdf5
|
2021-11-17 14:00:35 +01:00
|
|
|
io_safe_dset_float_hdf5
|
|
|
|
io_dset_int_hdf5
|
|
|
|
io_num_hdf5
|
|
|
|
io_str_hdf5
|
2022-01-24 10:12:44 +01:00
|
|
|
delete_group_hdf5
|
2021-11-17 14:00:35 +01:00
|
|
|
overwrite_all_hdf5
|
|
|
|
)
|
|
|
|
|
|
|
|
# Set ${Tests} variable to the complete list of tests.
|
|
|
|
set(Tests io_all ${Tests_text} ${Tests_hdf5})
|
|
|
|
else()
|
|
|
|
set(Tests ${Tests_text})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Compile each TREXIO test as an executable and add them to CTest using add_test.
|
|
|
|
foreach(Test ${Tests})
|
|
|
|
add_executable(${Test} ${Test}.c)
|
|
|
|
target_link_libraries(${Test} PRIVATE trexio)
|
|
|
|
add_test(NAME ${Test} COMMAND $<TARGET_FILE:${Test}>)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# Add Fortran test and link it with trexio_f (Fortran module) library.
|
|
|
|
add_executable(test_f test_f.f90)
|
|
|
|
target_link_libraries(test_f PRIVATE trexio_f)
|
2022-01-18 10:50:11 +01:00
|
|
|
if(TREXIO_DEVEL)
|
|
|
|
set_source_files_properties(${TREXIO_MOD_FILE}
|
|
|
|
PROPERTIES GENERATED TRUE)
|
|
|
|
endif()
|
2021-11-17 14:00:35 +01:00
|
|
|
add_test(NAME test_f COMMAND $<TARGET_FILE:test_f>)
|