summaryrefslogtreecommitdiffstats
path: root/tools/test/h5ls/CMakeTests.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test/h5ls/CMakeTests.cmake')
-rw-r--r--tools/test/h5ls/CMakeTests.cmake66
1 files changed, 50 insertions, 16 deletions
diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake
index a66ae40..d5d0eb1 100644
--- a/tools/test/h5ls/CMakeTests.cmake
+++ b/tools/test/h5ls/CMakeTests.cmake
@@ -29,6 +29,7 @@
${HDF5_TOOLS_DIR}/testfiles/tslink.h5
${HDF5_TOOLS_DIR}/testfiles/tsoftlinks.h5
${HDF5_TOOLS_DIR}/testfiles/tstr.h5
+ ${HDF5_TOOLS_DIR}/testfiles/tudfilter.h5
${HDF5_TOOLS_DIR}/testfiles/tudlink.h5
${HDF5_TOOLS_DIR}/testfiles/tvldtypes1.h5
${HDF5_TOOLS_DIR}/testfiles/tdset_idx.h5
@@ -87,6 +88,7 @@
${HDF5_TOOLS_DIR}/testfiles/tsaf.ls
${HDF5_TOOLS_DIR}/testfiles/tslink-1.ls
${HDF5_TOOLS_DIR}/testfiles/tstr-1.ls
+ ${HDF5_TOOLS_DIR}/testfiles/tudfilter.ls
${HDF5_TOOLS_DIR}/testfiles/tudlink-1.ls
${HDF5_TOOLS_DIR}/testfiles/tvldtypes1.ls
${HDF5_TOOLS_DIR}/testfiles/tvldtypes2le.ls
@@ -100,7 +102,7 @@
foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES})
get_filename_component(fname "${listfiles}" NAME)
HDFTEST_COPY_FILE("${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5ls_files")
- endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES})
+ endforeach ()
add_custom_target(h5ls_files ALL COMMENT "Copying files needed by h5ls tests" DEPENDS ${h5ls_files_list})
##############################################################################
@@ -109,7 +111,7 @@
##############################################################################
##############################################################################
- MACRO (ADD_H5_TEST resultfile resultcode)
+ macro (ADD_H5_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN})
@@ -120,7 +122,7 @@
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
- else (HDF5_ENABLE_USING_MEMCHECKER)
+ else ()
add_test (
NAME H5LS-${resultfile}
COMMAND "${CMAKE_COMMAND}"
@@ -132,8 +134,35 @@
-D "TEST_REFERENCE=${resultfile}.ls"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- endif (HDF5_ENABLE_USING_MEMCHECKER)
- ENDMACRO (ADD_H5_TEST file)
+ endif ()
+ endmacro ()
+
+ macro (ADD_H5_UD_TEST testname resultcode resultfile)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ # Remove any output file left over from previous test run
+ add_test (
+ NAME H5LS_UD-${testname}-clearall-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ testfiles/${resultfile}.out
+ testfiles/${resultfile}.out.err
+ )
+ add_test (
+ NAME H5LS_UD-${testname}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
+ -D "TEST_ARGS=${ARGN}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=${resultfile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.ls"
+ -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
+ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5LS_UD-${testname} PROPERTIES DEPENDS H5LS_UD-${testname}-clearall-objects)
+ endif ()
+ endmacro ()
##############################################################################
##############################################################################
@@ -257,9 +286,9 @@
set_tests_properties (H5LS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test})
- endif (NOT "${last_test}" STREQUAL "")
+ endif ()
set (last_test "H5LS-clearall-objects")
- endif (HDF5_ENABLE_USING_MEMCHECKER)
+ endif ()
# See which filters are usable (and skip tests for filters we
# don't have). Do this by searching H5pubconf.h to see which
@@ -268,11 +297,11 @@
# detect whether the encoder is present.
if (H5_HAVE_FILTER_DEFLATE)
set (USE_FILTER_DEFLATE "true")
- endif (H5_HAVE_FILTER_DEFLATE)
+ endif ()
if (H5_HAVE_FILTER_SZIP)
set (USE_FILTER_SZIP "true")
- endif (H5_HAVE_FILTER_SZIP)
+ endif ()
# test the help syntax
ADD_H5_TEST (help-1 0 -w80 -h)
@@ -383,9 +412,9 @@
# ( HDFFV-7838, )
if (H5_WORDS_BIGENDIAN)
ADD_H5_TEST (tattrreg_be 0 -w80 -v -d tattrreg.h5)
- else (H5_WORDS_BIGENDIAN)
+ else ()
ADD_H5_TEST (tattrreg_le 0 -w80 -v -d tattrreg.h5)
- endif (H5_WORDS_BIGENDIAN)
+ endif ()
# test for non-existing file
ADD_H5_TEST (nosuchfile 1 nosuchfile.h5)
@@ -393,20 +422,25 @@
# test for variable length data types in verbose mode
if (H5_WORDS_BIGENDIAN)
ADD_H5_TEST (tvldtypes2be 0 -v tvldtypes1.h5)
- else (H5_WORDS_BIGENDIAN)
+ else ()
ADD_H5_TEST (tvldtypes2le 0 -v tvldtypes1.h5)
- endif (H5_WORDS_BIGENDIAN)
+ endif ()
# test for dataset region references data types in verbose mode
if (H5_WORDS_BIGENDIAN)
ADD_H5_TEST (tdataregbe 0 -v tdatareg.h5)
- else (H5_WORDS_BIGENDIAN)
+ else ()
ADD_H5_TEST (tdataregle 0 -v tdatareg.h5)
- endif (H5_WORDS_BIGENDIAN)
+ endif ()
# test for file with datasets that use Fixed Array chunk indices
if (USE_FILTER_DEFLATE)
# data read internal filters
ADD_H5_TEST (tdset_idx 0 -w80 -d tdset_idx.h5)
- endif (USE_FILTER_DEFLATE)
+ endif ()
+
+##############################################################################
+### P L U G I N T E S T S
+##############################################################################
+ADD_H5_UD_TEST (h5ls_plugin_test 0 tudfilter -w80 -d tudfilter.h5)