summaryrefslogtreecommitdiffstats
path: root/fortran/test/CMakeTests.cmake
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/test/CMakeTests.cmake
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/test/CMakeTests.cmake')
-rw-r--r--fortran/test/CMakeTests.cmake114
1 files changed, 102 insertions, 12 deletions
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 ()