summaryrefslogtreecommitdiff
path: root/test cases/frameworks
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-09-24 11:54:02 -0700
committerDylan Baker <dylan@pnwbakers.com>2020-09-25 11:11:46 -0700
commitbffd981246792e97c0a28fb53da49ff601873e76 (patch)
tree3b201f10a7c5bc1a8f7841d5b3419889d923142f /test cases/frameworks
parent54329eeed75d9fc4b9cc2ccbafb0773d24b2f92b (diff)
downloadmeson-bffd981246792e97c0a28fb53da49ff601873e76.tar.gz
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.
Diffstat (limited to 'test cases/frameworks')
-rw-r--r--test cases/frameworks/25 hdf5/meson.build25
1 files changed, 20 insertions, 5 deletions
diff --git a/test cases/frameworks/25 hdf5/meson.build b/test cases/frameworks/25 hdf5/meson.build
index ced33b1e9..0df2ffdd4 100644
--- a/test cases/frameworks/25 hdf5/meson.build
+++ b/test cases/frameworks/25 hdf5/meson.build
@@ -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)
- h5f = dependency('hdf5', language : 'fortran', required : false, disabler: true, method : method)
- 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