diff options
author | Albert Cheng <acheng@hdfgroup.org> | 1999-11-02 04:31:36 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 1999-11-02 04:31:36 (GMT) |
commit | f11c7e884298f69eddd02a647b8d370f0ea3dbf0 (patch) | |
tree | 909634d883a4a8df622adea7990479838deef574 /tools | |
parent | 297b9f0b590a05c743efc3560488ada63355b65d (diff) | |
download | hdf5-f11c7e884298f69eddd02a647b8d370f0ea3dbf0.zip hdf5-f11c7e884298f69eddd02a647b8d370f0ea3dbf0.tar.gz hdf5-f11c7e884298f69eddd02a647b8d370f0ea3dbf0.tar.bz2 |
[svn-r1803] [folded in changes made to v.1.3.]
Purpose:
Bug fix.
Description:
If the H4DUMP (hdp) is not executable for some reasons (e.g., not
in $PATH), it produced zero sized files. The test script did not
detect the abnormality but compared the zero sized files the same
and concluded the test passed.
Solution:
Test if H4DUMP can produce valid output. If not, print warning
messages. Also check the size of output files to make sure they
are reasonably valid.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testh5toh4 | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/tools/testh5toh4 b/tools/testh5toh4 index 0c66d89..7553bfe 100644 --- a/tools/testh5toh4 +++ b/tools/testh5toh4 @@ -8,18 +8,32 @@ RM='rm -f' SED='sed ' H4DUMP='hdp' -# Find out which version of hdp is being used. Over simplified -# algorithm but will do the job for now. -if ( $H4DUMP | grep -s 'NCSA HDF Version 4.1 Release 3' > /dev/null ) -then - H4DUMPVER=413 -else - H4DUMPVER=0 - echo " Some tests are skipped because your version of $H4DUMP does" - echo " not handle loops in Vgroups correctly. You need version" - echo " 4.1 Release 3 or later. Visit http://hdf.ncsa.uiuc.edu" +# Verify if $H4DUMP is a valid command. +tmpfile=/tmp/testh5toh4.$$ +$H4DUMP -H > $tmpfile +if [ ! -s $tmpfile ]; then + echo " Could not run the '$H4DUMP' command. The test can still proceed" + echo " but it may fail if '$H4DUMP' is needed to verify the output." + echo " You can make sure '$H4DUMP' is among your shell PATH and run" + echo " the test again. You may also visit http://hdf.ncsa.uiuc.edu" echo " or email hdfhelp@ncsa.uiuc.edu for more information." + H4DUMP=: + H4DUMPVER=0 +else + # Find out which version of hdp is being used. Over simplified + # algorithm but will do the job for now. + if ( grep -s 'NCSA HDF Version 4.1 Release 3' $tmpfile > /dev/null ) + then + H4DUMPVER=413 + else + H4DUMPVER=0 + echo " Some tests maybe skipped because your version of $H4DUMP does" + echo " not handle loops in Vgroups correctly. You need version" + echo " 4.1 Release 3 or later. Visit http://hdf.ncsa.uiuc.edu" + echo " or email hdfhelp@ncsa.uiuc.edu for more information." + fi fi +$RM $tmpfile # The build (current) directory might be different than the source directory. if test "X$srcdir" = X; then @@ -155,7 +169,13 @@ CONVERT() sed -e 's/reference = [0-9]*;//' > $actual_out fi - if $cmp $expect_out $actual_out; then + if [ "passed" = $result -a ! -s $actual_out ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + result=failed + test yes = "$verbose" && + echo " H4DUMP failed to produce valid output" + elif $cmp $expect_out $actual_out; then : else if test "passed" = $result; then |