# Stop on first error
set -e

# Test C compiler
echo "Testing h5cc"
h5cc -show
h5cc h5_cmprss.c -o h5_cmprss
./h5_cmprss

# Test C++ compiler
echo "Testing h5c++"
h5c++ -show
h5c++ h5tutr_cmprss.cpp -o h5tutr_cmprss
./h5tutr_cmprss

# Test Fortran 90 compiler
echo "Testing h5fc"
h5fc -show
h5fc h5_cmprss.f90 -o h5_cmprss
./h5_cmprss

# Test Fortran 2003 compiler, note that the file has a 90 extension
echo "Testing h5fc for Fortran 2003"
h5fc compound_fortran2003.f90 -o compound_fortran2003
./compound_fortran2003


set -ex



command -v h5c++
command -v h5cc
command -v h5perf_serial
command -v h5redeploy
command -v h5fc
command -v gif2h5
command -v h52gif
command -v h5copy
command -v h5debug
command -v h5diff
command -v h5dump
command -v h5import
command -v h5jam
command -v h5ls
command -v h5mkgrp
command -v h5repack
command -v h5repart
command -v h5stat
command -v h5unjam
test -f $PREFIX/lib/libhdf5.a
test -f $PREFIX/lib/libhdf5.dylib
test -f $PREFIX/lib/libhdf5_cpp.a
test -f $PREFIX/lib/libhdf5_cpp.dylib
test -f $PREFIX/lib/libhdf5_hl.a
test -f $PREFIX/lib/libhdf5_hl.dylib
test -f $PREFIX/lib/libhdf5_hl_cpp.a
test -f $PREFIX/lib/libhdf5_hl_cpp.dylib
otool -L $PREFIX/lib/libhdf5.dylib
otool -L $PREFIX/lib/libhdf5_cpp.dylib
otool -L $PREFIX/lib/libhdf5_hl.dylib
otool -L $PREFIX/lib/libhdf5_hl_cpp.dylib
exit 0
