summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack.sh.in
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2014-01-30 21:27:23 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2014-01-30 21:27:23 (GMT)
commitb7b4e77f1249fc4872a441c2f0810457b78a790d (patch)
treed0f570916c13a99fc4af543e30551971cee0d04e /tools/h5repack/h5repack.sh.in
parent2f8c7fbd5edcffd0e638799e543c6e8961de5488 (diff)
downloadhdf5-b7b4e77f1249fc4872a441c2f0810457b78a790d.zip
hdf5-b7b4e77f1249fc4872a441c2f0810457b78a790d.tar.gz
hdf5-b7b4e77f1249fc4872a441c2f0810457b78a790d.tar.bz2
[svn-r24666] Fix test folder deletion issue
Tested: local linux autotools
Diffstat (limited to 'tools/h5repack/h5repack.sh.in')
-rw-r--r--tools/h5repack/h5repack.sh.in59
1 files changed, 36 insertions, 23 deletions
diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in
index 045aebf..a4d12bd 100644
--- a/tools/h5repack/h5repack.sh.in
+++ b/tools/h5repack/h5repack.sh.in
@@ -70,7 +70,7 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles"
SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles"
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles"
-TESTDIR=./testfiles
+TESTDIR=./testpack
test -d $TESTDIR || mkdir $TESTDIR
######################################################################
@@ -209,6 +209,7 @@ DIFFTEST()
{
VERIFY h5diff output $@
(
+ cd $TESTDIR
$RUNSERIAL $H5DIFF_BIN -q "$@"
)
RET=$?
@@ -229,14 +230,15 @@ DIFFTEST()
TOOLTEST()
{
echo $@
- infile=$TESTDIR/$2
- outfile=$TESTDIR/out-$1.$2
+ infile=$2
+ outfile=out-$1.$2
shift
shift
# Run test.
TESTING $H5REPACK $@
(
+ cd $TESTDIR
$RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
)
RET=$?
@@ -254,11 +256,11 @@ TOOLTEST()
# Verifying layouts of a dataset
VERIFY_LAYOUT_DSET()
{
- layoutfile=$TESTDIR/layout-$1.$2
+ layoutfile=layout-$1.$2
dset=$3
expectlayout=$4
- infile=$TESTDIR/$2
- outfile=$TESTDIR/out-$1.$2
+ infile=$2
+ outfile=out-$1.$2
shift
shift
shift
@@ -266,6 +268,7 @@ VERIFY_LAYOUT_DSET()
TESTING $H5REPACK $@
(
+ cd $TESTDIR
$RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
)
RET=$?
@@ -281,9 +284,10 @@ VERIFY_LAYOUT_DSET()
# check the layout from a dataset
VERIFY "a dataset layout"
(
+ cd $TESTDIR
$RUNSERIAL $H5DUMP_BIN -d $dset -pH $outfile > $layoutfile
)
- $GREP $expectlayout $layoutfile > /dev/null
+ $GREP $expectlayout $TESTDIR/$layoutfile > /dev/null
if [ $? -eq 0 ]; then
echo " PASSED"
else
@@ -301,8 +305,8 @@ VERIFY_LAYOUT_DSET()
VERIFY_LAYOUT_ALL()
{
infile=$2
- outfile=$TESTDIR/out-$1.$2
- layoutfile=$TESTDIR/layout-$1.$2
+ outfile=out-$1.$2
+ layoutfile=layout-$1.$2
expectlayout=$3
shift
shift
@@ -310,6 +314,7 @@ VERIFY_LAYOUT_ALL()
TESTING $H5REPACK $@
(
+ cd $TESTDIR
$RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
)
RET=$?
@@ -327,6 +332,7 @@ VERIFY_LAYOUT_ALL()
# check if the other layouts still exsit
VERIFY "layouts"
(
+ cd $TESTDIR
echo
# if CONTIGUOUS
if [ $expectlayout = "CONTIGUOUS" ]; then
@@ -401,14 +407,15 @@ VERIFY_LAYOUT_ALL()
#
TOOLTEST0()
{
- infile=$TESTDIR/$2
- outfile=$TESTDIR/out-$1.$2
+ infile=$2
+ outfile=out-$1.$2
shift
shift
# Run test.
TESTING $H5REPACK $@
(
+ cd $TESTDIR
$RUNSERIAL $H5REPACK_BIN -i $infile -o $outfile "$@"
)
RET=$?
@@ -428,14 +435,15 @@ TOOLTEST0()
#
TOOLTEST1()
{
- infile=$TESTDIR/$2
- outfile=$TESTDIR/out-$1.$2
+ infile=$2
+ outfile=out-$1.$2
shift
shift
# Run test.
TESTING $H5REPACK $@
(
+ cd $TESTDIR
$RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
)
RET=$?
@@ -458,14 +466,15 @@ TOOLTESTV()
actual="$TESTDIR/`basename $2 .ddl`.out"
actual_err="$TESTDIR/`basename $2 .ddl`.err"
- infile=$TESTDIR/$2
- outfile=$TESTDIR/out-$1.$2
+ infile=$2
+ outfile=out-$1.$2
shift
shift
# Run test.
TESTING $H5REPACK $@
(
+ cd $TESTDIR
$RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
) >$actual 2>$actual_err
RET=$?
@@ -500,8 +509,8 @@ TOOLTESTV()
#
TOOLTEST_DUMP()
{
- infile=$TESTDIR/$2
- outfile=$TESTDIR/out-$1.$2
+ infile=$2
+ outfile=out-$1.$2
expect="$TESTDIR/$1.$2.ddl"
actual="$TESTDIR/out-$1.$2.out"
actual_err="$TESTDIR/out-$1.$2.err"
@@ -512,6 +521,7 @@ TOOLTEST_DUMP()
# Run test.
TESTING $H5REPACK $@
(
+ cd $TESTDIR
$RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
) >$actual 2>$actual_err
RET=$?
@@ -522,6 +532,7 @@ TOOLTEST_DUMP()
echo " PASSED"
VERIFY h5dump output $@
(
+ cd $TESTDIR
$RUNSERIAL $H5DUMP_BIN -pH $outfile
) >$actual 2>$actual_err
cat $actual_err >> $actual
@@ -559,14 +570,15 @@ TOOLTEST_DUMP()
# Verify the output file of second run is larger than the one of 1st run.
TOOLTEST_META()
{
- infile=$TESTDIR/$2
- outfile=$TESTDIR/out-$1.$2
+ infile=$2
+ outfile=out-$1.$2
shift
shift
# Run test.
TESTING $H5REPACK $@
(
+ cd $TESTDIR
$RUNSERIAL $H5REPACK_BIN $infile $outfile
)
RET=$?
@@ -578,12 +590,13 @@ TOOLTEST_META()
DIFFTEST $infile $outfile
fi
# get the size of the first output file
- size1=`wc -c $outfile | cut -d' ' -f1`
+ size1=`wc -c $TESTDIR/$outfile | cut -d' ' -f1`
# 2nd run with metadata option
# Run test.
TESTING $H5REPACK $@
(
+ cd $TESTDIR
$RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
)
RET=$?
@@ -595,7 +608,7 @@ TOOLTEST_META()
DIFFTEST $infile $outfile
fi
# get the size of the second output file
- size2=`wc -c $outfile | cut -d' ' -f1`
+ size2=`wc -c $TESTDIR/$outfile | cut -d' ' -f1`
# verify sizes.
MESSAGE "Verify the sizes of both output files ($size1 vs $size2)"
@@ -927,7 +940,7 @@ else
fi
#file
-arg="h5repack_layout.h5 -e $TESTDIR/h5repack.info"
+arg="h5repack_layout.h5 -e h5repack.info"
if test $USE_FILTER_DEFLATE != "yes" ; then
SKIP $arg
else
@@ -1064,7 +1077,7 @@ else
fi
# add a userblock to file
-arg="h5repack_objs.h5 -u $TESTDIR/ublock.bin -b 2048"
+arg="h5repack_objs.h5 -u ublock.bin -b 2048"
TOOLTEST add_userblock $arg
# add alignment