[svn-r29883] Convert import test script to standard used by other test scripts.

This commit is contained in:
Allen Byrne
2016-05-04 11:35:59 -05:00
parent ca8465513d
commit f962c3d963

View File

@@ -13,8 +13,7 @@
# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
# access to either file, you may request a copy from help@hdfgroup.org.
#
# HDF Utilities Test script
# Usage: h5importtestutil.sh [machine-type]
# Tests for the h5import tool
srcdir=@srcdir@
@@ -25,6 +24,15 @@ TESTNAME=h5import
EXIT_SUCCESS=0
EXIT_FAILURE=1
DUMPER=../h5dump/h5dump # The tool name
DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary
H5DIFF=../h5diff/h5diff # The h5diff tool name
H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary
H5IMPORT=h5import # The h5import tool name
H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary
RM='rm -rf'
CP='cp'
DIRNAME='dirname'
@@ -161,6 +169,9 @@ CLEAN_TESTFILES_AND_TESTDIR()
fi
}
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
#
TESTING() {
SPACES=" "
echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
@@ -175,11 +186,11 @@ SKIP() {
TOOLTEST()
{
err=0
$RUNSERIAL ./h5import $*
$RUNSERIAL ../h5dump/h5dump $5 >log2
$RUNSERIAL $H5IMPORT_BIN $*
$RUNSERIAL $DUMPER_BIN $5 >log2
cd tmp_testfiles
$RUNSERIAL ../../h5dump/h5dump $5 >log1
$RUNSERIAL $DUMPER_BIN $5 >log1
cd ..
cmp -s tmp_testfiles/log1 log2 || err=1
@@ -197,9 +208,9 @@ fi
TOOLTEST2()
{
err=0
$RUNSERIAL ../h5dump/h5dump -p -d $1 -o d$2.bin -b tmp_testfiles/$2 > d$2.dmp
$RUNSERIAL ./h5import d$2.bin -c d$2.dmp -o d$2 > d$2.imp
$RUNSERIAL ../h5diff/h5diff -v d$2 tmp_testfiles/$2 $1 $1 > log2
$RUNSERIAL $DUMPER_BIN -p -d $1 -o d$2.bin -b tmp_testfiles/$2 > d$2.dmp
$RUNSERIAL $H5IMPORT_BIN d$2.bin -c d$2.dmp -o d$2 > d$2.imp
$RUNSERIAL $H5DIFF_BIN -v d$2 tmp_testfiles/$2 $1 $1 > log2
$CP -f $SRC_H5IMPORT_TESTFILES/d$2.txt log1
cmp -s log1 log2 || err=1
@@ -218,9 +229,9 @@ fi
TOOLTEST3()
{
err=0
$RUNSERIAL ../h5dump/h5dump -p -d $1 -o d$2.bin -y --width=1 tmp_testfiles/$2 > d$2.dmp
$RUNSERIAL ./h5import d$2.bin -c d$2.dmp -o d$2 > d$2.imp
$RUNSERIAL ../h5diff/h5diff -v d$2 tmp_testfiles/$2 $1 $1 > log2
$RUNSERIAL $DUMPER_BIN -p -d $1 -o d$2.bin -y --width=1 tmp_testfiles/$2 > d$2.dmp
$RUNSERIAL $H5IMPORT_BIN d$2.bin -c d$2.dmp -o d$2 > d$2.imp
$RUNSERIAL $H5DIFF_BIN -v d$2 tmp_testfiles/$2 $1 $1 > log2
$CP -f $SRC_H5IMPORT_TESTFILES/d$2.txt log1
cmp -s log1 log2 || err=1
@@ -239,9 +250,9 @@ fi
TOOLTEST4()
{
err=0
$RUNSERIAL ../h5dump/h5dump -p -d $1 -o d$2.bin -y --width=1 tmp_testfiles/$2 > d$2.dmp
$RUNSERIAL ./h5import d$2.bin -c d$2.dmp -o d$2 > d$2.imp
$RUNSERIAL ../h5diff/h5diff -r d$2 tmp_testfiles/$2 $1 $1 > log2
$RUNSERIAL $DUMPER_BIN -p -d $1 -o d$2.bin -y --width=1 tmp_testfiles/$2 > d$2.dmp
$RUNSERIAL $H5IMPORT_BIN d$2.bin -c d$2.dmp -o d$2 > d$2.imp
$RUNSERIAL $H5DIFF_BIN -r d$2 tmp_testfiles/$2 $1 $1 > log2
$CP -f $SRC_H5IMPORT_TESTFILES/d$2.txt log1
@@ -260,7 +271,6 @@ echo "=============================="
echo "H5IMPORT tests started"
echo "=============================="
if [ -f h5import -a -f h5importtest ]; then
#echo "** Testing h5import ***"
rm -f output.h5 log1 tx* b* *.dat
@@ -359,10 +369,6 @@ TOOLTEST $TESTDIR/textpfe64.txt -c $TESTDIR/textpfe.conf -o textpfe.h5
rm -f txtin32.txt txtin16.txt txtin8.txt txtuin32.txt txtuin16.txt *.bin *.dmp *.imp *.h5
rm -rf tmp_testfiles
else
echo "** h5import or h5importtest not available ***"
nerrors="` expr $nerrors + 1 `";
fi
# Clean up temporary files/directories
CLEAN_TESTFILES_AND_TESTDIR