summaryrefslogtreecommitdiffstats
path: root/tools/test/misc/testh5mkgrp.sh.in
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-05-02 17:36:02 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-05-02 17:36:02 (GMT)
commit7608b264e4a0325589ba6300ca9666ce83d88b37 (patch)
tree1821589ff8ec04f723f35aebdb49287e2f50a826 /tools/test/misc/testh5mkgrp.sh.in
parent3b81a29c469f909858b6c135036ffa43a9f97534 (diff)
downloadhdf5-7608b264e4a0325589ba6300ca9666ce83d88b37.zip
hdf5-7608b264e4a0325589ba6300ca9666ce83d88b37.tar.gz
hdf5-7608b264e4a0325589ba6300ca9666ce83d88b37.tar.bz2
Make test scripts fail if result files are created
Diffstat (limited to 'tools/test/misc/testh5mkgrp.sh.in')
-rw-r--r--tools/test/misc/testh5mkgrp.sh.in32
1 files changed, 18 insertions, 14 deletions
diff --git a/tools/test/misc/testh5mkgrp.sh.in b/tools/test/misc/testh5mkgrp.sh.in
index 3990bd2..3ad1f71 100644
--- a/tools/test/misc/testh5mkgrp.sh.in
+++ b/tools/test/misc/testh5mkgrp.sh.in
@@ -98,7 +98,7 @@ COPY_TESTFILES_TO_TESTDIR()
$CP -f $tstfile $TESTDIR
if [ $? -ne 0 ]; then
echo "Error: FAILED to copy $tstfile ."
-
+
# Comment out this to CREATE expected file
exit $EXIT_FAILURE
fi
@@ -122,7 +122,7 @@ CLEAN_TESTFILES_AND_TESTDIR()
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
-TESTING()
+TESTING()
{
SPACES=" "
echo "Testing $* $SPACES" |cut -c1-70 |tr -d '\012'
@@ -134,7 +134,7 @@ TESTING()
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Verifying".
#
-VERIFY_H5LS()
+VERIFY_H5LS()
{
SPACES=" "
echo "Verifying h5ls file structure $* $SPACES" | cut -c1-70 | tr -d '\012'
@@ -146,7 +146,7 @@ VERIFY_H5LS()
# Assumed arguments:
# $* arguments for h5mkgrp.
-TOOLTEST()
+TOOLTEST()
{
TESTING $H5MKGRP $@
(
@@ -171,7 +171,7 @@ TOOLTEST()
# Call the h5ls tool to verify the correct output data in the destination file
#
-H5LSTEST()
+H5LSTEST()
{
expect="$TESTDIR/`basename $1 .h5`.ls"
actual="$TESTDIR/`basename $1 .h5`.out"
@@ -191,9 +191,11 @@ H5LSTEST()
STDERR_FILTER $actual
if [ ! -f $expect ]; then
- # Create the expect file if it doesn't yet exist.
- echo " CREATED"
- cp $actual $expect
+ # Create the expect file if it doesn't yet exist.
+ echo " CREATED"
+ cp $actual $expect
+ echo " Expected result (*.ls) missing"
+ nerrors="`expr $nerrors + 1`"
elif $CMP $expect $actual; then
echo " PASSED"
else
@@ -215,7 +217,7 @@ H5LSTEST()
# $1 is test file name
# $2 is h5mkgrp options
# $* are groups to create
-RUNTEST()
+RUNTEST()
{
FILEOUT=$1
shift
@@ -244,7 +246,7 @@ RUNTEST()
# $1 is test expected output file
# $2 is h5mkgrp options
# $* are groups to create
-CMPTEST()
+CMPTEST()
{
FILEOUT=$1
expect="$TESTDIR/`basename $1 .h5`.txt"
@@ -260,11 +262,13 @@ CMPTEST()
$RUNSERIAL $H5MKGRP_BIN $@
) >$actual 2>$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
+ echo " CREATED"
+ cp $actual $expect
+ echo " Expected result (*.txt) missing"
+ nerrors="`expr $nerrors + 1`"
elif $CMP $expect $actual; then
echo " PASSED"
else
@@ -302,7 +306,7 @@ RUNTEST h5mkgrp_several_v.h5 "-v" one two
RUNTEST h5mkgrp_several_p.h5 "-p" one two
RUNTEST h5mkgrp_several_l.h5 "-l" one two
-# Create various nested groups
+# Create various nested groups
RUNTEST h5mkgrp_nested_p.h5 "-p" /one/two
RUNTEST h5mkgrp_nested_lp.h5 "-lp" /one/two
RUNTEST h5mkgrp_nested_mult_p.h5 "-p" /one/two /three/four