diff options
author | Jonathan Kim <jkm@hdfgroup.org> | 2011-05-19 22:51:36 (GMT) |
---|---|---|
committer | Jonathan Kim <jkm@hdfgroup.org> | 2011-05-19 22:51:36 (GMT) |
commit | a558128a18e84189772dd2a84c481eab49751857 (patch) | |
tree | 0755a11fb361055a45317893223f1cfc849f413c /tools/h5dump | |
parent | 089e81e86a2d0558b0b3aa36003383fe8d80d2bd (diff) | |
download | hdf5-a558128a18e84189772dd2a84c481eab49751857.zip hdf5-a558128a18e84189772dd2a84c481eab49751857.tar.gz hdf5-a558128a18e84189772dd2a84c481eab49751857.tar.bz2 |
[svn-r20869] Purpose:
HDFFV-7514 - GMQS: h5dump - improve effectiveness of testing scripts for handling expected output files
Description:
Fist phase for h5dump test update. Next phase will be for h5ls.
This is prerequisite for 'HDFFV-7602 Tools - upgrade tools' test scripts to share test files among tools, providing framework for test file re-usability.'
Tested:
jam (linux32-LE), koala (linux64-LE), heiwa (linuxppc64-BE), linew (solaris-BE), Windows (32-LE), Cmake (jam)
Diffstat (limited to 'tools/h5dump')
-rw-r--r-- | tools/h5dump/CMakeLists.txt | 40 | ||||
-rw-r--r-- | tools/h5dump/testh5dump.sh.in | 74 | ||||
-rwxr-xr-x | tools/h5dump/testh5dumpxml.sh.in | 3 |
3 files changed, 31 insertions, 86 deletions
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index a176ba0..900103a 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -47,6 +47,7 @@ IF (BUILD_TESTING) tall-3.ddl tall-4s.ddl tall-5s.ddl + tall-6.ddl tallfilters.ddl tarray1.ddl tarray1_big.ddl @@ -62,6 +63,11 @@ IF (BUILD_TESTING) tattr-3.ddl tattrreg.ddl tattrregR.ddl + tbin1.ddl + tbin1.ddl + tbin2.ddl + tbin3.ddl + tbin4.ddl tbinregR.ddl tbigdims.ddl tboot1.ddl @@ -82,6 +88,10 @@ IF (BUILD_TESTING) tdset-2.ddl tdset-3s.ddl tempty.ddl + texceedsubstart.ddl + texceedsubcount.ddl + texceedsubstride.ddl + texceedsubblock.ddl texternal.ddl textlinksrc.ddl textlinkfar.ddl @@ -149,6 +159,8 @@ IF (BUILD_TESTING) tvldtypes5.ddl tvlstr.ddl tvms.ddl + h5dump-help.txt + out3.h5import ) SET (HDF5_XML_REFERENCE_FILES tall.h5.xml @@ -216,18 +228,6 @@ IF (BUILD_TESTING) tvlstr.h5.xml ) SET (HDF5_REFERENCE_TEST_FILES - h5dump-help.txt - tbin1.ddl - tbin1.ddl - tbin2.ddl - tbin3.ddl - tbin4.ddl - tall-6.ddl - texceedsubstart.ddl - texceedsubcount.ddl - texceedsubstride.ddl - texceedsubblock.ddl - out3.h5import filter_fail.h5 packedbits.h5 taindices.h5 @@ -335,23 +335,23 @@ IF (BUILD_TESTING) FOREACH (ddl_file ${HDF5_REFERENCE_FILES}) SET (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") - #MESSAGE (STATUS " Translating ${ddl_file}") + #MESSAGE (STATUS " Copying ${ddl_file}") ADD_CUSTOM_COMMAND ( TARGET h5dump POST_BUILD - COMMAND ${XLATE_UTILITY} - ARGS ${HDF5_TOOLS_SRC_DIR}/testfiles/${ddl_file} ${ddldest} -l3 + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${ddl_file} ${ddldest} ) ENDFOREACH (ddl_file ${HDF5_REFERENCE_FILES}) FOREACH (xml_file ${HDF5_XML_REFERENCE_FILES}) SET (xmldest "${PROJECT_BINARY_DIR}/${xml_file}") - #MESSAGE (STATUS " Translating ${xml_file}") + #MESSAGE (STATUS " Copying ${xml_file}") ADD_CUSTOM_COMMAND ( TARGET h5dump POST_BUILD - COMMAND ${XLATE_UTILITY} - ARGS ${HDF5_TOOLS_SRC_DIR}/testfiles/${xml_file} ${xmldest} -l3 + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${xml_file} ${xmldest} ) ENDFOREACH (xml_file ${HDF5_XML_REFERENCE_FILES}) @@ -465,8 +465,8 @@ IF (BUILD_TESTING) ADD_CUSTOM_COMMAND ( TARGET h5dump POST_BUILD - COMMAND ${XLATE_UTILITY} - ARGS ${HDF5_TOOLS_SRC_DIR}/testfiles/${ddl_pbits} ${ddldest} -l3 + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${ddl_pbits} ${ddldest} ) ENDFOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS}) diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 5c0503f..c33bd37 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -81,56 +81,6 @@ TOOLTEST() { # Run test. TESTING $DUMPER $@ ( - echo "#############################" - echo "Expected output for '$DUMPER $@'" - echo "#############################" - cd $srcdir/../testfiles - $RUNSERIAL $DUMPER_BIN $@ - ) >$actual 2>$actual_err - - # save actual and actual_err in case they are needed later. - cp $actual $actual_sav - STDOUT_FILTER $actual - cp $actual_err $actual_err_sav - STDERR_FILTER $actual_err - cat $actual_err >> $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 (*.ddl) 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 $actual_sav $actual_err_sav - fi - -} - - -# same as TOOLTEST but does not print the header Expected output -# used for the binary tests that expect a full path in -o -TOOLTEST1() { - - expect="$srcdir/../testfiles/$1" - actual="../testfiles/`basename $1 .ddl`.out" - actual_err="../testfiles/`basename $1 .ddl`.err" - actual_sav=${actual}-sav - actual_err_sav=${actual_err}-sav - shift - - # Run test. - TESTING $DUMPER $@ - ( - cd $srcdir/../testfiles $RUNSERIAL $DUMPER_BIN $@ ) >$actual 2>$actual_err @@ -162,6 +112,7 @@ TOOLTEST1() { } + # same as TOOLTEST1 but compares generated file to expected output # and compares the generated data file to the expected data file # used for the binary tests that expect a full path in -o without -b @@ -229,9 +180,6 @@ TOOLTEST3() { # Run test. TESTING $DUMPER $@ ( - echo "#############################" - echo "Expected output for '$DUMPER $@'" - echo "#############################" cd $srcdir/../testfiles $RUNSERIAL $DUMPER_BIN $@ ) >$actual 2>$actual_err @@ -515,10 +463,10 @@ TOOLTEST tindicessub3.ddl -d 3d -s 0,1,2 -S 1,3,3 -c 2,2,2 -k 1,2,2 taindices. TOOLTEST tindicessub4.ddl -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5 #Exceed the dimensions for subsetting -TOOLTEST1 texceedsubstart.ddl -d 1d -s 1,3 taindices.h5 -TOOLTEST1 texceedsubcount.ddl -d 1d -c 1,3 taindices.h5 -TOOLTEST1 texceedsubstride.ddl -d 1d -S 1,3 taindices.h5 -TOOLTEST1 texceedsubblock.ddl -d 1d -k 1,3 taindices.h5 +TOOLTEST texceedsubstart.ddl -d 1d -s 1,3 taindices.h5 +TOOLTEST texceedsubcount.ddl -d 1d -c 1,3 taindices.h5 +TOOLTEST texceedsubstride.ddl -d 1d -S 1,3 taindices.h5 +TOOLTEST texceedsubblock.ddl -d 1d -k 1,3 taindices.h5 # tests for filters @@ -599,21 +547,21 @@ TOOLTEST zerodim.ddl zerodim.h5 TOOLTEST tvms.ddl tvms.h5 # test for binary output -TOOLTEST1 tbin1.ddl -d integer -o $TESTDIR/out1.bin -b LE tbinary.h5 +TOOLTEST tbin1.ddl -d integer -o $TESTDIR/out1.bin -b LE tbinary.h5 # NATIVE default. the NATIVE test can be validated with h5import/h5diff -TOOLTEST1 tbin1.ddl -d integer -o $TESTDIR/out1.bin -b tbinary.h5 +TOOLTEST tbin1.ddl -d integer -o $TESTDIR/out1.bin -b tbinary.h5 IMPORTTEST $TESTDIR/out1.bin -c out3.h5import -o $TESTDIR/out1.h5 DIFFTEST tbinary.h5 $TESTDIR/out1.h5 /integer /integer -TOOLTEST1 tbin2.ddl -b BE -d float -o $TESTDIR/out2.bin tbinary.h5 +TOOLTEST tbin2.ddl -b BE -d float -o $TESTDIR/out2.bin tbinary.h5 # the NATIVE test can be validated with h5import/h5diff -TOOLTEST1 tbin3.ddl -d integer -o $TESTDIR/out3.bin -b NATIVE tbinary.h5 +TOOLTEST tbin3.ddl -d integer -o $TESTDIR/out3.bin -b NATIVE tbinary.h5 IMPORTTEST $TESTDIR/out3.bin -c out3.h5import -o $TESTDIR/out3.h5 DIFFTEST tbinary.h5 $TESTDIR/out3.h5 /integer /integer -TOOLTEST1 tbin4.ddl -d double -b FILE -o $TESTDIR/out4.bin tbinary.h5 +TOOLTEST tbin4.ddl -d double -b FILE -o $TESTDIR/out4.bin tbinary.h5 # Clean up binary output files if test -z "$HDF5_NOCLEANUP"; then @@ -663,7 +611,7 @@ TOOLTEST textlink.ddl textlink.h5 TOOLTEST3 filter_fail.ddl --enable-error-stack filter_fail.h5 # test for -o -y for dataset with attributes -TOOLTEST1 tall-6.ddl -y -o $TESTDIR/data -d /g1/g1.1/dset1.1.1 tall.h5 +TOOLTEST tall-6.ddl -y -o $TESTDIR/data -d /g1/g1.1/dset1.1.1 tall.h5 # test for dataset packed bits # Limits: diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in index c9f1ad2..0bd01b0 100755 --- a/tools/h5dump/testh5dumpxml.sh.in +++ b/tools/h5dump/testh5dumpxml.sh.in @@ -62,9 +62,6 @@ TOOLTEST() { # Run test. TESTING $DUMPER $@ ( - echo "#############################" - echo "Expected output for '$DUMPER $@'" - echo "#############################" cd $srcdir/../testfiles $RUNSERIAL $DUMPER_BIN $@ ) >$actual 2>$actual_err |