mirror of
https://github.com/TREX-CoE/trexio.git
synced 2024-08-25 06:31:43 +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 "trexio.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -16,14 +13,16 @@ int main() {
|
|||||||
/*============== Main test launcher ================*/
|
/*============== Main test launcher ================*/
|
||||||
|
|
||||||
int rc;
|
int rc;
|
||||||
#ifdef HAVE_HDF5
|
|
||||||
rc = system("rm -f test_all.h5");
|
bool have_hdf5 = trexio_has_backend(TREXIO_HDF5);
|
||||||
|
if(have_hdf5) {
|
||||||
|
rc = system("rm -f -- test_all.h5");
|
||||||
assert (rc == 0);
|
assert (rc == 0);
|
||||||
test_write("test_all.h5", TREXIO_HDF5);
|
test_write("test_all.h5", TREXIO_HDF5);
|
||||||
test_read ("test_all.h5", TREXIO_HDF5);
|
test_read ("test_all.h5", TREXIO_HDF5);
|
||||||
rc = system("rm -f test_all.h5");
|
rc = system("rm -f -- test_all.h5");
|
||||||
assert (rc == 0);
|
assert (rc == 0);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
rc = system("rm -rf test_all.dir");
|
rc = system("rm -rf test_all.dir");
|
||||||
assert (rc == 0);
|
assert (rc == 0);
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
program test_trexio
|
program test_trexio
|
||||||
use trexio
|
use trexio
|
||||||
|
use, intrinsic :: iso_c_binding
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
|
logical :: have_hdf5
|
||||||
|
|
||||||
print * , "============================================"
|
print * , "============================================"
|
||||||
print'(a,a)' , " TREXIO VERSION STRING : ", TREXIO_PACKAGE_VERSION
|
print'(a,a)' , " TREXIO VERSION STRING : ", TREXIO_PACKAGE_VERSION
|
||||||
print'(a,i3)', " TREXIO MAJOR VERSION : ", TREXIO_VERSION_MAJOR
|
print'(a,i3)', " TREXIO MAJOR VERSION : ", TREXIO_VERSION_MAJOR
|
||||||
@ -19,14 +22,17 @@ program test_trexio
|
|||||||
|
|
||||||
! No way to conditionally check whether compilation was done with HDF5
|
! No way to conditionally check whether compilation was done with HDF5
|
||||||
! So temporarily disable the test for HDF5 back end at the moment
|
! So temporarily disable the test for HDF5 back end at the moment
|
||||||
! call system('rm -rf test_write_f.h5')
|
have_hdf5 = trexio_has_backend(TREXIO_HDF5)
|
||||||
! print *, 'call test_write(''test_write_f.h5'', TREXIO_HDF5)'
|
if (have_hdf5) then
|
||||||
! call test_write('test_write_f.h5', TREXIO_HDF5)
|
call system('rm -f -- test_write_f.h5')
|
||||||
! print *, 'call test_read(''test_write_f.h5'', TREXIO_HDF5)'
|
print *, 'call test_write(''test_write_f.h5'', TREXIO_HDF5)'
|
||||||
! call test_read('test_write_f.h5', TREXIO_HDF5)
|
call test_write('test_write_f.h5', TREXIO_HDF5)
|
||||||
! call system('rm -rf test_write_f.h5')
|
print *, 'call test_read(''test_write_f.h5'', TREXIO_HDF5)'
|
||||||
!
|
call test_read('test_write_f.h5', TREXIO_HDF5)
|
||||||
! call test_read_void('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
|
end program test_trexio
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user