summaryrefslogtreecommitdiffstats
path: root/tools/h5repack
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2013-08-21 22:11:32 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2013-08-21 22:11:32 (GMT)
commit13a0f5576acfcce93c7b8344f3dd34e8e562e71a (patch)
tree4bbebf0fa6bc3be933e1a750975ffc67ec967e94 /tools/h5repack
parent8c14af82c61f50146a6c5646c2320a08d09dc32d (diff)
downloadhdf5-13a0f5576acfcce93c7b8344f3dd34e8e562e71a.zip
hdf5-13a0f5576acfcce93c7b8344f3dd34e8e562e71a.tar.gz
hdf5-13a0f5576acfcce93c7b8344f3dd34e8e562e71a.tar.bz2
[svn-r24053] HDFFV-8498: --minimum option was disabled by HDFFV-8214. Reverted code change and changed default to 0 from 1024. Changed limit test to use h5dump to compare repacked file instead of h5diff.
Corrected test scripts for test folder path Tested: h5committest and local linux with CMake
Diffstat (limited to 'tools/h5repack')
-rw-r--r--tools/h5repack/CMakeTests.cmake8
-rw-r--r--tools/h5repack/h5repack.sh.in53
-rw-r--r--tools/h5repack/testfiles/h5repack_layout.h5.ddl2
3 files changed, 56 insertions, 7 deletions
diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake
index 0734220..c27aaa0 100644
--- a/tools/h5repack/CMakeTests.cmake
+++ b/tools/h5repack/CMakeTests.cmake
@@ -208,11 +208,11 @@
NAME H5REPACK_DMP-h5dump-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
- -D "TEST_ARGS:STRING=-pH;out-${testname}.${resultfile}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
- -D "TEST_OUTPUT=${resultfile}-${testname}.out"
+ -D "TEST_ARGS:STRING=-pH;./testfiles/out-${testname}.${resultfile}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -D "TEST_OUTPUT=./testfiles/${resultfile}-${testname}.out"
-D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=${resultfile}.ddl"
+ -D "TEST_REFERENCE=testfiles/${resultfile}.ddl"
-P "${HDF5_RESOURCES_DIR}/runTest.cmake"
)
SET_TESTS_PROPERTIES (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}")
diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in
index ca25183..42b8ecb 100644
--- a/tools/h5repack/h5repack.sh.in
+++ b/tools/h5repack/h5repack.sh.in
@@ -120,6 +120,7 @@ LIST_OTHER_TEST_FILES="
$SRC_H5REPACK_TESTFILES/h5repack_ext.bin
$SRC_H5REPACK_TESTFILES/ublock.bin
$SRC_H5REPACK_TESTFILES/h5repack.info
+$SRC_H5REPACK_TESTFILES/h5repack_layout.h5.ddl
$SRC_TOOLS_TESTFILES/h5repack_filters.h5.ddl
"
@@ -201,7 +202,7 @@ DIFFTEST()
fi
}
-
+
# Call h5repack
#
@@ -475,6 +476,54 @@ TOOLTESTV()
rm -f $actual $actual_err
rm -f $outfile
}
+
+# This is same as TOOLTESTV() with comparing h5dump output
+# from -pH option
+#
+TOOLTEST_DUMP()
+{
+ infile=$TESTDIR/$2
+ outfile=$TESTDIR/out-$1.$2
+ expect="$TESTDIR/$2.ddl"
+ actual="$TESTDIR/out-$1.$2.out"
+ actual_err="$TESTDIR/out-$1.$2.err"
+
+ shift
+ shift
+
+ # Run test.
+ TESTING $H5REPACK $@
+ (
+ $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
+ ) >$actual 2>$actual_err
+ RET=$?
+ if [ $RET != 0 ] ; then
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ else
+ echo " PASSED"
+ VERIFY h5dump output $@
+ (
+ $RUNSERIAL $H5DUMP_BIN -pH $outfile
+ ) >$actual 2>$actual_err
+ cat $actual_err >> $actual
+
+ RET=$?
+
+ fi
+
+ if cmp -s $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 -c $expect $actual |sed 's/^/ /'
+ fi
+
+ rm -f $actual $actual_err
+ rm -f $outfile
+}
# TOOLTEST_META:
# Test metadata block size option.
@@ -820,7 +869,7 @@ arg="h5repack_layout.h5 -f GZIP=1 -m 1024"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
- TOOLTEST deflate_limit $arg
+ TOOLTEST_DUMP deflate_limit $arg
fi
#file
diff --git a/tools/h5repack/testfiles/h5repack_layout.h5.ddl b/tools/h5repack/testfiles/h5repack_layout.h5.ddl
index b8e7e68..d380201 100644
--- a/tools/h5repack/testfiles/h5repack_layout.h5.ddl
+++ b/tools/h5repack/testfiles/h5repack_layout.h5.ddl
@@ -1,4 +1,4 @@
-HDF5 "out-deflate_limit.h5repack_layout.h5" {
+HDF5 "./testfiles/out-deflate_limit.h5repack_layout.h5" {
GROUP "/" {
DATASET "dset1" {
DATATYPE H5T_STD_I32LE