summaryrefslogtreecommitdiffstats
path: root/tools/test/h5dump
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-12-13 20:29:22 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-12-13 20:29:22 (GMT)
commit4da73f893ab4df56871e11d82978d21b6b9a6ecb (patch)
treec6115d2f32c9fa4d17f3d476d2dd55265da1dc7a /tools/test/h5dump
parent386be69a30f2ef8db94c32b1d9731fd379a4062a (diff)
downloadhdf5-4da73f893ab4df56871e11d82978d21b6b9a6ecb.zip
hdf5-4da73f893ab4df56871e11d82978d21b6b9a6ecb.tar.gz
hdf5-4da73f893ab4df56871e11d82978d21b6b9a6ecb.tar.bz2
Add h5dump VDS prefix tests
Diffstat (limited to 'tools/test/h5dump')
-rw-r--r--tools/test/h5dump/CMakeTestsVDS.cmake67
1 files changed, 67 insertions, 0 deletions
diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake
index 3addecf..368471c 100644
--- a/tools/test/h5dump/CMakeTestsVDS.cmake
+++ b/tools/test/h5dump/CMakeTestsVDS.cmake
@@ -72,6 +72,14 @@
f-3.h5
vds-eiger.h5
)
+ set (HDF5_REFERENCE_PREFIX_VDS
+ 1_vds.h5
+ 2_vds.h5
+ 4_vds.h5
+ 5_vds.h5
+ vds-percival-unlim-maxmin.h5
+ vds-eiger.h5
+ )
set (HDF5_ERROR_REFERENCE_VDS
)
@@ -80,12 +88,21 @@
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files")
endforeach ()
+ foreach (vds_h5_file ${HDF5_REFERENCE_PREFIX_VDS})
+ get_filename_component(fname "${vds_h5_file}" NAME)
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${vds_h5_file}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5dump_vds_files")
+ endforeach ()
foreach (ddl_vds ${HDF5_REFERENCE_VDS})
get_filename_component(fname "${ddl_vds}" NAME)
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files")
endforeach ()
+ foreach (ddl_vds ${HDF5_REFERENCE_VDS})
+ get_filename_component(fname "${ddl_vds}" NAME)
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5dump_vds_files")
+ endforeach ()
+
foreach (ddl_vds ${HDF5_ERROR_REFERENCE_VDS})
get_filename_component(fname "${ddl_vds}" NAME)
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/errfiles/${ddl_vds}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5dump_vds_files")
@@ -134,6 +151,44 @@
endif ()
endmacro ()
+ macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode)
+ # If using memchecker add tests without using scripts
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
+ set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix")
+ if (NOT "${resultcode}" STREQUAL "0")
+ set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true")
+ endif ()
+ if (NOT "${last_vds_test}" STREQUAL "")
+ set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_VDS_test})
+ endif ()
+ else ()
+ # Remove any output file left over from previous test run
+ add_test (
+ NAME H5DUMP_PREFIX-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ${resultfile}.out
+ ${resultfile}.out.err
+ )
+ set_tests_properties (H5DUMP_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix")
+ add_test (
+ NAME H5DUMP_PREFIX-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_ARGS:STRING=${ARGN}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds/prefix"
+ -D "TEST_OUTPUT=${resultfile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.ddl"
+ -D "TEST_ENV_VAR=HDF5_VDS_PREFIX"
+ -D "TEST_ENV_VALUE=${PROJECT_BINARY_DIR}/testfiles/vds/"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS H5DUMP_PREFIX-${resultfile}-clear-objects)
+ endif ()
+ endmacro ()
+
macro (ADD_H5_VDS_LAYOUT resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
@@ -261,3 +316,15 @@
ADD_H5_VDS_LAYOUT (vds_layout-eiger 0 --enable-error-stack vds-eiger.h5)
ADD_H5_VDS_LAYOUT (vds_layout-maxmin 0 --enable-error-stack vds-percival-unlim-maxmin.h5)
endif ()
+
+ # Data read with prefix
+ if (USE_FILTER_DEFLATE)
+ ADD_H5_VDS_PREFIX_TEST (tvds-1 0 --enable-error-stack 1_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-2 0 --enable-error-stack 2_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-4 0 --enable-error-stack 4_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-5 0 --enable-error-stack 5_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (vds-first 0 --vds-view-first-missing --enable-error-stack vds-percival-unlim-maxmin.h5)
+ ADD_H5_VDS_PREFIX_TEST (vds-gap1 0 -d /VDS-Eiger --vds-gap-size=1 --enable-error-stack vds-eiger.h5)
+ ADD_H5_VDS_PREFIX_TEST (vds-gap2 0 --vds-gap-size=2 --enable-error-stack vds-eiger.h5)
+ endif ()
+