summaryrefslogtreecommitdiffstats
path: root/tools/h5import
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2009-12-26 07:43:50 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2009-12-26 07:43:50 (GMT)
commit8de1f3aab3c40a81402759d8416d5e71b66b4919 (patch)
tree0e222109f002762b653900ba9239872e74aea0cf /tools/h5import
parentb6a36494bc0593e25ce78a807c1ad2121a139a7f (diff)
downloadhdf5-8de1f3aab3c40a81402759d8416d5e71b66b4919.zip
hdf5-8de1f3aab3c40a81402759d8416d5e71b66b4919.tar.gz
hdf5-8de1f3aab3c40a81402759d8416d5e71b66b4919.tar.bz2
[svn-r18053] Bug fix: 1192
Description: Fixed exit code (sometimes return code in Main) to follow the HDF5 standards. Tested: H5committested plus serial test in Jam.
Diffstat (limited to 'tools/h5import')
-rwxr-xr-xtools/h5import/h5import.c2
-rwxr-xr-xtools/h5import/h5importtestutil.sh23
2 files changed, 13 insertions, 12 deletions
diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c
index 60ef494..e9e7dac 100755
--- a/tools/h5import/h5import.c
+++ b/tools/h5import/h5import.c
@@ -116,7 +116,7 @@ int main(int argc, char *argv[])
case 6: /* -h found; help, then exit */
help(argv[0]);
- exit(0);
+ exit(EXIT_SUCCESS);
break;
case 7: /* -d found; look for dimensions */
diff --git a/tools/h5import/h5importtestutil.sh b/tools/h5import/h5importtestutil.sh
index 0409b46..9ec8e15 100755
--- a/tools/h5import/h5importtestutil.sh
+++ b/tools/h5import/h5importtestutil.sh
@@ -16,8 +16,12 @@
# HDF Utilities Test script
# Usage: h5importtestutil.sh [machine-type]
+TESTNAME=h5import
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
# initialize errors variable
-errors=0
+nerrors=0
TESTING() {
SPACES=" "
@@ -37,7 +41,7 @@ cd ..
cmp -s tmp_testfiles/log1 log2 || err=1
rm -f log2 tmp_testfiles/log1
if [ $err -eq 1 ]; then
-errors="` expr $errors + 1 `";
+nerrors="` expr $nerrors + 1 `";
echo "*FAILED*"
else
echo " PASSED"
@@ -108,18 +112,15 @@ rm -f *.txt *.bin *.h5
rm -rf tmp_testfiles
else
echo "** h5import or h5importtest not available ***"
- errors="` expr $errors + 1 `";
+ nerrors="` expr $nerrors + 1 `";
fi
#
# Check errors result
-if [ $errors -eq 0 ]; then
- echo "======================================"
- echo " H5IMPORT Utilities tests have passed."
- echo "======================================"
+if test $nerrors -eq 0 ; then
+ echo "All $TESTNAME tests passed."
+ exit $EXIT_SUCCESS
else
- echo "*********************************************"
- echo " H5IMPORT Utilities tests encountered errors"
- echo "*********************************************"
+ echo "$TESTNAME tests failed with $nerrors errors."
+ exit $EXIT_FAILURE
fi
-exit $errors