ci: improve robustness

* netcf
* hdf5
* scalapack
* coarray
pull/6355/head
Michael Hirsch, Ph.D 5 years ago
parent f1d370247f
commit ccbb20e881
No known key found for this signature in database
GPG Key ID: 6D23CDADAB0294F9
  1. 2
      test cases/fortran/13 coarray/meson.build
  2. 4
      test cases/frameworks/25 hdf5/meson.build
  3. 37
      test cases/frameworks/26 netcdf/meson.build
  4. 3
      test cases/frameworks/30 scalapack/meson.build

@ -15,7 +15,7 @@ coarray = dependency('coarray')
# this has to invoke a run of "sync all" to verify the MPI stack is functioning,
# particularly for dynamic linking
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
exe = executable('hello', 'main.f90',

@ -11,14 +11,14 @@ exec = executable('exec', 'main.c', dependencies : h5c)
test('HDF5 C', exec, timeout: 30)
# --- C++ tests
if add_languages('cpp')
if add_languages('cpp', required: false)
h5cpp = dependency('hdf5', language : 'cpp', required : false, disabler: true)
execpp = executable('execpp', 'main.cpp', dependencies : h5cpp)
test('HDF5 C++', execpp, timeout: 30)
endif
# --- Fortran tests
if add_languages('fortran')
if add_languages('fortran', required: false)
h5f = dependency('hdf5', language : 'fortran', required : false, disabler: true)
exef = executable('exef', 'main.f90', dependencies : h5f)
test('HDF5 Fortran', exef, timeout: 30)

@ -1,31 +1,32 @@
project('netcdf_test', 'c', 'cpp')
# --- C tests
nc_c = dependency('netcdf', language : 'c', required : false)
project('netcdf_test', 'c')
cc = meson.get_compiler('c')
c_code = '''#include <netcdf.h>
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()
error('MESON_SKIP_TEST: NetCDF C library not found, skipping NetCDF framework tests.')
endif
exec = executable('exec', 'main.c', dependencies : nc_c)
test('NetCDF C', exec, timeout: 15)
test('NetCDF C', exec)
# --- C++ tests
nc_cpp = dependency('netcdf', language : 'cpp', required : false)
if nc_cpp.found()
# --- C++
if add_languages('cpp', required: false)
nc_cpp = dependency('netcdf', language : 'cpp', required : false, disabler: true)
execpp = executable('execpp', 'main.cpp', dependencies : nc_cpp)
test('NetCDF C++', execpp)
test('NetCDF C++', execpp, timeout: 15)
endif
# --- Fortran tests
# --- Fortran
if build_machine.system() != 'windows' and build_machine.system() != 'darwin'
add_languages('fortran')
nc_f = dependency('netcdf', language : 'fortran', required : false)
if nc_f.found()
if add_languages('fortran', required: false)
nc_f = dependency('netcdf', language : 'fortran', required : false, disabler: true)
exef = executable('exef', 'main.f90', dependencies : nc_f)
test('NetCDF Fortran', exef)
test('NetCDF Fortran', exef, timeout: 15)
endif
endif

@ -5,7 +5,6 @@ if not mpi_c.found()
error('MESON_SKIP_TEST: MPI library not available')
endif
scalapack = dependency('scalapack', required: false)
if not scalapack.found()
error('MESON_SKIP_TEST: scalapack library not available')
@ -15,7 +14,7 @@ c_exe = executable('scalapack_c', 'main.c',
dependencies: [scalapack, mpi_c])
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)
if not mpi_f.found()
error('MESON_SKIP_TEST: MPI Fortran library not available')

Loading…
Cancel
Save