diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-09-29 14:55:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-29 14:55:38 -0700 |
commit | 137c3124e23f0f589c8855aafcd7897aa6d8c544 (patch) | |
tree | eadd5f53f37aa92f91506e2b6f2e253080d0fa66 /test cases | |
parent | 400ec2d6857ba72147a3d9389777ec64e12fe67e (diff) | |
parent | bffd981246792e97c0a28fb53da49ff601873e76 (diff) | |
download | meson-137c3124e23f0f589c8855aafcd7897aa6d8c544.zip meson-137c3124e23f0f589c8855aafcd7897aa6d8c544.tar.gz meson-137c3124e23f0f589c8855aafcd7897aa6d8c544.tar.bz2 |
Merge pull request #7758 from dcbaker/submit/hdf5-factory
dependencies/hdf5: Convert to a dependency_factory
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/frameworks/25 hdf5/meson.build | 31 | ||||
-rw-r--r-- | test cases/frameworks/25 hdf5/meson_options.txt | 6 | ||||
-rw-r--r-- | test cases/frameworks/25 hdf5/test.json | 10 |
3 files changed, 40 insertions, 7 deletions
diff --git a/test cases/frameworks/25 hdf5/meson.build b/test cases/frameworks/25 hdf5/meson.build index 5485035..0df2ffd 100644 --- a/test cases/frameworks/25 hdf5/meson.build +++ b/test cases/frameworks/25 hdf5/meson.build @@ -2,8 +2,10 @@ project('hdf5_framework', 'c') # NOTE: all HDF5 languages must have HDF5 C library working. +method = get_option('method') + # --- C tests -h5c = dependency('hdf5', language : 'c', required : false) +h5c = dependency('hdf5', language : 'c', required : false, method : method) if not h5c.found() error('MESON_SKIP_TEST: HDF5 C library not found.') endif @@ -12,16 +14,31 @@ test('HDF5 C', exec, timeout: 30) # --- C++ tests if add_languages('cpp', required: false) - h5cpp = dependency('hdf5', language : 'cpp', required : false, disabler: true) + h5cpp = dependency('hdf5', language : 'cpp', required : false, disabler: true, method : method) execpp = executable('execpp', 'main.cpp', dependencies : h5cpp) test('HDF5 C++', execpp, timeout: 30) endif -# --- Fortran tests -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) +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 diff --git a/test cases/frameworks/25 hdf5/meson_options.txt b/test cases/frameworks/25 hdf5/meson_options.txt new file mode 100644 index 0000000..741f58e --- /dev/null +++ b/test cases/frameworks/25 hdf5/meson_options.txt @@ -0,0 +1,6 @@ +option( + 'method', + type : 'combo', + choices : ['pkg-config', 'config-tool'], + value : 'pkg-config' +) diff --git a/test cases/frameworks/25 hdf5/test.json b/test cases/frameworks/25 hdf5/test.json new file mode 100644 index 0000000..0de1f73 --- /dev/null +++ b/test cases/frameworks/25 hdf5/test.json @@ -0,0 +1,10 @@ +{ + "matrix": { + "options": { + "method": [ + { "val": "pkg-config" }, + { "val": "config-tool" } + ] + } + } +} |