summaryrefslogtreecommitdiffstats
path: root/fortran/examples
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-01-11 20:02:34 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-01-11 20:02:34 (GMT)
commit244faaa0d048e7e06fb5aec8d4f661f1893c3030 (patch)
tree50d18b730a41e3f644f4d2729ea30ebe387bdfba /fortran/examples
parente1bcae8a6a804490aa941a654e99b1dd18251411 (diff)
downloadhdf5-244faaa0d048e7e06fb5aec8d4f661f1893c3030.zip
hdf5-244faaa0d048e7e06fb5aec8d4f661f1893c3030.tar.gz
hdf5-244faaa0d048e7e06fb5aec8d4f661f1893c3030.tar.bz2
HDFFV-10094: upgrade cmake command conventions
Also converted tests to use macros
Diffstat (limited to 'fortran/examples')
-rw-r--r--fortran/examples/CMakeTests.cmake60
1 files changed, 56 insertions, 4 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 "")