summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
Diffstat (limited to 'fortran')
-rw-r--r--fortran/examples/CMakeTests.cmake60
-rw-r--r--fortran/test/CMakeTests.cmake114
2 files changed, 158 insertions, 16 deletions
diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake
index f150130..ea21fa4 100644
--- a/fortran/examples/CMakeTests.cmake
+++ b/fortran/examples/CMakeTests.cmake
@@ -58,13 +58,39 @@
endif ()
foreach (example ${examples})
- add_test (NAME f90_ex_${example} COMMAND $<TARGET_FILE:f90_ex_${example}>)
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME f90_ex_${example} COMMAND $<TARGET_FILE:f90_ex_${example}>)
+ else ()
+ add_test (NAME f90_ex_${example} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:f90_ex_${example}>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=f90_ex_${example}.txt"
+ #-D "TEST_REFERENCE=f90_ex_${example}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test})
endif ()
set (last_test "f90_ex_${example}")
if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
- add_test (NAME f90_ex-shared_${example} COMMAND $<TARGET_FILE:f90_ex_${example}-shared>)
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME f90_ex-shared_${example} COMMAND $<TARGET_FILE:f90_ex_${example}-shared>)
+ else ()
+ add_test (NAME f90_ex-shared_${example} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:f90_ex_${example}-shared>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=f90_ex_${example}-shared.txt"
+ #-D "TEST_REFERENCE=f90_ex_${example}-shared.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (f90_ex-shared_${example} PROPERTIES DEPENDS ${last_test})
endif ()
@@ -74,13 +100,39 @@ endforeach ()
if (HDF5_ENABLE_F2003)
foreach (example ${F2003_examples})
- add_test (NAME f03_ex_${example} COMMAND $<TARGET_FILE:f03_ex_${example}>)
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME f03_ex_${example} COMMAND $<TARGET_FILE:f03_ex_${example}>)
+ else ()
+ add_test (NAME f03_ex_${example} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:f03_ex_${example}>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=f03_ex_${example}.txt"
+ #-D "TEST_REFERENCE=f03_ex_${example}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test})
endif (NOT "${last_test}" STREQUAL "")
set (last_test "f03_ex_${example}")
if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
- add_test (NAME f03_ex-shared_${example} COMMAND $<TARGET_FILE:f03_ex_${example}-shared>)
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME f03_ex-shared_${example} COMMAND $<TARGET_FILE:f03_ex_${example}-shared>)
+ else ()
+ add_test (NAME f03_ex-shared_${example} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:f03_ex_${example}-shared>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=f03_ex_${example}-shared.txt"
+ #-D "TEST_REFERENCE=f03_ex_${example}-shared.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (f03_ex-shared_${example} PROPERTIES DEPENDS ${last_test})
endif (NOT "${last_test}" STREQUAL "")
diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake
index 6c86cfa..3792e57 100644
--- a/fortran/test/CMakeTests.cmake
+++ b/fortran/test/CMakeTests.cmake
@@ -52,19 +52,64 @@ if (NOT "${last_test}" STREQUAL "")
endif ()
set (last_test "FORTRAN_testhdf5-clear-objects")
-add_test (NAME FORTRAN_testhdf5_fortran COMMAND $<TARGET_FILE:testhdf5_fortran>)
-set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME FORTRAN_testhdf5_fortran COMMAND $<TARGET_FILE:testhdf5_fortran>)
+else ()
+ add_test (NAME FORTRAN_testhdf5_fortran COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:testhdf5_fortran>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_REGEX= 0 error.s."
+ -D "TEST_MATCH= 0 error(s)"
+ -D "TEST_OUTPUT=testhdf5_fortran.txt"
+ #-D "TEST_REFERENCE=testhdf5_fortran.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+endif ()
+#set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
set_tests_properties (FORTRAN_testhdf5_fortran PROPERTIES DEPENDS FORTRAN_testhdf5-clear-objects)
#-- 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")
+if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND $<TARGET_FILE:testhdf5_fortran_1_8>)
+else ()
+ add_test (NAME FORTRAN_testhdf5_fortran_1_8 COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:testhdf5_fortran_1_8>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_REGEX= 0 error.s."
+ -D "TEST_MATCH= 0 error(s)"
+ -D "TEST_OUTPUT=testhdf5_fortran_1_8.txt"
+ #-D "TEST_REFERENCE=testhdf5_fortran_1_8.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+endif ()
+#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")
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND $<TARGET_FILE:fortranlib_test_F03>)
+ else ()
+ add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:fortranlib_test_F03>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_REGEX= 0 error.s."
+ -D "TEST_MATCH= 0 error(s)"
+ -D "TEST_OUTPUT=fortranlib_test_F03.txt"
+ #-D "TEST_REFERENCE=fortranlib_test_F03.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+# 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 ()
@@ -119,19 +164,64 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
)
set_tests_properties (FORTRAN_testhdf5-shared-clear-objects PROPERTIES DEPENDS FORTRAN_testhdf5-clear-objects)
- add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND $<TARGET_FILE:testhdf5_fortran-shared>)
- set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND $<TARGET_FILE:testhdf5_fortran-shared>)
+ else ()
+ add_test (NAME FORTRAN_testhdf5_fortran-shared COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:testhdf5_fortran-shared>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_REGEX= 0 error.s."
+ -D "TEST_MATCH= 0 error(s)"
+ -D "TEST_OUTPUT=testhdf5_fortran.txt"
+ #-D "TEST_REFERENCE=testhdf5_fortran.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+# set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
set_tests_properties (FORTRAN_testhdf5_fortran-shared PROPERTIES DEPENDS "FORTRAN_testhdf5_fortran;FORTRAN_testhdf5-shared-clear-objects")
#-- Adding test for testhdf5_fortran_1_8
- add_test (NAME FORTRAN_testhdf5_fortran_1_8-shared COMMAND $<TARGET_FILE:testhdf5_fortran_1_8-shared>)
- set_tests_properties (FORTRAN_testhdf5_fortran_1_8-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME FORTRAN_testhdf5_fortran_1_8-shared COMMAND $<TARGET_FILE:testhdf5_fortran_1_8-shared>)
+ else ()
+ add_test (NAME FORTRAN_testhdf5_fortran_1_8-shared COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:testhdf5_fortran_1_8-shared>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_REGEX= 0 error.s."
+ -D "TEST_MATCH= 0 error(s)"
+ -D "TEST_OUTPUT=testhdf5_fortran.txt"
+ #-D "TEST_REFERENCE=testhdf5_fortran.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+# set_tests_properties (FORTRAN_testhdf5_fortran_1_8-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
set_tests_properties (FORTRAN_testhdf5_fortran_1_8-shared PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8)
#-- Adding test for fortranlib_test_F03
if (HDF5_ENABLE_F2003)
- add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND $<TARGET_FILE:fortranlib_test_F03-shared>)
- set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND $<TARGET_FILE:fortranlib_test_F03-shared>)
+ else ()
+ add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:fortranlib_test_F03-shared>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_REGEX= 0 error.s."
+ -D "TEST_MATCH= 0 error(s)"
+ -D "TEST_OUTPUT=fortranlib_test_F03.txt"
+ #-D "TEST_REFERENCE=fortranlib_test_F03.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+# set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES DEPENDS FORTRAN_fortranlib_test_F03)
endif ()