summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CTestConfig.cmake2
-rw-r--r--config/cmake/userblockTest.cmake10
-rw-r--r--tools/h5copy/CMakeLists.txt51
-rw-r--r--tools/h5copy/testh5copy.sh.in367
-rw-r--r--tools/h5jam/CMakeLists.txt532
-rw-r--r--tools/h5jam/testh5jam.sh.in31
-rw-r--r--tools/h5repack/h5repack.sh.in357
7 files changed, 670 insertions, 680 deletions
diff --git a/CTestConfig.cmake b/CTestConfig.cmake
index 2237192..c368433 100644
--- a/CTestConfig.cmake
+++ b/CTestConfig.cmake
@@ -20,6 +20,8 @@ SET (CTEST_DROP_SITE_CDASH TRUE)
SET (UPDATE_TYPE svn)
SET (VALGRIND_COMMAND "/usr/bin/valgrind")
SET (VALGRIND_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe")
+SET (CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind")
+SET (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe")
SET (CTEST_TEST_TIMEOUT 3600 CACHE STRING
"Maximum time allowed before CTest will kill the test.")
diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake
index 5e8a808..8910bb2 100644
--- a/config/cmake/userblockTest.cmake
+++ b/config/cmake/userblockTest.cmake
@@ -65,17 +65,17 @@ IF (TEST_CHECKUB STREQUAL "YES")
COMMAND ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
- OUTPUT_FILE ${TEST_UFILE}.cmp
+ OUTPUT_FILE ${TEST_HFILE}-ub.cmp
OUTPUT_VARIABLE TEST_ERROR
ERROR_VARIABLE TEST_ERROR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
#cat $ufile >> $cmpfile
FILE (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME)
- FILE (APPEND ${TEST_UFILE}.cmp "${TEST_STREAM}")
+ FILE (APPEND ${TEST_HFILE}-ub.cmp "${TEST_STREAM}")
ELSE (NOT TEST_O_STRING_LEN STREQUAL "0")
FILE (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME)
- FILE (WRITE ${TEST_UFILE}.cmp ${TEST_STREAM})
+ FILE (WRITE ${TEST_HFILE}-ub.cmp ${TEST_STREAM})
ENDIF (NOT TEST_O_STRING_LEN STREQUAL "0")
#$JAM_BIN/getub -c $size $hfile > $tfile
@@ -91,14 +91,14 @@ IF (TEST_CHECKUB STREQUAL "YES")
# now compare the outputs
EXECUTE_PROCESS (
- COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_UFILE}.cmp ${TEST_HFILE}.cmp
+ COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_HFILE}-ub.cmp ${TEST_HFILE}.cmp
RESULT_VARIABLE TEST_RESULT
)
MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}+${TEST_O_STRING_LEN}")
# if the return value is !=${TEST_EXPECT} bail out
IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT})
- MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_UFILE} did not match ${TEST_HFILE}.\n${TEST_ERROR}")
+ MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}")
ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT})
ELSE (TEST_CHECKUB STREQUAL "YES")
# call 'ubsize' to get the size of the user block
diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt
index 60e940a..7f68e76 100644
--- a/tools/h5copy/CMakeLists.txt
+++ b/tools/h5copy/CMakeLists.txt
@@ -44,9 +44,6 @@ IF (BUILD_TESTING)
SET (LIST_OTHER_TEST_FILES
${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out
- ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.out.ls
- ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.out.ls
- ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.out.ls
)
FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
@@ -227,42 +224,6 @@ IF (BUILD_TESTING)
ENDMACRO (ADD_H5_TEST_SAME)
#
- # Test result with h5ls
- #
- MACRO (ADD_H5LS_TEST infile filetest)
- # If using memchecker add tests without using scripts
- IF (HDF5_ENABLE_USING_MEMCHECKER)
- ADD_TEST (NAME H5COPY-h5ls-${infile}-${filetest} COMMAND $<TARGET_FILE:h5ls> -Svr ./testfiles/${filetest}.out.h5)
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5COPY-h5ls-${infile}-${filetest} PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- ELSE (HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- ADD_TEST (
- NAME H5COPY-h5ls-${infile}-${filetest}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/${filetest}.out.h5
- ./testfiles/${filetest}.out.out
- ./testfiles/${filetest}.out.out.err
- )
- ADD_TEST (
- NAME H5COPY-h5ls-${file}-${filetest}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
- -D "TEST_ARGS=-Svr;./testfiles/${filetest}.out.h5"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -D "TEST_OUTPUT=./testfiles/${filetest}.out.out"
- -D "TEST_EXPECT=0"
- -D "TEST_REFERENCE=./testfiles/${infile}.out.ls"
- -D "TEST_MASK=true"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
- )
- SET_TESTS_PROPERTIES (H5COPY-h5ls-${infile}-${filetest} PROPERTIES DEPENDS H5COPY-h5ls-${infile}-${filetest}-clear-objects)
- ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
- ENDMACRO (ADD_H5LS_TEST)
-
- #
# Similiar to ADD_H5_TEST macro. Compare to outputs from source & target
# files instead of checking with h5ls.
#
@@ -399,20 +360,12 @@ IF (BUILD_TESTING)
ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets/simple -d /C/D/simple)
ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets)
ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested)
-
- # Verify that the file created above is correct
- # This test is not independent of the above tests
- #ADD_H5LS_TEST (${HDF_FILE1} basic)
############# COPY REFERENCES ##############
# "Test copying object and region references"
ADD_H5_F_TEST (region_ref 2 ${HDF_FILE2}.h5 ref -v -s / -d /COPY)
- # Verify that the file created above is correct
- # This test is not independent of the above tests
- #ADD_H5LS_TEST (${HDF_FILE2} refs)
-
############# COPY EXT LINKS ##############
# "Test copying external link directly without -f ext"
@@ -439,10 +392,6 @@ IF (BUILD_TESTING)
# "Test copying a group contains external links with -f ext"
ADD_H5_F_TEST (ext_link_group_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext -d /copy2_group)
- # Verify that the file created above is correct
- # This test is not independent of the above tests
- #ADD_H5LS_TEST (${HDF_EXT_SRC_FILE} links)
-
############# Test misc. ##############
#-----------------------------------------------------------------
diff --git a/tools/h5copy/testh5copy.sh.in b/tools/h5copy/testh5copy.sh.in
index cd5f677..d30d8d8 100644
--- a/tools/h5copy/testh5copy.sh.in
+++ b/tools/h5copy/testh5copy.sh.in
@@ -57,9 +57,6 @@ $SRC_H5COPY_TESTFILES/h5copy_extlinks_trg.h5
# List of expect files that will be copied over to local test dir
LIST_OTHER_TEST_FILES="
-$SRC_H5COPY_TESTFILES/h5copy_extlinks_src.out.ls
-$SRC_H5COPY_TESTFILES/h5copy_ref.out.ls
-$SRC_H5COPY_TESTFILES/h5copytst.out.ls
$SRC_H5COPY_TESTFILES/h5copy_misc1.out
"
@@ -151,15 +148,6 @@ VERIFY()
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Verifying".
#
-VERIFY_H5LS()
-{
- SPACES=" "
- echo "Verifying h5ls file structure $* $SPACES" | cut -c1-70 | tr -d '\012'
-}
-
-# Print a line-line message left justified in a field of 70 characters
-# beginning with the word "Verifying".
-#
VERIFY_OUTPUT()
{
SPACES=" "
@@ -183,24 +171,34 @@ TOOLTEST()
{
actualout="$TESTDIR/tooltest.actualout"
actualerr="$TESTDIR/tooltest.actualerr"
- runh5diff=yes
- if [ "$1" = -i ]; then
- inputfile=$2
- else
- runh5diff=no
- fi
- if [ "$3" = -o ]; then
- outputfile=$4
- else
- runh5diff=no
- fi
+ runh5diff=yes
+ if [ "$1" = -i ]; then
+ inputfile=$2
+ else
+ if [ "$1" = -f ]; then
+ inputfile=$4
+ else
+ inputfile=$3
+ fi
+ runh5diff=no
+ fi
+ if [ "$3" = -o ]; then
+ outputfile=$4
+ else
+ if [ "$1" = -f ]; then
+ outputfile=$6
+ else
+ outputfile=$5
+ fi
+ runh5diff=no
+ fi
TESTING $H5COPY $@
(
- echo "#############################"
- echo " output for '$H5COPY $@'"
- echo "#############################"
- $RUNSERIAL $H5COPY_BIN $@
+ echo "#############################"
+ echo " output for '$H5COPY $@'"
+ echo "#############################"
+ $RUNSERIAL $H5COPY_BIN $@
) > $actualout 2> $actualerr
RET=$?
if [ $RET != 0 ]; then
@@ -210,15 +208,141 @@ TOOLTEST()
nerrors="`expr $nerrors + 1`"
else
echo " PASSED"
+
+ if [ $runh5diff != no ]; then
+ H5DIFFTEST $inputfile $outputfile $7 $9
+ fi
# Clean up output file
if test -z "$HDF5_NOCLEANUP"; then
- rm -f $actualout $actualerr
+ rm -f $actualout $actualerr $outputfile
+ fi
+ fi
+}
+
+# TOOLTEST back-to-back
+TOOLTEST_PREFILL()
+{
+ actualout="$TESTDIR/tooltest.actualout"
+ actualerr="$TESTDIR/tooltest.actualerr"
+ runh5diff=yes
+ if [ "$1" = -i ]; then
+ inputfile=$2
+ else
+ runh5diff=no
+ fi
+ if [ "$3" = -o ]; then
+ outputfile=$4
+ else
+ runh5diff=no
+ fi
+
+ grp_name=$5
+ grp_name2=$6
+ obj_name=$7
+ obj_name2=$8
+
+ TESTING $H5COPY $@
+ (
+ echo "#############################"
+ echo " output for '$H5COPY $@'"
+ echo "#############################"
+ $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name2
+ ) > $actualout 2> $actualerr
+ RET=$?
+ if [ $RET != 0 ]; then
+ echo "*FAILED*"
+ echo "failed result is:"
+ cat $actualout
+ nerrors="`expr $nerrors + 1`"
+ else
+ TESTING $H5COPY $@
+ (
+ echo "#############################"
+ echo " output for '$H5COPY $@'"
+ echo "#############################"
+ $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $obj_name -d $obj_name2
+ ) > $actualout 2> $actualerr
+ RET=$?
+ if [ $RET != 0 ]; then
+ echo "*FAILED*"
+ echo "failed result is:"
+ cat $actualout
+ nerrors="`expr $nerrors + 1`"
+ else
+ echo " PASSED"
+
+ if [ $runh5diff != no ]; then
+ H5DIFFTEST $inputfile $outputfile $obj_name $obj_name2
+ fi
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $actualout $actualerr $outputfile
+ fi
fi
fi
+}
+
+# TOOLTEST back-to-back
+TOOLTEST_SAME()
+{
+ actualout="$TESTDIR/tooltest.actualout"
+ actualerr="$TESTDIR/tooltest.actualerr"
+ runh5diff=yes
+ if [ "$1" = -i ]; then
+ inputfile=$2
+ else
+ runh5diff=no
+ fi
+ if [ "$3" = -o ]; then
+ outputfile=$4
+ else
+ runh5diff=no
+ fi
- if [ $runh5diff != no ]; then
- H5DIFFTEST $inputfile $outputfile $7 $9
+ grp_name=$5
+ grp_name2=$6
+
+ TESTING $H5COPY $@
+ (
+ echo "#############################"
+ echo " output for '$H5COPY $@'"
+ echo "#############################"
+ $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name
+ ) > $actualout 2> $actualerr
+ RET=$?
+ if [ $RET != 0 ]; then
+ echo "*FAILED*"
+ echo "failed result is:"
+ cat $actualout
+ nerrors="`expr $nerrors + 1`"
+ else
+ TESTING $H5COPY $@
+ (
+ echo "#############################"
+ echo " output for '$H5COPY $@'"
+ echo "#############################"
+ $RUNSERIAL $H5COPY_BIN -i $outputfile -o $outputfile -v -s $grp_name -d $grp_name2
+ ) > $actualout 2> $actualerr
+ RET=$?
+ if [ $RET != 0 ]; then
+ echo "*FAILED*"
+ echo "failed result is:"
+ cat $actualout
+ nerrors="`expr $nerrors + 1`"
+ else
+ echo " PASSED"
+
+ if [ $runh5diff != no ]; then
+ H5DIFFTEST $outputfile $outputfile $grp_name $grp_name2
+ fi
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $actualout $actualerr $outputfile
+ fi
+ fi
fi
}
@@ -259,18 +383,18 @@ TOOLTEST_FAIL()
actualerr_sav=${actualerr}-sav
shift
if [ "$1" = -i ]; then
- inputfile=$2
+ inputfile=$2
fi
if [ "$3" = -o ]; then
- outputfile=$4
+ outputfile=$4
fi
TESTING $H5COPY $@
(
- #echo "#############################"
- #echo " output for '$H5COPY $@'"
- #echo "#############################"
- $RUNSERIAL $H5COPY_BIN $@
+ #echo "#############################"
+ #echo " output for '$H5COPY $@'"
+ #echo "#############################"
+ $RUNSERIAL $H5COPY_BIN $@
) > $actualout 2> $actualerr
RET=$?
@@ -298,7 +422,7 @@ TOOLTEST_FAIL()
# Clean up output file
if test -z "$HDF5_NOCLEANUP"; then
- rm -f $actualout $actualerr $actualout_sav $actualerr_sav
+ rm -f $actualout $actualerr $actualout_sav $actualerr_sav $outputfile
fi
}
@@ -311,10 +435,10 @@ H5DIFFTEST()
$RUNSERIAL $H5DIFF_BIN -q "$@"
RET=$?
if [ $RET != 0 ] ; then
- echo "*FAILED*"
- nerrors="`expr $nerrors + 1`"
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
else
- echo " PASSED"
+ echo " PASSED"
fi
}
@@ -327,50 +451,13 @@ H5DIFFTEST_FAIL()
RET=$?
if [ $h5haveexitcode = 'yes' -a $RET != 1 ] ; then
- echo "*FAILED*"
- nerrors="`expr $nerrors + 1`"
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
else
- echo " PASSED"
+ echo " PASSED"
fi
}
-# Call the h5ls tool to verify the correct output data in the destination file
-#
-H5LSTEST()
-{
- expect="$TESTDIR/`basename $1 .h5`.ls"
- actual="$TESTDIR/`basename $1 .h5`.ls.actualout"
-
- # Stderr is included in stdout so that the diff can detect
- # any unexpected output from that stream too.
- #
- # Note: The modification time and storage utilization are masked off
- # so that the output is more portable
- VERIFY_H5LS $@
- (
- $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@
- ) 2>&1 |sed 's/Modified:.*/Modified: XXXX-XX-XX XX:XX:XX XXX/' |sed 's/Storage:.*/Storage: <details removed for portability>/' >$actual
-
-
- if [ ! -f $expect ]; then
- # Create the expect file if it doesn't yet exist.
- echo " CREATED"
- cp $actual $expect
- elif $CMP $expect $actual; then
- echo " PASSED"
- else
- echo "*FAILED*"
- echo " Expected result (*.ls) differs from actual result (*.out)"
- nerrors="`expr $nerrors + 1`"
- test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
- fi
-
- # Clean up output file
- if test -z "$HDF5_NOCLEANUP"; then
- rm -f $actual $actual_err
- fi
-}
-
# Copy single datasets of various forms from one group to another,
# adding object copied to the destination file each time
#
@@ -379,82 +466,54 @@ H5LSTEST()
COPY_OBJECTS()
{
TESTFILE="$TESTDIR/h5copytst.h5"
- FILEOUT="$TESTDIR/`basename h5copytst.h5 .h5`.out.h5"
-
- # Remove any output file left over from previous test run
- rm -f $FILEOUT
- echo "Testing from `basename $TESTFILE` to `basename $FILEOUT` for the following tests:"
echo "Test copying various forms of datasets"
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s simple -d simple
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s chunk -d chunk
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compact -d compact
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compound -d compound
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compressed -d compressed
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s named_vl -d named_vl
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s nested_vl -d nested_vl
+ TOOLTEST -i $TESTFILE -o $TESTDIR/simple.out.h5 -v -s simple -d simple
+ TOOLTEST -i $TESTFILE -o $TESTDIR/chunk.out.h5 -v -s chunk -d chunk
+ TOOLTEST -i $TESTFILE -o $TESTDIR/compact.out.h5 -v -s compact -d compact
+ TOOLTEST -i $TESTFILE -o $TESTDIR/compound.out.h5 -v -s compound -d compound
+ TOOLTEST -i $TESTFILE -o $TESTDIR/compressed.out.h5 -v -s compressed -d compressed
+ TOOLTEST -i $TESTFILE -o $TESTDIR/named_vl.out.h5 -v -s named_vl -d named_vl
+ TOOLTEST -i $TESTFILE -o $TESTDIR/nested_vl.out.h5 -v -s nested_vl -d nested_vl
echo "Test copying dataset within group in source file to root of destination"
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets/simple -d simple_top
+ TOOLTEST -i $TESTFILE -o $TESTDIR/simple_top.out.h5 -v -s grp_dsets/simple -d simple_top
echo "Test copying & renaming dataset"
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compound -d rename
+ TOOLTEST -i $TESTFILE -o $TESTDIR/dsrename.out.h5 -v -s compound -d rename
echo "Test copying empty, 'full' & 'nested' groups"
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_empty -d grp_empty
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_dsets
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_nested -d grp_nested
+ TOOLTEST -i $TESTFILE -o $TESTDIR/grp_empty.out.h5 -v -s grp_empty -d grp_empty
+ TOOLTEST -i $TESTFILE -o $TESTDIR/grp_dsets.out.h5 -v -s grp_dsets -d grp_dsets
+ TOOLTEST -i $TESTFILE -o $TESTDIR/grp_nested.out.h5 -v -s grp_nested -d grp_nested
echo "Test copying dataset within group in source file to group in destination"
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s /grp_dsets/simple -d /grp_dsets/simple_group
+ TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/simple_group.out.h5 grp_dsets grp_dsets /grp_dsets/simple /grp_dsets/simple_group
echo "Test copying & renaming group"
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename
+ TOOLTEST -i $TESTFILE -o $TESTDIR/grp_rename.out.h5 -v -s grp_dsets -d grp_rename
echo "Test copying 'full' group hierarchy into group in destination file"
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets
+ TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/grp_dsets_rename.out.h5 grp_dsets grp_rename grp_dsets /grp_rename/grp_dsets
echo "Test copying objects into group hier. that doesn't exist yet in destination file"
- TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s simple -d /A/B1/simple
- TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s simple -d /A/B2/simple2
- TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets/simple -d /C/D/simple
- TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets
- TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested
-
- # Verify that the file created above is correct
- H5LSTEST $FILEOUT
-
- # Remove output file created, if the "no cleanup" environment variable is
- # not defined
- if test -z "$HDF5_NOCLEANUP"; then
- rm -f $FILEOUT
- fi
+ TOOLTEST -i $TESTFILE -o $TESTDIR/A_B1_simple.out.h5 -vp -s simple -d /A/B1/simple
+ TOOLTEST -i $TESTFILE -o $TESTDIR/A_B2_simple2.out.h5 -vp -s simple -d /A/B2/simple2
+ TOOLTEST -i $TESTFILE -o $TESTDIR/C_D_simple.out.h5 -vp -s /grp_dsets/simple -d /C/D/simple
+ TOOLTEST -i $TESTFILE -o $TESTDIR/E_F_grp_dsets.out.h5 -vp -s /grp_dsets -d /E/F/grp_dsets
+ TOOLTEST -i $TESTFILE -o $TESTDIR/G_H_grp_nested.out.h5 -vp -s /grp_nested -d /G/H/grp_nested
}
# Copy references in various way.
-# adding to the destination file each time compare the result
#
# Assumed arguments:
# <none>
COPY_REFERENCES()
{
TESTFILE="$TESTDIR/h5copy_ref.h5"
- FILEOUT="$TESTDIR/`basename h5copy_ref.h5 .h5`.out.h5"
-
- # Remove any output file left over from previous test run
- rm -f $FILEOUT
echo "Test copying object and region references"
- TOOLTEST -f ref -i $TESTFILE -o $FILEOUT -v -s / -d /COPY
-
- # Verify that the file created above is correct
- H5LSTEST $FILEOUT
-
- # Remove output file created, if the "no cleanup" environment variable is
- # not defined
- if test -z "$HDF5_NOCLEANUP"; then
- rm -f $FILEOUT
- fi
+ TOOLTEST_F -f ref -i $TESTFILE -o $TESTDIR/region_ref.out.h5 -v -s / -d /COPY
}
# Copy external links.
@@ -465,43 +524,30 @@ COPY_REFERENCES()
COPY_EXT_LINKS()
{
TESTFILE="$TESTDIR/h5copy_extlinks_src.h5"
- FILEOUT="$TESTDIR/`basename h5copy_extlinks_src.h5 .h5`.out.h5"
-
- # Remove any output file left over from previous test run
- rm -f $FILEOUT
echo "Test copying external link directly without -f ext"
- TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext/extlink_dset -d /copy1_dset
+ TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link.out.h5 -s /group_ext/extlink_dset -d /copy1_dset
echo "Test copying external link directly with -f ext"
- TOOLTEST -f ext -i $TESTFILE -o $FILEOUT -v -s /group_ext/extlink_dset -d /copy2_dset
+ TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_f.out.h5 -v -s /group_ext/extlink_dset -d /copy2_dset
echo "Test copying dangling external link (no obj) directly without -f ext"
- TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext/extlink_notyet1 -d /copy_dangle1_1
+ TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_noobj.out.h5 -s /group_ext/extlink_notyet1 -d /copy_dangle1_1
echo "Test copying dangling external link (no obj) directly with -f ext"
- TOOLTEST -f ext -i $TESTFILE -o $FILEOUT -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2
+ TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_noobj_f.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2
echo "Test copying dangling external link (no file) directly without -f ext"
- TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext/extlink_notyet2 -d /copy_dangle2_1
+ TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_nofile.out.h5 -s /group_ext/extlink_notyet2 -d /copy_dangle2_1
echo "Test copying dangling external link (no file) directly with -f ext"
- TOOLTEST -f ext -i $TESTFILE -o $FILEOUT -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2
+ TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_nofile_f.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2
echo "Test copying a group contains external links without -f ext"
- TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext -d /copy1_group
+ TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link_group.out.h5 -s /group_ext -d /copy1_group
echo "Test copying a group contains external links with -f ext"
- TOOLTEST -f ext -v -i $TESTFILE -o $FILEOUT -s /group_ext -d /copy2_group
-
- # Verify that the file created above is correct
- H5LSTEST $FILEOUT
-
- # Remove output file created, if the "no cleanup" environment variable is
- # not defined
- if test -z "$HDF5_NOCLEANUP"; then
- rm -f $FILEOUT
- fi
+ TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_group_f.out.h5 -v -s /group_ext -d /copy2_group
}
# Test misc.
@@ -511,28 +557,13 @@ COPY_EXT_LINKS()
TEST_MISC()
{
TESTFILE="$TESTDIR/h5copytst.h5"
- FILEOUT="$TESTDIR/`basename h5copytst.h5 .h5`.out.h5"
-
- # Remove any output file left over from previous test run
- rm -f $h5copy_misc1.out.h5
echo "Test copying object into group which doesn't exist, without -p"
- TOOLTEST_FAIL h5copy_misc1.out -v -i $TESTFILE -o $TESTDIR/h5copy_misc1.out.h5 -s /simple -d /g1/g2/simple
+ TOOLTEST_FAIL h5copy_misc1.out -i $TESTFILE -o $TESTDIR/h5copy_misc1.out.h5 -v -s /simple -d /g1/g2/simple
echo "Test copying objects to the same file "
- rm -f $FILEOUT
- # create temporary test file ($FILEOUT) with some objects
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s /simple -d /simple
- TOOLTEST -i $TESTFILE -o $FILEOUT -v -s /grp_dsets -d /grp_dsets
- # actual test cases
- TOOLTEST -i $FILEOUT -o $FILEOUT -v -s /simple -d /simple_cp
- TOOLTEST -i $FILEOUT -o $FILEOUT -v -s /grp_dsets -d /grp_dsets_cp
-
- # Remove output file created, if the "no cleanup" environment variable is
- # not defined
- if test -z "$HDF5_NOCLEANUP"; then
- rm -f $FILEOUT
- fi
+ TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile1.out.h5 /simple /simple_cp
+ TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile2.out.h5 /grp_dsets /grp_dsets_cp
}
##############################################################################
diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt
index 437fed3..95777b3 100644
--- a/tools/h5jam/CMakeLists.txt
+++ b/tools/h5jam/CMakeLists.txt
@@ -112,6 +112,13 @@ IF (BUILD_TESTING)
ENDIF (NOT "${resultcode}" STREQUAL "0")
ELSE (HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (
+ NAME H5JAM-${expectfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ${expectfile}.out
+ ${expectfile}.out.err
+ )
+ ADD_TEST (
NAME H5JAM-${expectfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5jam>"
@@ -122,6 +129,7 @@ IF (BUILD_TESTING)
-D "TEST_REFERENCE=testfiles/${expectfile}.txt"
-P "${HDF5_RESOURCES_DIR}/runTest.cmake"
)
+ SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects)
ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
ENDMACRO (TEST_H5JAM_OUTPUT)
@@ -138,6 +146,13 @@ IF (BUILD_TESTING)
ENDIF (NOT "${resultcode}" STREQUAL "0")
ELSE (HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (
+ NAME H5JAM-UNJAM-${expectfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ${expectfile}.out
+ ${expectfile}.out.err
+ )
+ ADD_TEST (
NAME H5JAM-UNJAM-${expectfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>"
@@ -148,50 +163,38 @@ IF (BUILD_TESTING)
-D "TEST_REFERENCE=testfiles/${expectfile}.txt"
-P "${HDF5_RESOURCES_DIR}/runTest.cmake"
)
+ SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS H5JAM-UNJAM-${expectfile}-clear-objects)
ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
ENDMACRO (TEST_H5UNJAM_OUTPUT)
- MACRO (CLEANUP testname)
- ADD_TEST (
- NAME H5JAM-CLEANUP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND} -E remove ${ARGN}
- )
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5JAM-CLEANUP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5JAM-CLEANUP-${testname}-clear-objects")
- ENDMACRO(CLEANUP testname testfile)
-
- MACRO (CHECKFILE testname expected actual)
+ MACRO (CHECKFILE testname testdepends expected actual)
# If using memchecker add tests without using scripts
IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (
- NAME H5JAM-CHECKFILE-${testname}-clear-objects
+ NAME H5JAM-${testname}-CHECKFILE-clear-objects
COMMAND ${CMAKE_COMMAND}
-E remove
- ${expected}.new
- ${expected}.new.err
+ ${actual}.new
+ ${actual}.new.err
${actual}.out
${actual}.out.err
)
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5JAM-CHECKFILE-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends})
ADD_TEST (
- NAME H5JAM-CHECKFILE-H5DMP-${testname}
+ NAME H5JAM-${testname}-CHECKFILE-H5DMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
-D "TEST_ARGS:STRING=testfiles/${expected}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -D "TEST_OUTPUT=${expected}.new"
+ -D "TEST_OUTPUT=${actual}.new"
-D "TEST_EXPECT=0"
-D "TEST_FILTER=(^(HDF5)[^\n]*)"
-D "TEST_SKIP_COMPARE=TRUE"
-P "${HDF5_RESOURCES_DIR}/runTest.cmake"
)
- SET_TESTS_PROPERTIES (H5JAM-CHECKFILE-H5DMP-${testname} PROPERTIES DEPENDS H5JAM-CHECKFILE-${testname}-clear-objects)
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects)
ADD_TEST (
- NAME H5JAM-CHECKFILE-H5DMP_CMP-${testname}
+ NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
-D "TEST_ARGS:STRING=${actual}"
@@ -199,168 +202,210 @@ IF (BUILD_TESTING)
-D "TEST_OUTPUT=${actual}.out"
-D "TEST_EXPECT=0"
-D "TEST_FILTER=(^(HDF5)[^\n]*)"
- -D "TEST_REFERENCE=${expected}.new"
+ -D "TEST_REFERENCE=${actual}.new"
-P "${HDF5_RESOURCES_DIR}/runTest.cmake"
)
- SET_TESTS_PROPERTIES (H5JAM-CHECKFILE-H5DMP_CMP-${testname} PROPERTIES DEPENDS H5JAM-CHECKFILE-H5DMP-${testname})
- SET (last_test "H5JAM-CHECKFILE-H5DMP_CMP-${testname}")
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP)
ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
- ENDMACRO(CHECKFILE testname expected actual)
-
- MACRO (SETUP testname infile outfile)
- ADD_TEST (
- NAME H5JAM-SETUP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND} -E remove ${outfile}
- )
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5JAM-SETUP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- ADD_TEST (
- NAME H5JAM-SETUP-${testname}
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${infile} ${PROJECT_BINARY_DIR}/${outfile}
- )
- SET_TESTS_PROPERTIES (H5JAM-SETUP-${testname} PROPERTIES DEPENDS H5JAM-SETUP-${testname}-clear-objects)
- SET (last_test "H5JAM-SETUP-${testname}")
- ENDMACRO(SETUP testname infile outfile)
+ ENDMACRO(CHECKFILE testname testdepends expected actual)
- MACRO (CHECK_UB_1 testname testfile ufile)
+ MACRO (UNJAMTEST testname setfile infile ufile chkfile outfile)
IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (
- NAME H5JAM-CHECK_UB_1-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${testfile}.len.txt
- ${testfile}.cmp
- ${ufile}.cmp
+ NAME H5JAM-${testname}-UNJAM-SETUP-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${infile}
+ )
+ ADD_TEST (
+ NAME H5JAM-${testname}-UNJAM-SETUP
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${setfile} ${PROJECT_BINARY_DIR}/${infile}
+ )
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-SETUP PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP-clear-objects)
+ ADD_TEST (
+ NAME H5JAM-${testname}-UNJAM-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${outfile}
)
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5JAM-CHECK_UB_1-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP)
+ IF (NOT "${ufile}" STREQUAL "NONE")
+ ADD_TEST (
+ NAME H5JAM-${testname}-UNJAM_D-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${ufile}
+ )
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects)
+ ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -u ${ufile} -o ${outfile})
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects)
+ SET (compare_test ${ufile})
+ ELSE (NOT "${ufile}" STREQUAL "NONE")
+ IF (NOT "${ARGN}" STREQUAL "--delete")
+ ADD_TEST (
+ NAME H5JAM-${testname}-UNJAM_D-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${outfile}.ufile.txt ${outfile}.ufile.txt.err
+ )
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects)
+ ADD_TEST (
+ NAME H5JAM-${testname}-UNJAM
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>"
+ -D "TEST_ARGS:STRING=-i;${infile};-o;${outfile}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -D "TEST_OUTPUT=${outfile}.ufile.txt"
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ )
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects)
+ SET (compare_test "${outfile}.ufile.txt")
+ ELSE (NOT "${ARGN}" STREQUAL "--delete")
+ ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -o ${outfile})
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects)
+ SET (compare_test "")
+ ENDIF (NOT "${ARGN}" STREQUAL "--delete")
+ ENDIF (NOT "${ufile}" STREQUAL "NONE")
+ IF (NOT "${compare_test}" STREQUAL "")
+ ADD_TEST (
+ NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ${infile}.len.txt
+ ${infile}.cmp
+ ${infile}-ub.cmp
+ )
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}-UNJAM")
+ ADD_TEST (
+ NAME H5JAM-${testname}-UNJAM-CHECK_UB_1
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:tellub>"
+ -D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>"
+ -D "TEST_CHECKUB=YES"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -D "TEST_HFILE=${infile}"
+ -D "TEST_UFILE=${compare_test}"
+ -D "TEST_EXPECT=0"
+ -D "TEST_OFILE="
+ -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake"
+ )
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects)
+ ENDIF (NOT "${compare_test}" STREQUAL "")
+
ADD_TEST (
- NAME H5JAM-CHECK_UB_1-${testname}
+ NAME H5JAM-${testname}-UNJAM-CHECK_NOUB
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:tellub>"
-D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>"
- -D "TEST_CHECKUB=YES"
+ -D "TEST_CHECKUB=NO"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -D "TEST_HFILE=${testfile}"
- -D "TEST_UFILE=${ufile}"
+ -D "TEST_HFILE=${outfile}"
-D "TEST_EXPECT=0"
- -D "TEST_OFILE=${ARGN}"
+ -D "TEST_UFILE=NULL"
+ -D "TEST_OFILE=NULL"
-P "${HDF5_RESOURCES_DIR}/userblockTest.cmake"
)
- SET_TESTS_PROPERTIES (H5JAM-CHECK_UB_1-${testname} PROPERTIES DEPENDS H5JAM-CHECK_UB_1-${testname}-clear-objects)
- SET (last_test "H5JAM-CHECK_UB_1-${testname}")
+ IF (NOT "${compare_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1)
+ ELSE (NOT "${compare_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM)
+ ENDIF (NOT "${compare_test}" STREQUAL "")
+
+ CHECKFILE (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile})
ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
- ENDMACRO(CHECK_UB_1 testname testfile ufile)
+ ENDMACRO(UNJAMTEST testname infile ufile outfile)
- MACRO (CHECK_NOUB testname testfile)
+ MACRO (JAMTEST testname jamfile infile chkfile outfile)
IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (
- NAME H5JAM-CHECK_NOUB-${testname}
+ NAME H5JAM-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5
+ )
+ ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ ADD_TEST (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN})
+ IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ SET_TESTS_PROPERTIES (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects)
+ SET (compare_test ${outfile})
+ SET (compare_orig testfiles/${infile})
+ IF ("${ARGN}" STREQUAL "--clobber")
+ SET (compare_orig "")
+ ENDIF ("${ARGN}" STREQUAL "--clobber")
+
+ ADD_TEST (
+ NAME H5JAM-${testname}-CHECK_UB_1-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ${compare_test}.len.txt
+ ${compare_test}.cmp
+ ${compare_test}-ub.cmp
+ )
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}")
+ ADD_TEST (
+ NAME H5JAM-${testname}-CHECK_UB_1
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:tellub>"
-D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>"
- -D "TEST_CHECKUB=NO"
+ -D "TEST_CHECKUB=YES"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -D "TEST_HFILE=${testfile}"
+ -D "TEST_HFILE=${compare_test}"
+ -D "TEST_UFILE=testfiles/${jamfile}"
-D "TEST_EXPECT=0"
- -D "TEST_UFILE=NULL"
- -D "TEST_OFILE=NULL"
+ -D "TEST_OFILE=${compare_orig}"
-P "${HDF5_RESOURCES_DIR}/userblockTest.cmake"
)
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5JAM-CHECK_NOUB-${testname} PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5JAM-CHECK_NOUB-${testname}")
+ SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects)
+ CHECKFILE (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile})
ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
- ENDMACRO(CHECK_NOUB testname testfile)
+ ENDMACRO (JAMTEST testname jamfile infile outfile)
- MACRO (UNJAMTEST testname infile ufile outfile)
- ADD_TEST (
- NAME H5JAM-UNJAM-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND} -E remove ${outfile}
- )
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5JAM-UNJAM-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- IF (NOT "${ufile}" STREQUAL "NONE")
+ MACRO (JAMTEST_NONE testname jamfile infile setfile chkfile)
+ IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (
- NAME H5JAM-UNJAM_D-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND} -E remove ${ufile}
+ NAME H5JAM-${testname}_NONE-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove
+ ${chkfile} ${chkfile}.cpy.h5
)
- SET_TESTS_PROPERTIES (H5JAM-UNJAM_D-${testname}-clear-objects PROPERTIES DEPENDS H5JAM-UNJAM-${testname}-clear-objects)
- ADD_TEST (NAME H5JAM-UNJAM-${testname} COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -u ${ufile} -o ${outfile})
- SET_TESTS_PROPERTIES (H5JAM-UNJAM-${testname} PROPERTIES DEPENDS H5JAM-UNJAM_D-${testname}-clear-objects)
- SET (compare_test ${ufile})
- ELSE (NOT "${ufile}" STREQUAL "NONE")
- IF (NOT "${ARGN}" STREQUAL "--delete")
- ADD_TEST (
- NAME H5JAM-UNJAM_D-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND} -E remove ${outfile}.ufile.txt ${outfile}.ufile.txt.err
- )
- SET_TESTS_PROPERTIES (H5JAM-UNJAM_D-${testname}-clear-objects PROPERTIES DEPENDS H5JAM-UNJAM-${testname}-clear-objects)
- IF (HDF5_ENABLE_USING_MEMCHECKER)
- ADD_TEST (NAME H5JAM-UNJAM-${testname} COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -o ${outfile})
- ELSE (HDF5_ENABLE_USING_MEMCHECKER)
- ADD_TEST (
- NAME H5JAM-UNJAM-${testname}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>"
- -D "TEST_ARGS:STRING=-i;${infile};-o;${outfile}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -D "TEST_OUTPUT=${outfile}.ufile.txt"
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
- )
- ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
- SET_TESTS_PROPERTIES (H5JAM-UNJAM-${testname} PROPERTIES DEPENDS H5JAM-UNJAM_D-${testname}-clear-objects)
- SET (compare_test "${outfile}.ufile.txt")
- ELSE (NOT "${ARGN}" STREQUAL "--delete")
- ADD_TEST (NAME H5JAM-UNJAM-${testname} COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -o ${outfile})
- SET_TESTS_PROPERTIES (H5JAM-UNJAM-${testname} PROPERTIES DEPENDS H5JAM-UNJAM-${testname}-clear-objects)
- SET (compare_test "")
- ENDIF (NOT "${ARGN}" STREQUAL "--delete")
- ENDIF (NOT "${ufile}" STREQUAL "NONE")
- SET (last_test "H5JAM-UNJAM-${testname}")
- IF (NOT "${compare_test}" STREQUAL "")
- CHECK_UB_1 (${testname} ${infile} ${compare_test})
- ENDIF (NOT "${compare_test}" STREQUAL "")
- CHECK_NOUB (${testname} ${outfile})
- ENDMACRO(UNJAMTEST testname infile ufile outfile)
+ ADD_TEST (
+ NAME H5JAM-${testname}_NONE-SETUP
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different testfiles/${setfile} ${chkfile}
+ )
+ SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-SETUP PROPERTIES DEPENDS H5JAM-${testname}_NONE-clear-objects)
- MACRO (JAMTEST testname jamfile infile outfile)
- ADD_TEST (
- NAME H5JAM-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5
- )
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5JAM-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5JAM-${testname}-clear-objects")
- IF ("${outfile}" STREQUAL "NONE")
ADD_TEST (
- NAME H5JAM-NONE_COPY-${testname}
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${infile} ${infile}.cpy.h5
+ NAME H5JAM-${testname}_NONE_COPY
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${chkfile} ${chkfile}.cpy.h5
)
- SET_TESTS_PROPERTIES (H5JAM-NONE_COPY-${testname} PROPERTIES DEPENDS ${last_test})
- SET (last_test "H5JAM-NONE_COPY-${testname}")
- ADD_TEST (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i ${infile} ${ARGN})
- SET (compare_test ${infile})
- SET (compare_orig ${infile}.cpy.h5)
- ELSE ("${outfile}" STREQUAL "NONE")
- ADD_TEST (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN})
- SET (compare_test ${outfile})
- SET (compare_orig testfiles/${infile})
- ENDIF ("${outfile}" STREQUAL "NONE")
- SET_TESTS_PROPERTIES (H5JAM-${testname} PROPERTIES DEPENDS ${last_test})
- SET (last_test "H5JAM-${testname}")
- IF ("${ARGN}" STREQUAL "--clobber")
- SET (compare_orig "")
- ENDIF ("${ARGN}" STREQUAL "--clobber")
- CHECK_UB_1 (${testname} ${compare_test} testfiles/${jamfile} ${compare_orig})
- ENDMACRO (JAMTEST testname jamfile infile outfile)
+ SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP)
+
+ ADD_TEST (NAME H5JAM-${testname}_NONE COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i ${chkfile} ${ARGN})
+ SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY)
+
+ SET (compare_test ${chkfile})
+ SET (compare_orig ${chkfile}.cpy.h5)
+ IF ("${ARGN}" STREQUAL "--clobber")
+ SET (compare_orig "")
+ ENDIF ("${ARGN}" STREQUAL "--clobber")
+
+ ADD_TEST (
+ NAME H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ${compare_test}.len.txt
+ ${compare_test}.cmp
+ ${compare_test}-ub.cmp
+ )
+ SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}_NONE")
+ ADD_TEST (
+ NAME H5JAM-${testname}_NONE-CHECK_UB_1
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:tellub>"
+ -D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>"
+ -D "TEST_CHECKUB=YES"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -D "TEST_HFILE=${compare_test}"
+ -D "TEST_UFILE=testfiles/${jamfile}"
+ -D "TEST_EXPECT=0"
+ -D "TEST_OFILE=${compare_orig}"
+ -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake"
+ )
+ SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects)
+ CHECKFILE (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile})
+ ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ ENDMACRO (JAMTEST_NONE testname jamfile infile setfile chkfile)
##############################################################################
##############################################################################
@@ -377,118 +422,45 @@ IF (BUILD_TESTING)
# don't allow HDF5 format file as an user block file
TEST_H5JAM_OUTPUT(h5jam-ub-nohdf5 1 -i testfiles/tall.h5 -u testfiles/tall.h5 -o tall-tmp.h5)
- JAMTEST (tall_u10 u10.txt tall.h5 ta2.h5)
- CHECKFILE (tall_u10 tall.h5 ta2.h5)
-# CLEANUP (tall_u10 ta2.h5)
- JAMTEST (tall_u511 u511.txt tall.h5 ta3.h5)
- CHECKFILE (tall_u511 tall.h5 ta3.h5)
-# CLEANUP (tall_u511 ta3.h5)
- JAMTEST (tall_u512 u512.txt tall.h5 ta4.h5)
- CHECKFILE (tall_u512 tall.h5 ta4.h5)
-# CLEANUP (tall_u512 ta4.h5)
- JAMTEST (tall_u513 u513.txt tall.h5 ta5.h5)
- CHECKFILE (tall_u513 tall.h5 ta5.h5)
-# CLEANUP (tall_u513 ta5.h5)
-
- SETUP (ta_u10 tall.h5 ta.h5)
- JAMTEST (ta_u10 u10.txt ta.h5 NONE)
- CHECKFILE (ta_u10 tall.h5 ta.h5)
- SETUP (ta_u511 tall.h5 ta.h5 NOCLEAN)
- JAMTEST (ta_u511 u511.txt ta.h5 NONE)
- CHECKFILE (ta_u511 tall.h5 ta.h5)
- SETUP (ta_u512 tall.h5 ta.h5 NOCLEAN)
- JAMTEST (ta_u512 u512.txt ta.h5 NONE)
- CHECKFILE (ta_u512 tall.h5 ta.h5)
- SETUP (ta_u513 tall.h5 ta.h5 NOCLEAN)
- JAMTEST (ta_u513 u513.txt ta.h5 NONE)
- CHECKFILE (ta_u513 tall.h5 ta.h5)
-# CLEANUP (ta ta.h5)
-
- JAMTEST (twithub_u10 u10.txt twithub.h5 tax2.h5)
- CHECKFILE (twithub_u10 tall.h5 tax2.h5)
-# CLEANUP (twithub_u10 tax2.h5)
- JAMTEST (twithub_u511 u511.txt twithub.h5 tax3.h5)
- CHECKFILE (twithub_u511 tall.h5 tax3.h5)
-# CLEANUP (twithub_u511 tax3.h5)
- JAMTEST (twithub_u512 u512.txt twithub.h5 tax4.h5)
- CHECKFILE (twithub_u512 tall.h5 tax4.h5)
-# CLEANUP (twithub_u512 tax4.h5)
- JAMTEST (twithub_u513 u513.txt twithub.h5 tax5.h5)
- CHECKFILE (twithub_u513 tall.h5 tax5.h5)
-# CLEANUP (twithub_u513 tax5.h5)
-
- JAMTEST (twithub513_u10 u10.txt twithub513.h5 tax6.h5)
- CHECKFILE (twithub513_u10 tall.h5 tax6.h5)
-# CLEANUP (twithub513_u10 tax6.h5)
- JAMTEST (twithub513_u511 u511.txt twithub513.h5 tax7.h5)
- CHECKFILE (twithub513_u511 tall.h5 tax7.h5)
-# CLEANUP (twithub513_u511 tax7.h5)
- JAMTEST (twithub513_u512 u512.txt twithub513.h5 tax8.h5)
- CHECKFILE (twithub513_u512 tall.h5 tax8.h5)
-# CLEANUP (twithub513_u512 tax8.h5)
- JAMTEST (twithub513_u513 u513.txt twithub513.h5 tax9.h5)
- CHECKFILE (twithub513_u513 tall.h5 tax9.h5)
-# CLEANUP (twithub513_u513 tax9.h5)
-
- JAMTEST (twithub_u10_c u10.txt twithub.h5 taz2.h5 --clobber)
- CHECKFILE (twithub_u10_c tall.h5 taz2.h5)
-# CLEANUP (twithub_u10_c taz2.h5)
- JAMTEST (twithub_u511_c u511.txt twithub.h5 taz3.h5 --clobber)
- CHECKFILE (twithub_u511_c tall.h5 taz3.h5)
-# CLEANUP (twithub_u511_c taz3.h5)
- JAMTEST (twithub_u512_c u512.txt twithub.h5 taz4.h5 --clobber)
- CHECKFILE (twithub_u512_c tall.h5 taz4.h5)
-# CLEANUP (twithub_u512_c taz4.h5)
- JAMTEST (twithub_u513_c u513.txt twithub.h5 taz5.h5 --clobber)
- CHECKFILE (twithub_u513_c tall.h5 taz5.h5)
-# CLEANUP (twithub_u513_c taz5.h5)
-
- JAMTEST (twithub513_u10_c u10.txt twithub513.h5 taz6.h5 --clobber)
- CHECKFILE (twithub513_u10_c tall.h5 taz6.h5)
-# CLEANUP (twithub513_u10_c taz6.h5)
- JAMTEST (twithub513_u511_c u511.txt twithub513.h5 taz7.h5 --clobber)
- CHECKFILE (twithub513_u511_c tall.h5 taz7.h5)
-# CLEANUP (twithub513_u511_c taz7.h5)
- JAMTEST (twithub513_u512_c u512.txt twithub513.h5 taz8.h5 --clobber)
- CHECKFILE (twithub513_u512_c tall.h5 taz8.h5)
-# CLEANUP (twithub513_u512_c taz8.h5)
- JAMTEST (twithub513_u513_c u513.txt twithub513.h5 taz9.h5 --clobber)
- CHECKFILE (twithub513_u513_c tall.h5 taz9.h5)
-# CLEANUP (twithub513_u513_c taz9.h5)
-
- SETUP (N_twithub_u10_c twithub.h5 tay2.h5)
- JAMTEST (N_twithub_u10_c u10.txt tay2.h5 NONE --clobber)
- CHECKFILE (N_twithub_u10_c tall.h5 tay2.h5)
-# CLEANUP (N_twithub_u10_c tay2.h5)
- SETUP (N_twithub_u511_c twithub.h5 tay3.h5)
- JAMTEST (N_twithub_u511_c u511.txt tay3.h5 NONE --clobber)
- CHECKFILE (N_twithub_u511_c tall.h5 tay3.h5)
-# CLEANUP (N_twithub_u511_c tay3.h5)
- SETUP (N_twithub_u512_c twithub.h5 tay4.h5)
- JAMTEST (N_twithub_u512_c u512.txt tay4.h5 NONE --clobber)
- CHECKFILE (N_twithub_u512_c tall.h5 tay4.h5)
-# CLEANUP (N_twithub_u512_c tay4.h5)
- SETUP (N_twithub_u513_c twithub.h5 tay5.h5)
- JAMTEST (N_twithub_u513_c u513.txt tay5.h5 NONE --clobber)
- CHECKFILE (N_twithub_u513_c tall.h5 tay5.h5)
-# CLEANUP (N_twithub_u513_c tay5.h5)
-
- SETUP (N_twithub513_u10_c twithub513.h5 tay6.h5)
- JAMTEST (N_twithub513_u10_c u10.txt tay6.h5 NONE --clobber)
- CHECKFILE (N_twithub513_u10_c tall.h5 tay6.h5)
-# CLEANUP (N_twithub513_u10_c tay6.h5)
- SETUP (N_twithub513_u511_c twithub513.h5 tay7.h5)
- JAMTEST (N_twithub513_u511_c u511.txt tay7.h5 NONE --clobber)
- CHECKFILE (N_twithub513_u511_c tall.h5 tay7.h5)
-# CLEANUP (N_twithub513_u511_c tay7.h5)
- SETUP (N_twithub513_u512_c twithub513.h5 tay8.h5)
- JAMTEST (N_twithub513_u512_c u512.txt tay8.h5 NONE --clobber)
- CHECKFILE (N_twithub513_u512_c tall.h5 tay8.h5)
-# CLEANUP (N_twithub513_u512_c tay8.h5)
- SETUP (N_twithub513_u513_c twithub513.h5 tay9.h5)
- JAMTEST (N_twithub513_u513_c u513.txt tay9.h5 NONE --clobber)
- CHECKFILE (N_twithub513_u513_c tall.h5 tay9.h5)
-# CLEANUP (N_twithub513_u513_c tay9.h5)
+ JAMTEST (tall_u10 u10.txt tall.h5 tall.h5 ta2.h5)
+ JAMTEST (tall_u511 u511.txt tall.h5 tall.h5 ta3.h5)
+ JAMTEST (tall_u512 u512.txt tall.h5 tall.h5 ta4.h5)
+ JAMTEST (tall_u513 u513.txt tall.h5 tall.h5 ta5.h5)
+
+ JAMTEST_NONE (N_ta_u10 u10.txt tall.h5 tall.h5 ta6.h5)
+ JAMTEST_NONE (N_ta_u511 u511.txt tall.h5 tall.h5 ta7.h5)
+ JAMTEST_NONE (N_ta_u512 u512.txt tall.h5 tall.h5 ta8.h5)
+ JAMTEST_NONE (N_ta_u513 u513.txt tall.h5 tall.h5 ta9.h5)
+
+ JAMTEST (twithub_u10 u10.txt twithub.h5 tall.h5 tax2.h5)
+ JAMTEST (twithub_u511 u511.txt twithub.h5 tall.h5 tax3.h5)
+ JAMTEST (twithub_u512 u512.txt twithub.h5 tall.h5 tax4.h5)
+ JAMTEST (twithub_u513 u513.txt twithub.h5 tall.h5 tax5.h5)
+
+ JAMTEST (twithub513_u10 u10.txt twithub513.h5 tall.h5 tax6.h5)
+ JAMTEST (twithub513_u511 u511.txt twithub513.h5 tall.h5 tax7.h5)
+ JAMTEST (twithub513_u512 u512.txt twithub513.h5 tall.h5 tax8.h5)
+ JAMTEST (twithub513_u513 u513.txt twithub513.h5 tall.h5 tax9.h5)
+
+ JAMTEST (twithub_u10_c u10.txt twithub.h5 tall.h5 taz2.h5 --clobber)
+ JAMTEST (twithub_u511_c u511.txt twithub.h5 tall.h5 taz3.h5 --clobber)
+ JAMTEST (twithub_u512_c u512.txt twithub.h5 tall.h5 taz4.h5 --clobber)
+ JAMTEST (twithub_u513_c u513.txt twithub.h5 tall.h5 taz5.h5 --clobber)
+
+ JAMTEST (twithub513_u10_c u10.txt twithub513.h5 tall.h5 taz6.h5 --clobber)
+ JAMTEST (twithub513_u511_c u511.txt twithub513.h5 tall.h5 taz7.h5 --clobber)
+ JAMTEST (twithub513_u512_c u512.txt twithub513.h5 tall.h5 taz8.h5 --clobber)
+ JAMTEST (twithub513_u513_c u513.txt twithub513.h5 tall.h5 taz9.h5 --clobber)
+
+ JAMTEST_NONE (N_twithub_u10_c u10.txt tall.h5 twithub.h5 tay2.h5 --clobber)
+ JAMTEST_NONE (N_twithub_u511_c u511.txt tall.h5 twithub.h5 tay3.h5 --clobber)
+ JAMTEST_NONE (N_twithub_u512_c u512.txt tall.h5 twithub.h5 tay4.h5 --clobber)
+ JAMTEST_NONE (N_twithub_u513_c u513.txt tall.h5 twithub.h5 tay5.h5 --clobber)
+
+ JAMTEST_NONE (N_twithub513_u10_c u10.txt tall.h5 twithub513.h5 tay6.h5 --clobber)
+ JAMTEST_NONE (N_twithub513_u511_c u511.txt tall.h5 twithub513.h5 tay7.h5 --clobber)
+ JAMTEST_NONE (N_twithub513_u512_c u512.txt tall.h5 twithub513.h5 tay8.h5 --clobber)
+ JAMTEST_NONE (N_twithub513_u513_c u513.txt tall.h5 twithub513.h5 tay9.h5 --clobber)
#-------------------------------
# Testing h5unjam
@@ -496,32 +468,14 @@ IF (BUILD_TESTING)
# help page
TEST_H5UNJAM_OUTPUT(h5unjam-help 0 -h)
- SETUP (twithub_tall twithub.h5 tai1.h5)
- UNJAMTEST (twithub_tall tai1.h5 o10.txt taa1.h5)
- CHECKFILE (twithub_tall tall.h5 taa1.h5)
-# CLEANUP (twithub_tall taa1.h5 tai1.h5 o10.txt)
- SETUP (twithub513_tall twithub513.h5 tai2.h5)
- UNJAMTEST (twithub513_tall tai2.h5 o512.txt taa2.h5)
- CHECKFILE (twithub513_tall tall.h5 taa2.h5)
-# CLEANUP (twithub513_tall taa2.h5 tai2.h5 o512.txt)
-
- SETUP (N_twithub_tall twithub.h5 tai3.h5)
- UNJAMTEST (N_twithub_tall tai3.h5 NONE taa3.h5)
- CHECKFILE (N_twithub_tall tall.h5 taa3.h5)
-# CLEANUP (N_twithub_tall taa3.h5 tai3.h5)
- SETUP (N_twithub513_tall twithub513.h5 tai4.h5)
- UNJAMTEST (N_twithub513_tall tai4.h5 NONE taa4.h5)
- CHECKFILE (N_twithub513_tall tall.h5 taa4.h5)
-# CLEANUP (N_twithub513_tall taa4.h5 tai4.h5)
-
- SETUP (D_twithub_tall twithub.h5 taj2.h5)
- UNJAMTEST (D_twithub_tall taj2.h5 NONE tac2.h5 --delete)
- CHECKFILE (D_twithub_tall tall.h5 tac2.h5)
-# CLEANUP (D_twithub_tall tac2.h5 taj2.h5)
- SETUP (D_twithub513_tall twithub513.h5 taj3.h5)
- UNJAMTEST (D_twithub513_tall taj3.h5 NONE tac3.h5 --delete)
- CHECKFILE (D_twithub513_tall tall.h5 tac3.h5)
-# CLEANUP (D_twithub513_tall tac3.h5 taj3.h5)
+ UNJAMTEST (twithub_tall twithub.h5 tai1.h5 o10.txt tall.h5 taa1.h5)
+ UNJAMTEST (twithub513_tall twithub513.h5 tai2.h5 o512.txt tall.h5 taa2.h5)
+
+ UNJAMTEST (N_twithub_tall twithub.h5 tai3.h5 NONE tall.h5 taa3.h5)
+ UNJAMTEST (N_twithub513_tall twithub513.h5 tai4.h5 NONE tall.h5 taa4.h5)
+
+ UNJAMTEST (D_twithub_tall twithub.h5 taj2.h5 NONE tall.h5 tac2.h5 --delete)
+ UNJAMTEST (D_twithub513_tall twithub513.h5 taj3.h5 NONE tall.h5 tac3.h5 --delete)
ENDIF (BUILD_TESTING)
diff --git a/tools/h5jam/testh5jam.sh.in b/tools/h5jam/testh5jam.sh.in
index b2c6bec..86edbee 100644
--- a/tools/h5jam/testh5jam.sh.in
+++ b/tools/h5jam/testh5jam.sh.in
@@ -377,7 +377,7 @@ JAMTEST() {
compare_orig="xxofile.h5"
cleanup="$cleanup $compare_orig"
else
- # output goes to $4, compare ofile to ubfile
+ # output goes to $3, compare ofile to ubfile
ofile="$3"
compare_test="$ofile"
compare_orig="$ifile"
@@ -539,19 +539,22 @@ JAMTEST $TESTDIR/u513.txt $TESTDIR/tall.h5 ta5.h5
CHECKFILE $TESTDIR/tall.h5 ta5.h5
CLEANUP ta5.h5
-SETUP $TESTDIR/tall.h5 ta.h5
-JAMTEST $TESTDIR/u10.txt ta.h5
-CHECKFILE $TESTDIR/tall.h5 ta.h5
-SETUP $TESTDIR/tall.h5 ta.h5
-JAMTEST $TESTDIR/u511.txt ta.h5
-CHECKFILE $TESTDIR/tall.h5 ta.h5
-SETUP $TESTDIR/tall.h5 ta.h5
-JAMTEST $TESTDIR/u512.txt ta.h5
-CHECKFILE $TESTDIR/tall.h5 ta.h5
-SETUP $TESTDIR/tall.h5 ta.h5
-JAMTEST $TESTDIR/u513.txt ta.h5
-CHECKFILE $TESTDIR/tall.h5 ta.h5
-CLEANUP ta.h5
+SETUP $TESTDIR/tall.h5 ta6.h5
+JAMTEST $TESTDIR/u10.txt ta6.h5
+CHECKFILE $TESTDIR/tall.h5 ta6.h5
+CLEANUP ta6.h5
+SETUP $TESTDIR/tall.h5 ta7.h5
+JAMTEST $TESTDIR/u511.txt ta7.h5
+CHECKFILE $TESTDIR/tall.h5 ta7.h5
+CLEANUP ta7.h5
+SETUP $TESTDIR/tall.h5 ta8.h5
+JAMTEST $TESTDIR/u512.txt ta8.h5
+CHECKFILE $TESTDIR/tall.h5 ta8.h5
+CLEANUP ta8.h5
+SETUP $TESTDIR/tall.h5 ta9.h5
+JAMTEST $TESTDIR/u513.txt ta9.h5
+CHECKFILE $TESTDIR/tall.h5 ta9.h5
+CLEANUP ta9.h5
JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub.h5 tax2.h5
CHECKFILE $TESTDIR/tall.h5 tax2.h5
diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in
index a732ffb..dc90426 100644
--- a/tools/h5repack/h5repack.sh.in
+++ b/tools/h5repack/h5repack.sh.in
@@ -189,7 +189,9 @@ SKIP() {
DIFFTEST()
{
VERIFY h5diff output $@
- $RUNSERIAL $H5DIFF_BIN -q "$@"
+ (
+ $RUNSERIAL $H5DIFF_BIN -q "$@"
+ )
RET=$?
if [ $RET != 0 ] ; then
echo "*FAILED*"
@@ -208,44 +210,57 @@ DIFFTEST()
TOOLTEST()
{
echo $@
- TOOLTEST_MAIN $@
- outfile=$TESTDIR/out.$1
- rm -f $outfile
-}
+ infile=$TESTDIR/$2
+ outfile=$TESTDIR/out-$1.$2
+ shift
+ shift
-# TOOLTEST main function, doesn't delete $output file
-TOOLTEST_MAIN()
-{
# Run test.
TESTING $H5REPACK $@
-
- infile=$TESTDIR/$1
- outfile=$TESTDIR/out.$1
- shift
- $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
+ (
+ $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
+ )
RET=$?
if [ $RET != 0 ] ; then
- echo "*FAILED*"
- nerrors="`expr $nerrors + 1`"
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
else
- echo " PASSED"
- DIFFTEST $infile $outfile
+ echo " PASSED"
+ DIFFTEST $infile $outfile
fi
+ rm -f $outfile
}
#------------------------------------------
# Verifying layouts of a dataset
VERIFY_LAYOUT_DSET()
{
- outfile=$TESTDIR/out.$1
- layoutfile=$TESTDIR/layout.$1
- dset=$2
- expectlayout=$3
+ layoutfile=$TESTDIR/layout-$1.$2
+ dset=$3
+ expectlayout=$4
+ infile=$TESTDIR/$2
+ outfile=$TESTDIR/out-$1.$2
+ shift
+ shift
+ shift
+ shift
+
+ $RUNSERIAL $H5REPACK_BIN "$@" $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 "a dataset layout"
- $RUNSERIAL $H5DUMP_BIN -d $dset -pH $outfile > $layoutfile
+ (
+ $RUNSERIAL $H5DUMP_BIN -d $dset -pH $outfile > $layoutfile
+ )
$GREP $expectlayout $layoutfile > /dev/null
if [ $? -eq 0 ]; then
echo " PASSED"
@@ -262,17 +277,35 @@ VERIFY_LAYOUT_DSET()
# Verifying layouts from entire file
VERIFY_LAYOUT_ALL()
{
- outfile=$TESTDIR/out.$1
- layoutfile=$TESTDIR/layout.$1
- expectlayout=$2
+ outfile=$TESTDIR/out-$1.$2
+ layoutfile=$TESTDIR/layout-$1.$2
+ expectlayout=$3
+ shift
+ shift
+ shift
+
+ $RUNSERIAL $H5REPACK_BIN "$@" $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
# check if the other layouts still exsit
VERIFY "layouts"
+ (
# if CONTIGUOUS
if [ $expectlayout = "CONTIGUOUS" ]; then
- $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile
+ TESTING $H5DUMP_BIN -pH $outfile
+ (
+ $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile
+ )
$GREP "COMPACT" $layoutfile > /dev/null
if [ $? -eq 0 ]; then
echo " FAILED"
@@ -287,7 +320,10 @@ VERIFY_LAYOUT_ALL()
else
# if COMPACT
if [ $expectlayout = "COMPACT" ]; then
- $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile
+ TESTING $H5DUMP_BIN -pH $outfile
+ (
+ $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile
+ )
$GREP "CHUNKED" $layoutfile > /dev/null
if [ $? -eq 0 ]; then
echo " FAILED"
@@ -302,7 +338,10 @@ VERIFY_LAYOUT_ALL()
else
# if CHUNKED
if [ $expectlayout = "CHUNKED" ]; then
- $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile
+ TESTING $H5DUMP_BIN -pH $outfile
+ (
+ $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile
+ )
$GREP "CONTIGUOUS" $layoutfile > /dev/null
if [ $? -eq 0 ]; then
echo " FAILED"
@@ -317,6 +356,7 @@ VERIFY_LAYOUT_ALL()
fi
fi
fi
+ )
# clean up tmp files
rm -f $outfile
@@ -327,13 +367,16 @@ VERIFY_LAYOUT_ALL()
#
TOOLTEST0()
{
+ infile=$TESTDIR/$2
+ outfile=$TESTDIR/out-$1.$2
+ shift
+ shift
+
# Run test.
TESTING $H5REPACK $@
-
- infile=$TESTDIR/$1
- outfile=$TESTDIR/out.$1
- shift
- $RUNSERIAL $H5REPACK_BIN -i $infile -o $outfile "$@"
+ (
+ $RUNSERIAL $H5REPACK_BIN -i $infile -o $outfile "$@"
+ )
RET=$?
if [ $RET != 0 ] ; then
echo "*FAILED*"
@@ -351,13 +394,16 @@ TOOLTEST0()
#
TOOLTEST1()
{
+ infile=$TESTDIR/$2
+ outfile=$TESTDIR/out-$1.$2
+ shift
+ shift
+
# Run test.
TESTING $H5REPACK $@
-
- infile=$TESTDIR/$1
- outfile=$TESTDIR/out.$1
- shift
- $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
+ (
+ $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
+ )
RET=$?
if [ $RET != 0 ] ; then
echo "*FAILED*"
@@ -374,16 +420,20 @@ TOOLTEST1()
#
TOOLTESTV()
{
- # Run test.
- TESTING $H5REPACK $@
- expect="$TESTDIR/$1.ddl"
- actual="$TESTDIR/`basename $1 .ddl`.out"
- actual_err="$TESTDIR/`basename $1 .ddl`.err"
+ expect="$TESTDIR/$2.ddl"
+ actual="$TESTDIR/`basename $2 .ddl`.out"
+ actual_err="$TESTDIR/`basename $2 .ddl`.err"
- infile=$TESTDIR/$1
- outfile=$TESTDIR/out.$1
+ infile=$TESTDIR/$2
+ outfile=$TESTDIR/out-$1.$2
+ shift
shift
- $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile >$actual 2>$actual_err
+
+ # Run test.
+ TESTING $H5REPACK $@
+ (
+ $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
+ ) >$actual 2>$actual_err
RET=$?
if [ $RET != 0 ] ; then
echo "*FAILED*"
@@ -427,17 +477,41 @@ TOOLTESTV()
# Verify the output file of second run is larger than the one of 1st run.
TOOLTEST_META()
{
- input_file=$1
- outfile="$TESTDIR/out.$1"
+ infile=$TESTDIR/$2
+ outfile=$TESTDIR/out-$1.$2
+ shift
+ shift
- # Use TOOLTEST_MAIN to run because it does not remove the output file.
- # 1st run, without metadata option
- TOOLTEST_MAIN $1
+ # Run test.
+ TESTING $H5REPACK $@
+ (
+ $RUNSERIAL $H5REPACK_BIN $infile $outfile
+ )
+ RET=$?
+ if [ $RET != 0 ] ; then
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ else
+ echo " PASSED"
+ DIFFTEST $infile $outfile
+ fi
# get the size of the first output file
size1=`wc -c $outfile | cut -d' ' -f1`
# 2nd run with metadata option
- TOOLTEST_MAIN $*
+ # Run test.
+ TESTING $H5REPACK $@
+ (
+ $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
+ )
+ RET=$?
+ if [ $RET != 0 ] ; then
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ else
+ echo " PASSED"
+ DIFFTEST $infile $outfile
+ fi
# get the size of the second output file
size2=`wc -c $outfile | cut -d' ' -f1`
@@ -492,12 +566,12 @@ fi
COPY_TESTFILES_TO_TESTDIR
# copy files (these files have no filters)
-TOOLTEST h5repack_fill.h5
-TOOLTEST h5repack_objs.h5
-TOOLTEST h5repack_attr.h5
-TOOLTEST h5repack_hlink.h5
-TOOLTEST h5repack_layout.h5
-TOOLTEST h5repack_early.h5
+TOOLTEST fill h5repack_fill.h5
+TOOLTEST objs h5repack_objs.h5
+TOOLTEST attr h5repack_attr.h5
+TOOLTEST hlink h5repack_hlink.h5
+TOOLTEST layout h5repack_layout.h5
+TOOLTEST early h5repack_early.h5
# use h5repack_layout.h5 to write some filters (this file has no filters)
@@ -507,7 +581,7 @@ arg="h5repack_layout.h5 -f dset1:GZIP=1 -l dset1:CHUNK=20x10"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST gzip_individual $arg
fi
# gzip for all
@@ -515,7 +589,7 @@ arg="h5repack_layout.h5 -f GZIP=1"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST gzip_all $arg
fi
# szip with individual object
@@ -523,7 +597,7 @@ arg="h5repack_layout.h5 -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10"
if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST szip_individual $arg
fi
# szip for all
@@ -531,7 +605,7 @@ arg="h5repack_layout.h5 -f SZIP=8,NN"
if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST szip_all $arg
fi
# shuffle with individual object
@@ -539,7 +613,7 @@ arg="h5repack_layout.h5 -f dset2:SHUF -l dset2:CHUNK=20x10"
if test $USE_FILTER_SHUFFLE != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST shuffle_individual $arg
fi
@@ -548,7 +622,7 @@ arg="h5repack_layout.h5 -f SHUF"
if test $USE_FILTER_SHUFFLE != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST shuffle_all $arg
fi
# fletcher32 with individual object
@@ -556,7 +630,7 @@ arg="h5repack_layout.h5 -f dset2:FLET -l dset2:CHUNK=20x10"
if test $USE_FILTER_FLETCHER32 != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST fletcher_individual $arg
fi
# fletcher32 for all
@@ -564,7 +638,7 @@ arg="h5repack_layout.h5 -f FLET"
if test $USE_FILTER_FLETCHER32 != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST fletcher_all $arg
fi
# all filters
@@ -572,7 +646,7 @@ arg="h5repack_layout.h5 -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:
if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST all_filters $arg
fi
# verbose gzip with individual object
@@ -581,7 +655,7 @@ if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
# compare output
- TOOLTESTV $arg
+ TOOLTESTV gzip_verbose_filters $arg
fi
###########################################################
@@ -593,7 +667,7 @@ arg="h5repack_szip.h5"
if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST szip_copy $arg
fi
# szip remove
@@ -601,7 +675,7 @@ arg="h5repack_szip.h5 --filter=dset_szip:NONE"
if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST szip_remove $arg
fi
# deflate copy
@@ -609,7 +683,7 @@ arg="h5repack_deflate.h5"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST deflate_copy $arg
fi
# deflate remove
@@ -617,7 +691,7 @@ arg="h5repack_deflate.h5 -f dset_deflate:NONE"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST deflate_remove $arg
fi
# shuffle copy
@@ -625,7 +699,7 @@ arg="h5repack_shuffle.h5"
if test $USE_FILTER_SHUFFLE != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST shuffle_copy $arg
fi
# shuffle remove
@@ -633,7 +707,7 @@ arg="h5repack_shuffle.h5 -f dset_shuffle:NONE"
if test $USE_FILTER_SHUFFLE != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST shuffle_remove $arg
fi
# fletcher32 copy
@@ -641,7 +715,7 @@ arg="h5repack_fletcher.h5"
if test $USE_FILTER_FLETCHER32 != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST fletcher_copy $arg
fi
# fletcher32 remove
@@ -649,7 +723,7 @@ arg="h5repack_fletcher.h5 -f dset_fletcher32:NONE"
if test $USE_FILTER_FLETCHER32 != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST fletcher_remove $arg
fi
# nbit copy
@@ -657,7 +731,7 @@ arg="h5repack_nbit.h5"
if test $USE_FILTER_NBIT != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST nbit_copy $arg
fi
# nbit remove
@@ -665,7 +739,7 @@ arg="h5repack_nbit.h5 -f dset_nbit:NONE"
if test $USE_FILTER_NBIT != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST nbit_remove $arg
fi
# nbit add
@@ -673,7 +747,7 @@ arg="h5repack_nbit.h5 -f dset_int31:NBIT"
if test $USE_FILTER_NBIT != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST nbit_add $arg
fi
# scaleoffset copy
@@ -681,7 +755,7 @@ arg="h5repack_soffset.h5"
if test $USE_FILTER_SCALEOFFSET != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST scale_copy $arg
fi
# scaleoffset add
@@ -689,7 +763,7 @@ arg="h5repack_soffset.h5 -f dset_none:SOFF=31,IN"
if test $USE_FILTER_SCALEOFFSET != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST scale_add $arg
fi
# scaleoffset remove
@@ -697,7 +771,7 @@ arg="h5repack_soffset.h5 -f dset_scaleoffset:NONE"
if test $USE_FILTER_SCALEOFFSET != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST scale_remove $arg
fi
# remove all filters
@@ -705,7 +779,7 @@ arg="h5repack_filters.h5 -f NONE"
if test $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_NBIT != "yes" -o $USE_FILTER_SCALEOFFSET != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST remove_all $arg
fi
#filter conversions
@@ -714,14 +788,14 @@ arg="h5repack_deflate.h5 -f dset_deflate:SZIP=8,NN"
if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST deflate_convert $arg
fi
arg="h5repack_szip.h5 -f dset_szip:GZIP=1"
if test $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST szip_convert $arg
fi
@@ -730,7 +804,7 @@ arg="h5repack_layout.h5 -f GZIP=1 -m 1024"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST deflate_limit $arg
fi
#file
@@ -738,67 +812,50 @@ arg="h5repack_layout.h5 -e $TESTDIR/h5repack.info"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST deflate_file $arg
fi
#########################################################
# layout options (these files have no filters)
#########################################################
-TOOLTEST_MAIN h5repack_layout.h5 --layout dset2:CHUNK=20x10
-VERIFY_LAYOUT_DSET h5repack_layout.h5 dset2 CHUNKED
+VERIFY_LAYOUT_DSET dset2_chunk_20x10 h5repack_layout.h5 dset2 CHUNKED --layout dset2:CHUNK=20x10
-TOOLTEST_MAIN h5repack_layout.h5 -l CHUNK=20x10
-VERIFY_LAYOUT_ALL h5repack_layout.h5 CHUNKED
+VERIFY_LAYOUT_ALL chunk_20x10 h5repack_layout.h5 CHUNKED -l CHUNK=20x10
-TOOLTEST_MAIN h5repack_layout.h5 -l dset2:CONTI
-VERIFY_LAYOUT_DSET h5repack_layout.h5 dset2 CONTIGUOUS
+VERIFY_LAYOUT_DSET dset2_conti h5repack_layout.h5 dset2 CONTIGUOUS -l dset2:CONTI
-TOOLTEST_MAIN h5repack_layout.h5 -l CONTI
-VERIFY_LAYOUT_ALL h5repack_layout.h5 CONTIGUOUS
+VERIFY_LAYOUT_ALL conti h5repack_layout.h5 CONTIGUOUS -l CONTI
-TOOLTEST_MAIN h5repack_layout.h5 -l dset2:COMPA
-VERIFY_LAYOUT_DSET h5repack_layout.h5 dset2 COMPACT
+VERIFY_LAYOUT_DSET dset2_compa h5repack_layout.h5 dset2 COMPACT -l dset2:COMPA
-TOOLTEST_MAIN h5repack_layout.h5 -l COMPA
-VERIFY_LAYOUT_ALL h5repack_layout.h5 COMPACT
+VERIFY_LAYOUT_ALL compa h5repack_layout.h5 COMPACT -l COMPA
################################################################
# layout conversions (file has no filters)
###############################################################
-TOOLTEST_MAIN h5repack_layout.h5 -l dset_compact:CONTI
-VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_compact CONTIGUOUS
+VERIFY_LAYOUT_DSET dset_compa_conti h5repack_layout.h5 dset_compact CONTIGUOUS -l dset_compact:CONTI
-TOOLTEST_MAIN h5repack_layout.h5 -l dset_compact:CHUNK=2x5
-VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_compact CHUNKED
+VERIFY_LAYOUT_DSET dset_compa_chunk h5repack_layout.h5 dset_compact CHUNKED -l dset_compact:CHUNK=2x5
-TOOLTEST_MAIN h5repack_layout.h5 -l dset_compact:COMPA
-VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_compact COMPACT
+VERIFY_LAYOUT_DSET dset_compa_compa h5repack_layout.h5 dset_compact COMPACT -l dset_compact:COMPA
-TOOLTEST_MAIN h5repack_layout.h5 -l dset_contiguous:COMPA
-VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_contiguous COMPACT
+VERIFY_LAYOUT_DSET dset_conti_compa h5repack_layout.h5 dset_contiguous COMPACT -l dset_contiguous:COMPA
-TOOLTEST_MAIN h5repack_layout.h5 -l dset_contiguous:CHUNK=3x6
-VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_contiguous CHUNKED
+VERIFY_LAYOUT_DSET dset_conti_chunk h5repack_layout.h5 dset_contiguous CHUNKED -l dset_contiguous:CHUNK=3x6
-TOOLTEST_MAIN h5repack_layout.h5 -l dset_contiguous:CONTI
-VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_contiguous CONTIGUOUS
+VERIFY_LAYOUT_DSET dset_conti_conti h5repack_layout.h5 dset_contiguous CONTIGUOUS -l dset_contiguous:CONTI
-TOOLTEST_MAIN h5repack_layout.h5 -l dset_chunk:COMPA
-VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_chunk COMPACT
+VERIFY_LAYOUT_DSET chunk_compa h5repack_layout.h5 dset_chunk COMPACT -l dset_chunk:COMPA
-TOOLTEST_MAIN h5repack_layout.h5 -l dset_chunk:CONTI
-VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_chunk CONTIGUOUS
+VERIFY_LAYOUT_DSET chunk_conti h5repack_layout.h5 dset_chunk CONTIGUOUS -l dset_chunk:CONTI
-TOOLTEST_MAIN h5repack_layout.h5 -l dset_chunk:CHUNK=18x13
-VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_chunk CHUNKED
+VERIFY_LAYOUT_DSET chunk_18x13 h5repack_layout.h5 dset_chunk CHUNKED -l dset_chunk:CHUNK=18x13
# test convert small size dataset ( < 1k) to compact layout without -m
-TOOLTEST_MAIN h5repack_layout2.h5 -l contig_small:COMPA
-VERIFY_LAYOUT_DSET h5repack_layout2.h5 contig_small COMPACT
+VERIFY_LAYOUT_DSET contig_small_compa h5repack_layout2.h5 contig_small COMPACT -l contig_small:COMPA
-TOOLTEST_MAIN h5repack_layout2.h5 -l chunked_small_fixed:COMPA
-VERIFY_LAYOUT_DSET h5repack_layout2.h5 chunked_small_fixed COMPACT
+VERIFY_LAYOUT_DSET contig_small_fixed_compa h5repack_layout2.h5 chunked_small_fixed COMPACT -l chunked_small_fixed:COMPA
#---------------------------------------------------------------------------
# Test file contains chunked datasets (need multiple dsets) with
@@ -806,17 +863,14 @@ VERIFY_LAYOUT_DSET h5repack_layout2.h5 chunked_small_fixed COMPACT
# Use first dset to test.
#---------------------------------------------------------------------------
# chunk to chunk - specify chunk dim bigger than any current dim
-TOOLTEST_MAIN h5repack_layout3.h5 -l chunk_unlimit1:CHUNK=100x300
-VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CHUNK
+VERIFY_LAYOUT_DSET chunk2chunk h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:CHUNK=100x300
# chunk to contiguous
-TOOLTEST_MAIN h5repack_layout3.h5 -l chunk_unlimit1:CONTI
-VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CONTI
+VERIFY_LAYOUT_DSET chunk2conti h5repack_layout3.h5 chunk_unlimit1 CONTI -l chunk_unlimit1:CONTI
# chunk to compact - convert big dataset (should be > 64k) for this purpose,
# should remain as original layout (chunk)
-TOOLTEST_MAIN h5repack_layout3.h5 -l chunk_unlimit1:COMPA
-VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CHUNK
+VERIFY_LAYOUT_DSET chunk2compa h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:COMPA
#--------------------------------------------------------------------------
# Test -f for some specific cases. Chunked dataset with unlimited max dims.
@@ -826,24 +880,22 @@ VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CHUNK
# - should not change max dims from unlimit
# chunk dim is bigger than dataset dim. ( dset size < 64k )
-TOOLTEST_MAIN h5repack_layout3.h5 -f chunk_unlimit1:NONE
-VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED
+VERIFY_LAYOUT_DSET error1 h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED -f chunk_unlimit1:NONE
# chunk dim is bigger than dataset dim. ( dset size > 64k )
-TOOLTEST_MAIN h5repack_layout3.h5 -f chunk_unlimit2:NONE
-VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED
+VERIFY_LAYOUT_DSET error2 h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED -f chunk_unlimit2:NONE
# chunk dims are smaller than dataset dims. ( dset size < 64k )
-TOOLTEST_MAIN h5repack_layout3.h5 -f chunk_unlimit3:NONE
-VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED
+#TOOLTEST_MAIN h5repack_layout3.h5 -f chunk_unlimit3:NONE
+VERIFY_LAYOUT_DSET error3 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED -f chunk_unlimit3:NONE
# file input - should not fail
-TOOLTEST h5repack_layout3.h5 -f NONE
+TOOLTEST error4 h5repack_layout3.h5 -f NONE
# Native option
# Do not use FILE1, as the named dtype will be converted to native, and h5diff will
# report a difference.
-TOOLTEST h5repack_fill.h5 -n
-TOOLTEST h5repack_attr.h5 -n
+TOOLTEST native_fill h5repack_fill.h5 -n
+TOOLTEST native_attr h5repack_attr.h5 -n
# latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters)
@@ -851,8 +903,7 @@ arg="h5repack_layout.h5 --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --nati
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
- TOOLTEST_MAIN $arg
- VERIFY_LAYOUT_ALL h5repack_layout.h5 CHUNKED
+ VERIFY_LAYOUT_ALL layout_long_switches h5repack_layout.h5 CHUNKED --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]
fi
# latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters)
@@ -860,8 +911,7 @@ arg="h5repack_layout.h5 -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dty
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
- TOOLTEST_MAIN $arg
- VERIFY_LAYOUT_ALL h5repack_layout.h5 CHUNKED
+ VERIFY_LAYOUT_ALL layout_short_switches h5repack_layout.h5 CHUNKED -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]
fi
# several global filters
@@ -870,7 +920,7 @@ arg="h5repack_layout.h5 --filter GZIP=1 --filter SHUF"
if test $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SHUFFLE != "yes" ; then
SKIP $arg
else
- TOOLTEST $arg
+ TOOLTEST global_filters $arg
fi
# syntax of -i infile -o outfile
@@ -879,46 +929,47 @@ arg="h5repack_layout.h5 -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dty
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
- TOOLTEST0 $arg
+ TOOLTEST0 old_style_layout_short_switches $arg
fi
# add a userblock to file
-arg="h5repack_objs.h5 -u ublock.bin -b 2048"
-TOOLTEST $arg
+arg="h5repack_objs.h5 -u $TESTDIR/ublock.bin -b 2048"
+TOOLTEST add_userblock $arg
# add alignment
arg="h5repack_objs.h5 -t 1 -a 1 "
-TOOLTEST $arg
+TOOLTEST add_alignment $arg
# Check repacking file with old version of layout message (should get upgraded
# to new version and be readable, etc.)
-TOOLTEST h5repack_layouto.h5
+TOOLTEST pgrade_layout h5repack_layouto.h5
# test for datum size > H5TOOLS_MALLOCSIZE
-TOOLTEST h5repack_objs.h5 -f GZIP=1
+TOOLTEST gt_mallocsize h5repack_objs.h5 -f GZIP=1
# Check repacking file with committed datatypes in odd configurations
-TOOLTEST h5repack_named_dtypes.h5
+TOOLTEST committed_dt h5repack_named_dtypes.h5
# tests family driver (file is located in common testfiles folder, uses TOOLTEST1
-TOOLTEST1 tfamily%05d.h5
+TOOLTEST1 family tfamily%05d.h5
# test various references (bug 1814 and 1726)
-TOOLTEST h5repack_refs.h5
+TOOLTEST bug1814 h5repack_refs.h5
# test attribute with various references (bug1797 / HDFFV-5932)
# the references in attribute of compund or vlen datatype
-TOOLTEST h5repack_attr_refs.h5
+TOOLTEST HDFFV-5932 h5repack_attr_refs.h5
# Add test for memory leak in attirbute. This test is verified by CTEST.
# 1. leak from vlen string
# 2. leak from compound type without reference member
# (HDFFV-7840, )
# Note: this test is experimental for sharing test file among tools
-TOOLTEST h5diff_attr1.h5
+TOOLTEST HDFFV-7840 h5diff_attr1.h5
# tests for metadata block size option
-TOOLTEST_META h5repack_layout.h5 --metadata_block_size=8192
+TOOLTEST_META meta_short h5repack_layout.h5 -M 8192
+TOOLTEST_META meta_long h5repack_layout.h5 --metadata_block_size=8192
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."