summaryrefslogtreecommitdiffstats
path: root/hl/examples/CMakeTests.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'hl/examples/CMakeTests.cmake')
-rw-r--r--hl/examples/CMakeTests.cmake38
1 files changed, 31 insertions, 7 deletions
diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake
index 6384aa5..0a40b96 100644
--- a/hl/examples/CMakeTests.cmake
+++ b/hl/examples/CMakeTests.cmake
@@ -1,3 +1,14 @@
+#
+# Copyright by The HDF Group.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+
##############################################################################
##############################################################################
@@ -12,7 +23,7 @@ set (HDF5_TEST_FILES
foreach (h5_file ${HDF5_TEST_FILES})
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "hl_ex_ex_ds1_files")
-endforeach (h5_file ${HDF5_TEST_FILES})
+endforeach ()
add_custom_target(hl_ex_ex_ds1_files ALL COMMENT "Copying files needed by hl_ex_ex_ds1 tests" DEPENDS ${hl_ex_ex_ds1_files_list})
# Remove any output file left over from previous test run
@@ -46,9 +57,22 @@ add_custom_target(hl_ex_ex_ds1_files ALL COMMENT "Copying files needed by hl_ex_
set (last_test "HL_ex-clear-objects")
foreach (example ${examples})
- add_test (NAME HL_ex_${example} COMMAND $<TARGET_FILE:hl_ex_${example}>)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (HL_ex_${example} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "HL_ex_${example}")
-endforeach (example ${examples})
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME HL_ex_${example} COMMAND $<TARGET_FILE:hl_ex_${example}>)
+ else ()
+ add_test (NAME HL_ex_${example} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:hl_ex_${example}>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=hl_ex_${example}.txt"
+ #-D "TEST_REFERENCE=hl_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 (HL_ex_${example} PROPERTIES DEPENDS ${last_test})
+ endif ()
+ set (last_test "HL_ex_${example}")
+endforeach ()