summaryrefslogtreecommitdiffstats
path: root/fortran/test
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-02-22 12:16:30 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-02-22 12:16:30 (GMT)
commitc07d8036591313caf15cf626122bd7ce4e61be49 (patch)
treede3cfcb2639a3c84254d536d2f4a1ec9239af019 /fortran/test
parent179f3b7879e28165869034255b5852b551700ad6 (diff)
parentf634105bdb7c494a5ab39291d64c00676c11b476 (diff)
downloadhdf5-c07d8036591313caf15cf626122bd7ce4e61be49.zip
hdf5-c07d8036591313caf15cf626122bd7ce4e61be49.tar.gz
hdf5-c07d8036591313caf15cf626122bd7ce4e61be49.tar.bz2
[svn-r26274] Merge of r26096 to r26271 from trunk.
Tested on: jam - serial: C++/Fortran parallel: Fortran
Diffstat (limited to 'fortran/test')
-rw-r--r--fortran/test/CMakeLists.txt8
-rw-r--r--fortran/test/CMakeTests.cmake2
-rw-r--r--fortran/test/tH5T_F03.f9020
-rw-r--r--fortran/test/tf.f9024
-rw-r--r--fortran/test/tf_F03.f9010
-rw-r--r--fortran/test/tf_F08.f9010
6 files changed, 42 insertions, 32 deletions
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index d10f2ef..3395906 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 2.8.11)
+cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran)
#-----------------------------------------------------------------------------
@@ -10,6 +10,7 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${
# Add Test Lib
#-----------------------------------------------------------------------------
add_library (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} t.c)
+set_source_files_properties (t.c PROPERTIES LANGUAGE C)
TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} " " " ")
target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET}
${HDF5_F90_C_LIB_TARGET}
@@ -18,12 +19,14 @@ target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET}
H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} ${LIB_TYPE})
set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES
FOLDER libraries/test/fortran
+ LINKER_LANGUAGE C
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
# See if the F2008 intrinsic STORAGE_SIZE and C_SIZEOF are supported. If not then
# fall back to F2003. If F2003 not supported then use F90 for the tests.
+set_source_files_properties (tf_F90.f90 tf_F03.f90 tf_F08.f90 tf.f90 PROPERTIES LANGUAGE Fortran)
if (FORTRAN_HAVE_STORAGE_SIZE AND FORTRAN_HAVE_C_SIZEOF)
add_library (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf_F08.f90 tf.f90)
elseif (HDF5_ENABLE_F2003)
@@ -36,7 +39,7 @@ endif (FORTRAN_HAVE_STORAGE_SIZE AND FORTRAN_HAVE_C_SIZEOF)
set (SHARED_LINK_FLAGS " ")
if (WIN32)
if (BUILD_SHARED_LIBS)
- set_property (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL)
+ set_property (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_TEST_DLL)
if (MSVC)
set (SHARED_LINK_FLAGS "/DLL")
endif (MSVC)
@@ -53,6 +56,7 @@ target_link_libraries (${HDF5_F90_TEST_LIB_TARGET}
H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} ${LIB_TYPE})
set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES
FOLDER libraries/test/fortran
+ LINKER_LANGUAGE Fortran
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake
index 6a9c535..4df50ad 100644
--- a/fortran/test/CMakeTests.cmake
+++ b/fortran/test/CMakeTests.cmake
@@ -11,11 +11,13 @@ set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSIO
#-- Adding test for testhdf5_fortran_1_8
add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND $<TARGET_FILE:testhdf5_fortran_1_8>)
set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
+set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran)
#-- Adding test for fortranlib_test_F03
if (HDF5_ENABLE_F2003)
add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND $<TARGET_FILE:fortranlib_test_F03>)
set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
+ set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8)
endif (HDF5_ENABLE_F2003)
#-- Adding test for fflush1
diff --git a/fortran/test/tH5T_F03.f90 b/fortran/test/tH5T_F03.f90
index f15424d..e019d0f 100644
--- a/fortran/test/tH5T_F03.f90
+++ b/fortran/test/tH5T_F03.f90
@@ -1419,7 +1419,7 @@ SUBROUTINE t_enum(total_error)
! Insert enumerated value for memtype.
!
val(1) = i
- CALL H5Tenum_insert_f(memtype, TRIM(names(i+1)), val(1), error)
+ CALL H5Tenum_insert_f(memtype, TRIM(names(i+1)), C_LOC(val(1)), error)
CALL check("H5Tenum_insert_f", error, total_error)
!
! Insert enumerated value for filetype. We must first convert
@@ -1428,7 +1428,11 @@ SUBROUTINE t_enum(total_error)
f_ptr = C_LOC(val(1))
CALL H5Tconvert_f(M_BASET, F_BASET, INT(1,SIZE_T), f_ptr, error)
CALL check("H5Tconvert_f",error, total_error)
- CALL H5Tenum_insert_f(filetype, TRIM(names(i+1)), val(1), error)
+ IF(i.GE.1)THEN ! test both F90 and F03 APIs
+ CALL H5Tenum_insert_f(filetype, TRIM(names(i+1)), f_ptr, error)
+ ELSE
+ CALL H5Tenum_insert_f(filetype, TRIM(names(i+1)), val(1), error)
+ ENDIF
CALL check("H5Tenum_insert_f",error, total_error)
ENDDO
!
@@ -3134,7 +3138,7 @@ SUBROUTINE t_enum_conv(total_error)
ENUMERATOR :: E1_RED, E1_GREEN, E1_BLUE, E1_WHITE, E1_BLACK
END ENUM
- INTEGER :: val
+ INTEGER(KIND(E1_RED)), TARGET :: val
! Enumerated data array
! Some values are out of range for testing. The library should accept them
@@ -3185,19 +3189,19 @@ SUBROUTINE t_enum_conv(total_error)
! Initialize enum data.
!
val = E1_RED
- CALL H5Tenum_insert_f(dtype, "RED", val, error)
+ CALL H5Tenum_insert_f(dtype, "RED", C_LOC(val), error)
CALL check("h5tenum_insert_f",error, total_error)
val = E1_GREEN
- CALL H5Tenum_insert_f(dtype, "GREEN", val, error)
+ CALL H5Tenum_insert_f(dtype, "GREEN", C_LOC(val), error)
CALL check("h5tenum_insert_f",error, total_error)
val = E1_BLUE
- CALL H5Tenum_insert_f(dtype, "BLUE", val, error)
+ CALL H5Tenum_insert_f(dtype, "BLUE", C_LOC(val), error)
CALL check("h5tenum_insert_f",error, total_error)
val = E1_WHITE
- CALL H5Tenum_insert_f(dtype, "WHITE", val, error)
+ CALL H5Tenum_insert_f(dtype, "WHITE", C_LOC(val), error)
CALL check("h5tenum_insert_f",error, total_error)
val = E1_BLACK
- CALL H5Tenum_insert_f(dtype, "BLACK", val, error)
+ CALL H5Tenum_insert_f(dtype, "BLACK", C_LOC(val), error)
CALL check("h5tenum_insert_f",error, total_error)
!
! Create dataspace. Setting maximum size to be the current size.
diff --git a/fortran/test/tf.f90 b/fortran/test/tf.f90
index 063e93d..6d5911f 100644
--- a/fortran/test/tf.f90
+++ b/fortran/test/tf.f90
@@ -36,7 +36,7 @@ MODULE TH5_MISC
CONTAINS
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: dreal_eq
!DEC$endif
LOGICAL FUNCTION dreal_eq(a,b)
@@ -49,7 +49,7 @@ CONTAINS
END FUNCTION dreal_eq
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: verify_real_kind_7
!DEC$endif
SUBROUTINE verify_real_kind_7(string,value,correct_value,total_error)
@@ -66,7 +66,7 @@ CONTAINS
END SUBROUTINE verify_real_kind_7
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: write_test_status
!DEC$endif
SUBROUTINE write_test_status( test_result, test_title, total_error)
@@ -105,7 +105,7 @@ CONTAINS
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: check
!DEC$endif
SUBROUTINE check(string,error,total_error)
@@ -119,7 +119,7 @@ CONTAINS
END SUBROUTINE check
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: verify
!DEC$endif
SUBROUTINE VERIFY(string,value,correct_value,total_error)
@@ -133,7 +133,7 @@ CONTAINS
END SUBROUTINE verify
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: verify_Fortran_INTEGER_4
!DEC$endif
SUBROUTINE verify_Fortran_INTEGER_4(string,value,correct_value,total_error)
@@ -150,7 +150,7 @@ CONTAINS
END SUBROUTINE verify_Fortran_INTEGER_4
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: verifyLogical
!DEC$endif
SUBROUTINE verifyLogical(string,value,correct_value,total_error)
@@ -165,7 +165,7 @@ CONTAINS
END SUBROUTINE verifyLogical
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: verifyString
!DEC$endif
SUBROUTINE verifyString(string, value,correct_value,total_error)
@@ -203,7 +203,7 @@ CONTAINS
SUBROUTINE h5_fixname_f(base_name, full_name, fapl, hdferr)
!
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_fixname_f
!DEC$endif
USE H5GLOBAL
@@ -263,7 +263,7 @@ CONTAINS
SUBROUTINE h5_cleanup_f(base_name, fapl, hdferr)
!
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_cleanup_f
!DEC$endif
USE H5GLOBAL
@@ -315,7 +315,7 @@ CONTAINS
SUBROUTINE h5_exit_f(status)
!
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_exit_f
!DEC$endif
IMPLICIT NONE
@@ -352,7 +352,7 @@ CONTAINS
SUBROUTINE h5_env_nocleanup_f(HDF5_NOCLEANUP)
!
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_env_nocleanup_f
!DEC$endif
IMPLICIT NONE
diff --git a/fortran/test/tf_F03.f90 b/fortran/test/tf_F03.f90
index 4513783..b3f1399 100644
--- a/fortran/test/tf_F03.f90
+++ b/fortran/test/tf_F03.f90
@@ -66,7 +66,7 @@ MODULE TH5_MISC_PROVISIONAL
CONTAINS
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_cmpd
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_CMPD(a)
@@ -78,7 +78,7 @@ CONTAINS
END FUNCTION H5_SIZEOF_CMPD
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_chr
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_CHR(a)
@@ -90,7 +90,7 @@ CONTAINS
END FUNCTION H5_SIZEOF_CHR
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_i
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_I(a)
@@ -102,7 +102,7 @@ CONTAINS
END FUNCTION H5_SIZEOF_I
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_sp
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_SP(a)
@@ -114,7 +114,7 @@ CONTAINS
END FUNCTION H5_SIZEOF_SP
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_dp
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_DP(a)
diff --git a/fortran/test/tf_F08.f90 b/fortran/test/tf_F08.f90
index 5583f3f..20c2859 100644
--- a/fortran/test/tf_F08.f90
+++ b/fortran/test/tf_F08.f90
@@ -65,7 +65,7 @@ MODULE TH5_MISC_PROVISIONAL
CONTAINS
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_cmpd
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_CMPD(a)
@@ -77,7 +77,7 @@ CONTAINS
END FUNCTION H5_SIZEOF_CMPD
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_chr
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_CHR(a)
@@ -89,7 +89,7 @@ CONTAINS
END FUNCTION H5_SIZEOF_CHR
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_i
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_I(a)
@@ -102,7 +102,7 @@ CONTAINS
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_sp
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_SP(a)
@@ -114,7 +114,7 @@ CONTAINS
END FUNCTION H5_SIZEOF_SP
!This definition is needed for Windows DLLs
-!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$if defined(BUILD_HDF5_TEST_DLL)
!DEC$attributes dllexport :: h5_sizeof_dp
!DEC$endif
INTEGER(C_SIZE_T) FUNCTION H5_SIZEOF_DP(a)