diff options
Diffstat (limited to 'tools/test')
-rw-r--r-- | tools/test/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tools/test/h5copy/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tools/test/h5diff/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tools/test/h5dump/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tools/test/h5format_convert/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tools/test/h5import/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tools/test/h5jam/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tools/test/h5ls/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tools/test/h5repack/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tools/test/h5repack/CMakeTests.cmake | 69 | ||||
-rw-r--r-- | tools/test/h5repack/h5repack.sh.in | 98 | ||||
-rw-r--r-- | tools/test/h5repack/testfiles/bounds_latest_latest.h5 | bin | 0 -> 82048 bytes | |||
-rw-r--r-- | tools/test/h5repack/testfiles/h5repack-help.txt | 19 | ||||
-rw-r--r-- | tools/test/h5stat/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tools/test/misc/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tools/test/misc/vds/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tools/test/perform/CMakeLists.txt | 2 |
17 files changed, 195 insertions, 17 deletions
diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt index 54dd5a2..f194d7a 100644 --- a/tools/test/CMakeLists.txt +++ b/tools/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST) #----------------------------------------------------------------------------- diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index 2f5f314..1f817fb 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5COPY) #----------------------------------------------------------------------------- diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index cedc932..aae6327 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5DIFF) #----------------------------------------------------------------------------- diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index 1941764..6a12f5e 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5DUMP) #----------------------------------------------------------------------------- diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt index 5287ae0..a27c78a 100644 --- a/tools/test/h5format_convert/CMakeLists.txt +++ b/tools/test/h5format_convert/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5FC) #----------------------------------------------------------------------------- diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt index 5492363..2cb212a 100644 --- a/tools/test/h5import/CMakeLists.txt +++ b/tools/test/h5import/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5IMPORT) #----------------------------------------------------------------------------- diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt index 17dda3c..b623860 100644 --- a/tools/test/h5jam/CMakeLists.txt +++ b/tools/test/h5jam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5JAM) #----------------------------------------------------------------------------- diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt index e92533f..8549046 100644 --- a/tools/test/h5ls/CMakeLists.txt +++ b/tools/test/h5ls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5LS) #----------------------------------------------------------------------------- diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index a606ac6..50eb0af 100644 --- a/tools/test/h5repack/CMakeLists.txt +++ b/tools/test/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5REPACK) #----------------------------------------------------------------------------- diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 13ebd17..f40c0b1 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -53,6 +53,7 @@ # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- set (LIST_HDF5_TEST_FILES + ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/bounds_latest_latest.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr_refs.h5 ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_deflate.h5 @@ -582,6 +583,62 @@ endif () endmacro () +# VERIFY_SUPERBLOCK + macro (ADD_H5_VERIFY_SUPERBLOCK testname testfile lowbound highbound superblock) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} + testfiles/${testfile}-${testname}-v.out + testfiles/${testfile}-${testname}-v.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${testname} + COMMAND $<TARGET_FILE:h5repack> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects) + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" + -D "TEST_ARGS:STRING=-H;-B;out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testfile}-${testname}-v.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FILTER:STRING=SUPERBLOCK_VERSION ${superblock}" + -D "TEST_REFERENCE=SUPERBLOCK_VERSION ${superblock}" + -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" + ) + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}) + endif () + endmacro () + + macro (ADD_H5_VERIFY_INVALIDBOUNDS testname resultcode lowbound highbound) + add_test ( + NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} + COMMAND $<TARGET_FILE:h5repack> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties ( + ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES + DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects + WILL_FAIL "true" + ) + endmacro () + macro (ADD_H5_TEST_META testname testfile) # Remove any output file left over from previous test run add_test ( @@ -1371,6 +1428,18 @@ ADD_H5_VERIFY_VDS (vds_conti ${TESTTYPE} 0 ${FILEV4} vds_dset CONTIGUOUS -l vds_dset:CONTI) ############################################################################## +### V E R S I O N B O U N D S T E S T S +############################################################################## +# -j 0 -k 2, superblock will be 0 +ADD_H5_VERIFY_SUPERBLOCK (SB_IS_0 h5repack_layout.h5 0 2 0) +# -j 1 -k 2, superblock will be 2 +ADD_H5_VERIFY_SUPERBLOCK (SB_IS_2 h5repack_layout.h5 1 2 2) +# -j 2 -k 2, superblock will be 3 +ADD_H5_VERIFY_SUPERBLOCK (SB_IS_3 h5repack_layout.h5 2 2 3) +# -j 0 -k 1, file cannot be opened +ADD_H5_VERIFY_INVALIDBOUNDS (latest_latest_invalid bounds_latest_latest.h5 0 1) + +############################################################################## ### P L U G I N T E S T S ############################################################################## ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,0,4,9,${H5_VERS_MAJOR},${H5_VERS_MINOR},${H5_VERS_RELEASE}) diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index e474bc3..b0a2f99 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -82,6 +82,7 @@ test -d $TESTDIR || mkdir $TESTDIR # Comment '#' without space can be used. # -------------------------------------------------------------------- LIST_HDF5_TEST_FILES=" +$SRC_H5REPACK_TESTFILES/bounds_latest_latest.h5 $SRC_H5REPACK_TESTFILES/h5repack_attr.h5 $SRC_H5REPACK_TESTFILES/h5repack_attr_refs.h5 $SRC_H5REPACK_TESTFILES/h5repack_deflate.h5 @@ -340,8 +341,8 @@ VERIFY_LAYOUT_DSET() fi # clean up tmp files - rm -f $outfile - rm -f $layoutfile +# rm -f $outfile +# rm -f $layoutfile } #------------------------------------------ @@ -513,6 +514,87 @@ VERIFY_LAYOUT_ALL() rm -f $layoutfile } +#-------------------------------------------------------------- +# Verifying superblock of a file with different version bounds +VERIFY_SUPERBLOCK() +{ + lowbound=$1 + highbound=$2 + superblock=$3 + infile=$4 + layoutfile=verbounds-low$lowbound-high$highbound.$4 + outfile=out-verbounds-low$lowbound-high$highbound.$infile + expectedsuperblock="SUPERBLOCK_VERSION $superblock" + + shift + shift + shift + shift + + TESTING $H5REPACK $@ + ( + cd $TESTDIR + $RUNSERIAL $H5REPACK_BIN -j $lowbound -k $highbound $infile $outfile + ) + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + DIFFTEST $infile $outfile + fi + + #--------------------------------- + # check the layout from a dataset + VERIFY "superblock" + ( + cd $TESTDIR + $RUNSERIAL $H5DUMP_BIN -H -B $outfile > $layoutfile + ) + $GREP "$expectedsuperblock" $TESTDIR/$layoutfile > /dev/null + if [ $? -eq 0 ]; then + echo " PASSED" + else + echo " FAILED" + nerrors="`expr $nerrors + 1`" + fi + + # clean up tmp files + rm -f $outfile + rm -f $layoutfile + +} # end of VERIFY_SUPERBLOCK + +#------------------------------------------------------------------ +# Verifying that a latest file cannot be opened with earlier bounds +VERIFY_INVALIDBOUNDS() +{ + lowbound=$1 + highbound=$2 + infile=$3 + outfile=out-verbounds-low$lowbound-high$highbound.$infile + + #-------------------------------------- + # check for failure with invalid bounds + TESTING $H5REPACK $@ + ( + cd $TESTDIR + $RUNSERIAL $H5REPACK_BIN -j $lowbound -k $highbound $infile $outfile + ) + RET=$? + if [ $RET != 0 ] ; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + fi + + # clean up tmp files + rm -f $outfile + +} # end of VERIFY_INVALIDBOUNDS + # same as TOOLTEST, but it uses the old syntax -i input_file -o output_file # TOOLTEST0() @@ -1365,6 +1447,18 @@ else VERIFY_LAYOUT_VDS vds_conti 4_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI fi +######################################################### +# Testing version bounds +######################################################### +# -j 0 -k 2, superblock will be 0 +VERIFY_SUPERBLOCK 0 2 0 h5repack_layout.h5 -j 0 -k 2 h5repack_layout.h5 +# -j 1 -k 2, superblock will be 2 +VERIFY_SUPERBLOCK 1 2 2 h5repack_layout.h5 -j 1 -k 2 h5repack_layout.h5 +# -j 2 -k 2, superblock will be 3 +VERIFY_SUPERBLOCK 2 2 3 h5repack_layout.h5 -j 2 -k 2 h5repack_layout.h5 +# -j 0 -k 1, file cannot be opened +VERIFY_INVALIDBOUNDS 0 1 bounds_latest_latest.h5 + # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR diff --git a/tools/test/h5repack/testfiles/bounds_latest_latest.h5 b/tools/test/h5repack/testfiles/bounds_latest_latest.h5 Binary files differnew file mode 100644 index 0000000..6e8bcad --- /dev/null +++ b/tools/test/h5repack/testfiles/bounds_latest_latest.h5 diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt index 1ff5b73..0eef0f5 100644 --- a/tools/test/h5repack/testfiles/h5repack-help.txt +++ b/tools/test/h5repack/testfiles/h5repack-help.txt @@ -6,7 +6,13 @@ usage: h5repack [OPTIONS] file1 file2 -v, --verbose Verbose mode, print object information -V, --version Print version number and exit -n, --native Use a native HDF5 type when repacking + --enable-error-stack Prints messages from the HDF5 error stack as they occur -L, --latest Use latest version of file format + This option will take precedence over the -j and -k options + --low=BOUND The low bound for library release versions to use when creating + objects in the file (default is H5F_LIBVER_EARLIEST) + --high=BOUND The high bound for library release versions to use when creating + objects in the file (default is H5F_LIBVER_LATEST) -c L1, --compact=L1 Maximum number of links in header messages -d L2, --indexed=L2 Minimum number of links in the indexed format -s S[:F], --ssize=S[:F] Shared object header message minimum size @@ -39,8 +45,12 @@ usage: h5repack [OPTIONS] file1 file2 F - is the shared object header message type, any of <dspace|dtype|fill| pline|attr>. If F is not specified, S applies to all messages - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. + BOUND is an integer indicating the library release versions to use when creating + objects in the file (see H5Pset_libver_bounds()): + 0: This is H5F_LIBVER_EARLIEST in H5F_libver_t struct + 1: This is H5F_LIBVER_V18 in H5F_libver_t struct + 2: This is H5F_LIBVER_V110 in H5F_libver_t struct + (H5F_LIBVER_LATEST is aliased to H5F_LIBVER_V110 for this release FS_STRATEGY is a string indicating the file space strategy used: FSM_AGGR: @@ -130,6 +140,11 @@ Examples of use: Using latest file format with maximum compact group size of 10 and and minimum shared datatype size of 20 +5) h5repack --low=0 --high=1 file1 file2 + + Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via H5Pset_libver_bounds() when + creating the repacked file: file2 + 5) h5repack -f SHUF -f GZIP=1 file1 file2 Add both filters SHUF and GZIP in this order to all datasets diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt index 0d07753..5f645097 100644 --- a/tools/test/h5stat/CMakeLists.txt +++ b/tools/test/h5stat/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_H5STAT) #----------------------------------------------------------------------------- diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index 178767a..084751a 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_MISC) #----------------------------------------------------------------------------- diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt index 5b34c43..50aade4 100644 --- a/tools/test/misc/vds/CMakeLists.txt +++ b/tools/test/misc/vds/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_MISC_VDS) #----------------------------------------------------------------------------- diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index b7452e0..5104b90 100644 --- a/tools/test/perform/CMakeLists.txt +++ b/tools/test/perform/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.3.2) +cmake_minimum_required (VERSION 3.10) PROJECT (HDF5_TOOLS_TEST_PERFORM ) #----------------------------------------------------------------------------- |