ci: improve robustness
* netcf * hdf5 * scalapack * coarray
This commit is contained in:
parent
f1d370247f
commit
ccbb20e881
|
@ -15,7 +15,7 @@ coarray = dependency('coarray')
|
||||||
# this has to invoke a run of "sync all" to verify the MPI stack is functioning,
|
# this has to invoke a run of "sync all" to verify the MPI stack is functioning,
|
||||||
# particularly for dynamic linking
|
# particularly for dynamic linking
|
||||||
if fc.run('sync all; end', dependencies: coarray, name: 'Coarray link & run').returncode() != 0
|
if fc.run('sync all; end', dependencies: coarray, name: 'Coarray link & run').returncode() != 0
|
||||||
error('The coarray stack (including MPI) did not link correctly so that a simple test could run.')
|
error('MESON_SKIP_TEST: coarray stack (including MPI) did not link correctly so that a simple test could run.')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
exe = executable('hello', 'main.f90',
|
exe = executable('hello', 'main.f90',
|
||||||
|
|
|
@ -11,14 +11,14 @@ exec = executable('exec', 'main.c', dependencies : h5c)
|
||||||
test('HDF5 C', exec, timeout: 30)
|
test('HDF5 C', exec, timeout: 30)
|
||||||
|
|
||||||
# --- C++ tests
|
# --- C++ tests
|
||||||
if add_languages('cpp')
|
if add_languages('cpp', required: false)
|
||||||
h5cpp = dependency('hdf5', language : 'cpp', required : false, disabler: true)
|
h5cpp = dependency('hdf5', language : 'cpp', required : false, disabler: true)
|
||||||
execpp = executable('execpp', 'main.cpp', dependencies : h5cpp)
|
execpp = executable('execpp', 'main.cpp', dependencies : h5cpp)
|
||||||
test('HDF5 C++', execpp, timeout: 30)
|
test('HDF5 C++', execpp, timeout: 30)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# --- Fortran tests
|
# --- Fortran tests
|
||||||
if add_languages('fortran')
|
if add_languages('fortran', required: false)
|
||||||
h5f = dependency('hdf5', language : 'fortran', required : false, disabler: true)
|
h5f = dependency('hdf5', language : 'fortran', required : false, disabler: true)
|
||||||
exef = executable('exef', 'main.f90', dependencies : h5f)
|
exef = executable('exef', 'main.f90', dependencies : h5f)
|
||||||
test('HDF5 Fortran', exef, timeout: 30)
|
test('HDF5 Fortran', exef, timeout: 30)
|
||||||
|
|
|
@ -1,31 +1,32 @@
|
||||||
project('netcdf_test', 'c', 'cpp')
|
project('netcdf_test', 'c')
|
||||||
|
|
||||||
|
cc = meson.get_compiler('c')
|
||||||
# --- C tests
|
c_code = '''#include <netcdf.h>
|
||||||
nc_c = dependency('netcdf', language : 'c', required : false)
|
int main(void) { return 0; }'''
|
||||||
|
# --- C
|
||||||
|
nc_c = dependency('netcdf', language : 'c', required : false, disabler: true)
|
||||||
|
if not cc.links(c_code, dependencies: nc_c, name: 'NetCDF C')
|
||||||
|
nc_c = disabler()
|
||||||
|
endif
|
||||||
if not nc_c.found()
|
if not nc_c.found()
|
||||||
error('MESON_SKIP_TEST: NetCDF C library not found, skipping NetCDF framework tests.')
|
error('MESON_SKIP_TEST: NetCDF C library not found, skipping NetCDF framework tests.')
|
||||||
endif
|
endif
|
||||||
exec = executable('exec', 'main.c', dependencies : nc_c)
|
exec = executable('exec', 'main.c', dependencies : nc_c)
|
||||||
|
test('NetCDF C', exec, timeout: 15)
|
||||||
|
|
||||||
test('NetCDF C', exec)
|
# --- C++
|
||||||
|
if add_languages('cpp', required: false)
|
||||||
# --- C++ tests
|
nc_cpp = dependency('netcdf', language : 'cpp', required : false, disabler: true)
|
||||||
nc_cpp = dependency('netcdf', language : 'cpp', required : false)
|
|
||||||
if nc_cpp.found()
|
|
||||||
execpp = executable('execpp', 'main.cpp', dependencies : nc_cpp)
|
execpp = executable('execpp', 'main.cpp', dependencies : nc_cpp)
|
||||||
test('NetCDF C++', execpp)
|
test('NetCDF C++', execpp, timeout: 15)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# --- Fortran tests
|
# --- Fortran
|
||||||
if build_machine.system() != 'windows' and build_machine.system() != 'darwin'
|
if build_machine.system() != 'windows' and build_machine.system() != 'darwin'
|
||||||
add_languages('fortran')
|
if add_languages('fortran', required: false)
|
||||||
|
nc_f = dependency('netcdf', language : 'fortran', required : false, disabler: true)
|
||||||
nc_f = dependency('netcdf', language : 'fortran', required : false)
|
|
||||||
if nc_f.found()
|
|
||||||
exef = executable('exef', 'main.f90', dependencies : nc_f)
|
exef = executable('exef', 'main.f90', dependencies : nc_f)
|
||||||
|
test('NetCDF Fortran', exef, timeout: 15)
|
||||||
test('NetCDF Fortran', exef)
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ if not mpi_c.found()
|
||||||
error('MESON_SKIP_TEST: MPI library not available')
|
error('MESON_SKIP_TEST: MPI library not available')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
scalapack = dependency('scalapack', required: false)
|
scalapack = dependency('scalapack', required: false)
|
||||||
if not scalapack.found()
|
if not scalapack.found()
|
||||||
error('MESON_SKIP_TEST: scalapack library not available')
|
error('MESON_SKIP_TEST: scalapack library not available')
|
||||||
|
@ -15,7 +14,7 @@ c_exe = executable('scalapack_c', 'main.c',
|
||||||
dependencies: [scalapack, mpi_c])
|
dependencies: [scalapack, mpi_c])
|
||||||
test('scalapack_c', c_exe, timeout: 30)
|
test('scalapack_c', c_exe, timeout: 30)
|
||||||
|
|
||||||
if add_languages('fortran')
|
if add_languages('fortran', required: false)
|
||||||
mpi_f = dependency('mpi', language: 'fortran', required: false)
|
mpi_f = dependency('mpi', language: 'fortran', required: false)
|
||||||
if not mpi_f.found()
|
if not mpi_f.found()
|
||||||
error('MESON_SKIP_TEST: MPI Fortran library not available')
|
error('MESON_SKIP_TEST: MPI Fortran library not available')
|
||||||
|
|
Loading…
Reference in New Issue