mirror of
https://github.com/TREX-CoE/trexio.git
synced 2025-04-25 18:04:44 +02:00
conditional HDF5 tests based on the trexio_has_backend function
This commit is contained in:
parent
954ee4216c
commit
e18dcd5c4a
@ -1,7 +1,4 @@
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#include "trexio.h"
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
@ -16,14 +13,16 @@ int main() {
|
||||
/*============== Main test launcher ================*/
|
||||
|
||||
int rc;
|
||||
#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 -f test_all.h5");
|
||||
assert (rc == 0);
|
||||
#endif
|
||||
|
||||
bool have_hdf5 = trexio_has_backend(TREXIO_HDF5);
|
||||
if(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 -f -- test_all.h5");
|
||||
assert (rc == 0);
|
||||
}
|
||||
|
||||
rc = system("rm -rf test_all.dir");
|
||||
assert (rc == 0);
|
||||
|
@ -1,6 +1,9 @@
|
||||
program test_trexio
|
||||
use trexio
|
||||
use, intrinsic :: iso_c_binding
|
||||
implicit none
|
||||
|
||||
logical :: have_hdf5
|
||||
|
||||
print * , "============================================"
|
||||
print'(a,a)' , " TREXIO VERSION STRING : ", TREXIO_PACKAGE_VERSION
|
||||
@ -19,14 +22,17 @@ program test_trexio
|
||||
|
||||
! 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)
|
||||
have_hdf5 = trexio_has_backend(TREXIO_HDF5)
|
||||
if (have_hdf5) then
|
||||
call system('rm -f -- 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 -f -- test_write_f.h5')
|
||||
|
||||
call test_read_void('test_write_f.h5', TREXIO_HDF5)
|
||||
endif
|
||||
|
||||
end program test_trexio
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user