tests/hdf5: work around some problems

There are two cases that won't work (these are taken from fortran/9
cpp), using gfortran with a non-gcc compiler on windows, or using
gfortran with apple clang. The latter is due to default search paths,
which we can fix, but is out of scope for this MR.
This commit is contained in:
Dylan Baker 2020-09-24 11:54:02 -07:00
parent 54329eeed7
commit bffd981246
1 changed files with 20 additions and 5 deletions

View File

@ -19,11 +19,26 @@ if add_languages('cpp', required: false)
test('HDF5 C++', execpp, timeout: 30)
endif
# --- Fortran tests
if add_languages('fortran', required: false)
test_fortran = add_languages('fortran', required: false)
if test_fortran
cpp = meson.get_compiler('cpp')
fc = meson.get_compiler('fortran')
if host_machine.system() == 'darwin' and cpp.get_id() == 'clang' and fc.get_id() == 'gcc'
# Search paths don't work correctly here and -lgfortran doesn't work
test_fortran = false
elif host_machine.system() == 'windows' and cpp.get_id() != 'gcc' and fc.get_id() == 'gcc'
# mixing gfotran with non-gcc doesn't work on windows
test_fortran = false
endif
# --- Fortran tests
if test_fortran
h5f = dependency('hdf5', language : 'fortran', required : false, disabler: true, method : method)
exef = executable('exef', 'main.f90', dependencies : h5f)
test('HDF5 Fortran', exef, timeout: 30)
endif
endif
# Check we can apply a version constraint