1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-12-22 20:35:44 +01:00

adapt tests to optional HDF5

This commit is contained in:
q-posev 2021-11-01 11:57:03 +01:00
parent d42dc7f449
commit c24484b86a
2 changed files with 18 additions and 10 deletions

View File

@ -1,3 +1,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "trexio.h"
#include <assert.h>
#include <stdio.h>
@ -12,12 +16,14 @@ int main() {
/*============== Main test launcher ================*/
int rc;
rc = system("rm -rf test_all.h5");
#ifdef HAVE_HDF5
rc = system("rm -f test_all.h5");
assert (rc == 0);
test_write("test_all.h5", TREXIO_HDF5);
test_read ("test_all.h5", TREXIO_HDF5);
rc = system("rm -rf test_all.h5");
rc = system("rm -f test_all.h5");
assert (rc == 0);
#endif
rc = system("rm -rf test_all.dir");
assert (rc == 0);

View File

@ -17,14 +17,16 @@ program test_trexio
call test_read_void('test_write_f.dir', TREXIO_TEXT)
call system('rm -rf test_write_f.h5')
print *, 'call test_write(''test_write_f.h5'', TREXIO_HDF5)'
call test_write('test_write_f.h5', TREXIO_HDF5)
print *, 'call test_read(''test_write_f.h5'', TREXIO_HDF5)'
call test_read('test_write_f.h5', TREXIO_HDF5)
call system('rm -rf test_write_f.h5')
call test_read_void('test_write_f.h5', TREXIO_HDF5)
! No way to conditionally check whether compilation was done with HDF5
! So temporarily disable the test for HDF5 back end at the moment
! call system('rm -rf test_write_f.h5')
! print *, 'call test_write(''test_write_f.h5'', TREXIO_HDF5)'
! call test_write('test_write_f.h5', TREXIO_HDF5)
! print *, 'call test_read(''test_write_f.h5'', TREXIO_HDF5)'
! call test_read('test_write_f.h5', TREXIO_HDF5)
! call system('rm -rf test_write_f.h5')
!
! call test_read_void('test_write_f.h5', TREXIO_HDF5)
end program test_trexio