summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
Diffstat (limited to 'fortran')
-rw-r--r--fortran/src/CMakeLists.txt6
-rw-r--r--fortran/src/h5fc.in28
-rw-r--r--fortran/test/fortranlib_test_F03.F902
-rw-r--r--fortran/test/tH5E_F03.F9023
-rw-r--r--fortran/test/tH5T_F03.F902
5 files changed, 40 insertions, 21 deletions
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index 99644b8..b2ac81e 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -31,6 +31,12 @@ else ()
set (CMAKE_H5_HAVE_MPI_F08 0)
endif ()
+if (H5_HAVE_DARWIN) # Used in testing
+ set (CMAKE_H5_HAVE_DARWIN 1)
+else ()
+ set (CMAKE_H5_HAVE_DARWIN 0)
+endif ()
+
# configure for Fortran preprocessor
# Define Parallel variable for passing to H5config_f.inc.cmake
diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in
index 6d7329a..f92c523 100644
--- a/fortran/src/h5fc.in
+++ b/fortran/src/h5fc.in
@@ -308,20 +308,20 @@ if test "x$do_link" = "xyes"; then
fi
link_args="$link_args -L${libdir}"
- case "$host_os" in
- linux*) flag="@fortran_linux_linker_option@-rpath -Wl," ;;
- hpux*) flag="-Wl,+b -Wl," ;;
- freebsd*|solaris*) flag="-R" ;;
- rs6000*|aix*) flag="-L" ;;
- sgi) flag="-rpath " ;;
- *) flag="" ;;
- esac
-
- if test -n "$flag"; then
- shared_link="${flag}${libdir}"
- fi
-
- if test "x$USE_SHARED_LIB" != "xyes"; then
+ if test "x$USE_SHARED_LIB" = "xyes"; then
+ case "$host_os" in
+ linux*) flag="@fortran_linux_linker_option@-rpath -Wl," ;;
+ hpux*) flag="-Wl,+b -Wl," ;;
+ freebsd*|solaris*) flag="-R" ;;
+ rs6000*|aix*) flag="-L" ;;
+ sgi) flag="-rpath " ;;
+ *) flag="" ;;
+ esac
+
+ if test -n "$flag"; then
+ shared_link="${flag}${libdir}"
+ fi
+ else
# The hdf5 library "-l" flags are in here already. This is a static
# compile though, so change it to the static versions (.a) of the libraries.
new_libraries=""
diff --git a/fortran/test/fortranlib_test_F03.F90 b/fortran/test/fortranlib_test_F03.F90
index 1c38b36..50240ce 100644
--- a/fortran/test/fortranlib_test_F03.F90
+++ b/fortran/test/fortranlib_test_F03.F90
@@ -59,7 +59,7 @@ PROGRAM fortranlibtest_F03
ret_total_error = 0
CALL test_error(ret_total_error)
- CALL write_test_status(ret_total_error, ' Test error API based on data I/O', total_error)
+ CALL write_test_status(ret_total_error, ' Testing error API based on data I/O', total_error)
ret_total_error = 0
CALL test_array_compound_atomic(ret_total_error)
diff --git a/fortran/test/tH5E_F03.F90 b/fortran/test/tH5E_F03.F90
index 86e77ec..33d666c 100644
--- a/fortran/test/tH5E_F03.F90
+++ b/fortran/test/tH5E_F03.F90
@@ -188,6 +188,7 @@ SUBROUTINE test_error(total_error)
TYPE(C_FUNPTR) :: func
CHARACTER(LEN=180) :: chr180
INTEGER :: idx
+ INTEGER(HID_T) :: fapl
LOGICAL :: status
@@ -209,8 +210,14 @@ SUBROUTINE test_error(total_error)
CALL H5Eset_auto_f(1, error, H5E_DEFAULT_F, func, f_ptr)
CALL check("H5Eset_auto_f", error, total_error)
- CALL h5fopen_f("DOESNOTEXIST", H5F_ACC_RDONLY_F, file, error)
+ ! If a fapl is not created, then the test will fail when using
+ ! check-passthrough-vol because the callback function is called twice, gh #4137.
+ CALL h5pcreate_f(H5P_DATASET_ACCESS_F, fapl, error)
+ CALL check("h5pcreate_f", error, total_error)
+ CALL h5fopen_f("DOESNOTEXIST", H5F_ACC_RDONLY_F, file, error, fapl)
CALL VERIFY("h5fopen_f", error, -1, total_error)
+ CALL h5pclose_f(fapl,error)
+ CALL check("h5pclose_f", error, total_error)
CLOSE(iunit)
@@ -247,7 +254,7 @@ SUBROUTINE test_error_stack(total_error)
INTEGER(HID_T) :: cls_id, major, minor, estack_id, estack_id1, estack_id2
CHARACTER(LEN=18), TARGET :: file
CHARACTER(LEN=18), TARGET :: func
- INTEGER , TARGET :: line
+ INTEGER(C_INT) , TARGET :: line
TYPE(C_PTR) :: ptr1, ptr2, ptr3, ptr4
INTEGER :: msg_type
@@ -288,9 +295,9 @@ SUBROUTINE test_error_stack(total_error)
CALL check("h5ecreate_stack_f", error, total_error)
! push a custom error message onto the stack
- CALL H5Epush_f(estack_id, cls_id, major, minor, "%s ERROR TEXT %s"//C_NEW_LINE, error, &
+ CALL H5Epush_f(estack_id, cls_id, major, minor, "%s ERROR TEXT %s %s", error, &
ptr1, ptr2, ptr3, &
- arg1=ACHAR(27)//"[31m", arg2=ACHAR(27)//"[0m" )
+ arg1=ACHAR(27)//"[31m", arg2=ACHAR(27)//"[0m", arg3=ACHAR(10) )
CALL check("H5Epush_f", error, total_error)
CALL h5eget_num_f(estack_id, count, error)
@@ -374,6 +381,12 @@ SUBROUTINE test_error_stack(total_error)
IF(.NOT.status)THEN
CALL check("h5eprint_f", -1, total_error)
ELSE
+! The contents of the file should be:
+! Custom error class-DIAG: Error detected in H5E_F03 (0.1) thread 0:
+! #000: FILE line 99 in FUNC(): ERROR TEXT
+!
+! major: MAJOR MSG
+! minor: MIN MSG
OPEN(UNIT=12, FILE="H5Etest.txt", status='old')
READ(12,'(A)') chr180
@@ -461,7 +474,7 @@ SUBROUTINE test_error_stack(total_error)
CALL check("h5eget_num_f", error, total_error)
CALL VERIFY("h5eget_num_f", count, 1_SIZE_T, total_error)
- CALL h5epop_f(H5E_DEFAULT_F, 1_size_t, total_error)
+ CALL h5epop_f(H5E_DEFAULT_F, 1_size_t, error)
CALL check("h5epop_f", error, total_error)
CALL h5eget_num_f(H5E_DEFAULT_F, count, error)
diff --git a/fortran/test/tH5T_F03.F90 b/fortran/test/tH5T_F03.F90
index 08dfa22..65804d0 100644
--- a/fortran/test/tH5T_F03.F90
+++ b/fortran/test/tH5T_F03.F90
@@ -1441,7 +1441,7 @@ SUBROUTINE t_enum(total_error)
!
! Create dataspace. Setting maximum size to be the current size.
!
- CALL h5screate_simple_f(2, dims, space, total_error)
+ CALL h5screate_simple_f(2, dims, space, error)
CALL check("h5screate_simple_f",error, total_error)
!
! Create the dataset and write the enumerated data to it.