summaryrefslogtreecommitdiffstats
path: root/tools/test
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-12-13 21:08:04 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-12-13 21:08:04 (GMT)
commitba714e682047d19fba7ef2c87b072f75ac772e88 (patch)
treebc15ce0b925a7edfb7d69c6d017f17460eda6db4 /tools/test
parent4da73f893ab4df56871e11d82978d21b6b9a6ecb (diff)
downloadhdf5-ba714e682047d19fba7ef2c87b072f75ac772e88.zip
hdf5-ba714e682047d19fba7ef2c87b072f75ac772e88.tar.gz
hdf5-ba714e682047d19fba7ef2c87b072f75ac772e88.tar.bz2
HDFFV-9724 Add H5LS prefix test with ${ORIGIN}
Diffstat (limited to 'tools/test')
-rw-r--r--tools/test/h5ls/CMakeTestsVDS.cmake55
-rw-r--r--tools/test/h5ls/vds_prefix/tvds-1.ls14
-rw-r--r--tools/test/h5ls/vds_prefix/tvds-2.ls13
-rw-r--r--tools/test/h5ls/vds_prefix/tvds-3_1.ls14
-rw-r--r--tools/test/h5ls/vds_prefix/tvds-3_2.ls13
-rw-r--r--tools/test/h5ls/vds_prefix/tvds-4.ls9
-rw-r--r--tools/test/h5ls/vds_prefix/tvds-5.ls11
7 files changed, 129 insertions, 0 deletions
diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake
index 5df61bb..f7eb198 100644
--- a/tools/test/h5ls/CMakeTestsVDS.cmake
+++ b/tools/test/h5ls/CMakeTestsVDS.cmake
@@ -61,6 +61,17 @@
get_filename_component(fname "${listfiles}" NAME)
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/${fname}" "h5ls_vds_files")
endforeach ()
+
+ foreach (listfiles ${LIST_HDF5_TEST_FILES})
+ get_filename_component(fname "${listfiles}" NAME)
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/vds/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files")
+ endforeach ()
+
+ foreach (listfiles ${LIST_OTHER_TEST_FILES})
+ get_filename_component(fname "${listfiles}" NAME)
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5LS_SOURCE_DIR}/vds_prefix/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/vds/prefix/${fname}" "h5ls_vds_files")
+ endforeach ()
+
add_custom_target(h5ls_vds_files ALL COMMENT "Copying files needed by h5ls_vds tests" DEPENDS ${h5ls_vds_files_list})
##############################################################################
@@ -104,6 +115,43 @@
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 H5LS_PREFIX-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN})
+ set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
+ if ("${resultcode}" STREQUAL "1")
+ set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true")
+ endif ()
+ if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_test})
+ endif ()
+ else ()
+ add_test (
+ NAME H5LS_PREFIX-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ${resultfile}.out
+ ${resultfile}.out.err
+ )
+ set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
+ add_test (
+ NAME H5LS_PREFIX-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
+ -D "TEST_ARGS=${ARGN}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=vds/prefix/${resultfile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=vds/prefix/${resultfile}.ls"
+ -D "TEST_ENV_VAR=HDF5_VDS_PREFIX"
+ -D "TEST_ENV_VALUE=\${ORIGIN}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS H5LS_PREFIX-${resultfile}-clear-objects)
+ endif ()
+ endmacro ()
+
##############################################################################
##############################################################################
### T H E T E S T S ###
@@ -155,3 +203,10 @@
ADD_H5_VDS_TEST (tvds-4 0 -w80 -v -S 4_vds.h5)
ADD_H5_VDS_TEST (tvds-5 0 -w80 -v -S 5_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-1 0 -w80 -v -S vds/prefix/1_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-2 0 -w80 -v -S vds/prefix/2_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-3_1 0 -w80 -v -S vds/prefix/3_1_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-3_2 0 -w80 -v -S vds/prefix/3_2_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-4 0 -w80 -v -S vds/prefix/4_vds.h5)
+ ADD_H5_VDS_PREFIX_TEST (tvds-5 0 -w80 -v -S vds/prefix/5_vds.h5)
+
diff --git a/tools/test/h5ls/vds_prefix/tvds-1.ls b/tools/test/h5ls/vds_prefix/tvds-1.ls
new file mode 100644
index 0000000..2830d1a
--- /dev/null
+++ b/tools/test/h5ls/vds_prefix/tvds-1.ls
@@ -0,0 +1,14 @@
+Opened "vds/prefix/1_vds.h5" with sec2 driver.
+vds_dset Dataset {5/Inf, 18/18, 8/8}
+ Location: 1:800
+ Links: 1
+ Maps: {6} Source {
+ 1_a.h5 /source_dset
+ 1_b.h5 /source_dset
+ 1_c.h5 /source_dset
+ 1_d.h5 /source_dset
+ 1_e.h5 /source_dset
+ 1_f.h5 /source_dset
+ }
+ Storage: 2880 logical bytes, 0 allocated bytes
+ Type: 32-bit little-endian integer
diff --git a/tools/test/h5ls/vds_prefix/tvds-2.ls b/tools/test/h5ls/vds_prefix/tvds-2.ls
new file mode 100644
index 0000000..5c6f9d3
--- /dev/null
+++ b/tools/test/h5ls/vds_prefix/tvds-2.ls
@@ -0,0 +1,13 @@
+Opened "vds/prefix/2_vds.h5" with sec2 driver.
+vds_dset Dataset {6/Inf, 8/8, 14/14}
+ Location: 1:800
+ Links: 1
+ Maps: {5} Source {
+ 2_a.h5 /source_dset
+ 2_b.h5 /source_dset
+ 2_c.h5 /source_dset
+ 2_d.h5 /source_dset
+ 2_e.h5 /source_dset
+ }
+ Storage: 2688 logical bytes, 0 allocated bytes
+ Type: 32-bit little-endian integer
diff --git a/tools/test/h5ls/vds_prefix/tvds-3_1.ls b/tools/test/h5ls/vds_prefix/tvds-3_1.ls
new file mode 100644
index 0000000..f4c8e78
--- /dev/null
+++ b/tools/test/h5ls/vds_prefix/tvds-3_1.ls
@@ -0,0 +1,14 @@
+Opened "vds/prefix/3_1_vds.h5" with sec2 driver.
+vds_dset Dataset {5/Inf, 25/25, 8/8}
+ Location: 1:800
+ Links: 1
+ Maps: {6} Source {
+ 1_a.h5 /source_dset
+ 1_b.h5 /source_dset
+ 1_c.h5 /source_dset
+ 1_d.h5 /source_dset
+ 1_e.h5 /source_dset
+ 1_f.h5 /source_dset
+ }
+ Storage: 4000 logical bytes, 0 allocated bytes
+ Type: 32-bit little-endian integer
diff --git a/tools/test/h5ls/vds_prefix/tvds-3_2.ls b/tools/test/h5ls/vds_prefix/tvds-3_2.ls
new file mode 100644
index 0000000..5a7e2d8
--- /dev/null
+++ b/tools/test/h5ls/vds_prefix/tvds-3_2.ls
@@ -0,0 +1,13 @@
+Opened "vds/prefix/3_2_vds.h5" with sec2 driver.
+vds_dset Dataset {6/Inf, 13/13, 19/19}
+ Location: 1:800
+ Links: 1
+ Maps: {5} Source {
+ 2_a.h5 /source_dset
+ 2_b.h5 /source_dset
+ 2_c.h5 /source_dset
+ 2_d.h5 /source_dset
+ 2_e.h5 /source_dset
+ }
+ Storage: 5928 logical bytes, 0 allocated bytes
+ Type: 32-bit little-endian integer
diff --git a/tools/test/h5ls/vds_prefix/tvds-4.ls b/tools/test/h5ls/vds_prefix/tvds-4.ls
new file mode 100644
index 0000000..c22d3a4
--- /dev/null
+++ b/tools/test/h5ls/vds_prefix/tvds-4.ls
@@ -0,0 +1,9 @@
+Opened "vds/prefix/4_vds.h5" with sec2 driver.
+vds_dset Dataset {9/Inf, 4/4, 4/4}
+ Location: 1:800
+ Links: 1
+ Maps: {1} Source {
+ 4_%b.h5 /source_dset
+ }
+ Storage: 576 logical bytes, 0 allocated bytes
+ Type: 32-bit little-endian integer
diff --git a/tools/test/h5ls/vds_prefix/tvds-5.ls b/tools/test/h5ls/vds_prefix/tvds-5.ls
new file mode 100644
index 0000000..efba8dc
--- /dev/null
+++ b/tools/test/h5ls/vds_prefix/tvds-5.ls
@@ -0,0 +1,11 @@
+Opened "vds/prefix/5_vds.h5" with sec2 driver.
+vds_dset Dataset {9/Inf, 4/4, 4/4}
+ Location: 1:800
+ Links: 1
+ Maps: {3} Source {
+ 5_a.h5 /source_dset
+ 5_b.h5 /source_dset
+ 5_c.h5 /source_dset
+ }
+ Storage: 576 logical bytes, 0 allocated bytes
+ Type: 32-bit little-endian integer