mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-06 14:56:51 +08:00
f859cb732b
* fixed missed closing of a dataset * fixed missed closing of a dataset * fixed typo in error return * Committing clang-format changes * minor edits * code format * Committing clang-format changes * code format * minor edit * switched from using MPI_count, to actual bytes written for H5FD_mpio_debug rw debugging * Committing clang-format changes * changed size_i in printf to reflect the I/O. * Committing clang-format changes * Fixed seg fault with xlf on BE with -qintsize=8 * fixed error function string * spelling corrections via codespell, added new spell check github actions * Committing clang-format changes * misc * misc * misc * misc * misc * misc * misc * misc * misc * misc * misc * misc * misc * misc * Committing clang-format changes * misc * misc * misc * misc * misc * misc * Committing clang-format changes * misc * work around for https://github.com/codespell-project/codespell/issues/2137 * misc * added missing file * misc * misc. * misc * switch to using Codespell with GitHub Actions * misc. * misc. * fixed more sp errors * Fix new typos found by codespell. * fixed proceed with precede * fixed variable in fortran test * fixed minnum * updated spelling list Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
97 lines
2.6 KiB
Bash
97 lines
2.6 KiB
Bash
#!/bin/sh
|
|
#
|
|
# Copyright by The HDF Group.
|
|
# Copyright by the Board of Trustees of the University of Illinois.
|
|
# All rights reserved.
|
|
#
|
|
# This file is part of HDF5. The full HDF5 copyright notice, including
|
|
# terms governing use, modification, and redistribution, is contained in
|
|
# the COPYING file, which can be found at the root of the source code
|
|
# distribution tree, or in https://www.hdfgroup.org/licenses.
|
|
# If you do not have access to either file, you may request a copy from
|
|
# help@hdfgroup.org.
|
|
#
|
|
# HDF Utilities Test script
|
|
|
|
|
|
TESTFILE1="$srcdir/testfiles/h52giftst.h5"
|
|
TESTFILE2="$srcdir/testfiles/image1.gif"
|
|
TESTFILE3="$srcdir/testfiles/ex_image2.h5"
|
|
|
|
# initialize errors variable
|
|
errors=0
|
|
|
|
TESTING() {
|
|
SPACES=" "
|
|
echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
|
|
}
|
|
|
|
|
|
|
|
# Verify the test runs with success (return code is 0)
|
|
TOOLTEST()
|
|
{
|
|
# for now, discard any error messages generated.
|
|
$RUNSERIAL $* > /dev/null 2>&1
|
|
|
|
RET=$?
|
|
if [ $RET = 0 ] ; then
|
|
echo " PASSED"
|
|
else
|
|
echo "*FAILED*"
|
|
errors="` expr $errors + 1 `";
|
|
fi
|
|
|
|
}
|
|
|
|
# Verify the test runs with failure (return code is not 0)
|
|
# Use for testing if tool can handle error conditions like
|
|
# illegal input, bad arguments, exceeding limits, ...
|
|
TOOLTESTFAIL()
|
|
{
|
|
# for now, discard any error messages generated.
|
|
$RUNSERIAL $* > /dev/null 2>&1
|
|
|
|
RET=$?
|
|
if [ $RET != 0 ] ; then
|
|
echo " PASSED"
|
|
else
|
|
echo "*FAILED*"
|
|
errors="` expr $errors + 1 `";
|
|
fi
|
|
}
|
|
|
|
|
|
# Positive tests for gif2h5
|
|
echo "**validate the gif2h5 tool processes input correctly..."
|
|
TESTING "./gif2h5 image1.gif image1.h5"
|
|
TOOLTEST ./gif2h5 $TESTFILE2 image1.h5
|
|
echo ""
|
|
|
|
# Positive tests for h52gif
|
|
echo "**validate the h52gif tool processes input correctly..."
|
|
TESTING "./h52gif h52giftst.h5 image1.gif -i image"
|
|
TOOLTEST ./h52gif $TESTFILE1 image1.gif -i image
|
|
echo ""
|
|
|
|
# Negative tests.
|
|
echo "**verify that the h52gif tool handles error conditions correctly..."
|
|
# nonexisting dataset name
|
|
TESTING "./h52gif h52giftst.h5 image.gif -i nosuch_image"
|
|
TOOLTESTFAIL "./h52gif $TESTFILE1 image.gif -i nosuch_image"
|
|
# this test should have failed but it did not. Comment it out for now.
|
|
#TESTING "./h52gif h52giftst.h5 image.gif -i palette"
|
|
#TOOLTESTFAIL "./h52gif $TESTFILE1 image.gif -i palette"
|
|
TESTING "./h52gif h52giftst.h5 image24.gif -i image24bitpixel"
|
|
TOOLTESTFAIL "./h52gif $TESTFILE3 image24.gif -i image24bitpixel"
|
|
echo ""
|
|
|
|
# all done. summarize results.
|
|
if test $errors -eq 0 ; then
|
|
echo "All gif2h5 and h52gif tests passed."
|
|
exit 0
|
|
else
|
|
echo "Some gif2h5 or h52gif tests failed with $errors errors."
|
|
exit 1
|
|
fi
|