[svn-r18057] Bug fix: 1192

Description:
Fixed exit code (sometimes return code in Main) to follow the HDF5 standards.

Tested:
Jam, both serial and parallel.
This commit is contained in:
Albert Cheng 2009-12-26 05:12:49 -05:00
parent f40a245ce2
commit ac5945b412
8 changed files with 60 additions and 26 deletions

View File

@ -20,6 +20,10 @@
#
# Initializations
TESTNAME=h5c++
EXIT_SUCCESS=0
EXIT_FAILURE=1
# Where the tool is installed.
prefix="${prefix:-@prefix@}"
AR="@AR@"
@ -30,7 +34,7 @@ H5TOOL_BIN="${prefix}/bin/${H5TOOL}" # The path of the tool binary
CMP='cmp -s'
DIFF='diff -c'
nerrors=0
nerrors=$EXIT_SUCCESS
verbose=yes
# setup my machine information.
@ -271,7 +275,9 @@ if test -z "$HDF5_NOCLEANUP"; then
fi
if test $nerrors -eq 0 ; then
echo "All $H5TOOL tests passed."
echo "All $TESTNAME tests passed."
exit $EXIT_SUCCESS
else
echo "$TESTNAME tests failed with $nerrors errors."
exit $EXIT_FAILURE
fi
exit $nerrors

View File

@ -36,6 +36,10 @@ HL="@HL@"
## ##
############################################################################
# Constants definitions
EXIT_SUCCESS=0
EXIT_FAILURE=1
host_os="@host_os@"
prog_name="`basename $0`"
@ -91,7 +95,7 @@ usage() {
echo " HDF5_CXX - use a different C++ compiler"
echo " HDF5_CXXLINKER - use a different linker"
echo " "
exit 1
exit $EXIT_FAILURE
}
# Show the configuration summary of the library recorded in the
@ -103,7 +107,7 @@ showconfigure()
}
# Main
status=0
status=$EXIT_SUCCESS
if test "$#" = "0"; then
# No parameters specified, issue usage statement and exit.

View File

@ -24,6 +24,10 @@
#
# Initializations
TESTNAME=h5cc
EXIT_SUCCESS=0
EXIT_FAILURE=1
# Where the tool is installed.
prefix="${prefix:-@prefix@}"
PARALLEL=@PARALLEL@ # Am I in parallel mode?
@ -39,7 +43,7 @@ H5TOOL_BIN="${prefix}/bin/${H5TOOL}" # The path of the tool binary
CMP='cmp -s'
DIFF='diff -c'
nerrors=0
nerrors=$EXIT_SUCCESS
verbose=${HDF5_VERBOSE:-1} # 0: none; 1: default; 2: chatty; 3: everything
test $verbose -gt 2 && set -x
H5_NO_DEPRECATED_SYMBOLS=`grep '#define H5_NO_DEPRECATED_SYMBOLS ' ../src/H5pubconf.h`
@ -343,7 +347,9 @@ if test -z "$HDF5_NOCLEANUP"; then
fi
if test $nerrors -eq 0 ; then
echo "All $H5TOOL tests passed."
echo "All $TESTNAME tests passed."
exit $EXIT_SUCCESS
else
echo "$TESTNAME tests failed with $nerrors errors."
exit $EXIT_FAILURE
fi
exit $nerrors

View File

@ -20,6 +20,10 @@
#
# Initializations
TESTNAME=h5fc
EXIT_SUCCESS=0
EXIT_FAILURE=1
# Where the tool is installed.
prefix="${prefix:-@prefix@}"
PARALLEL=@PARALLEL@ # Am I in parallel mode?
@ -35,7 +39,7 @@ H5TOOL_BIN="${prefix}/bin/${H5TOOL}" # The path of the tool binary
CMP='cmp -s'
DIFF='diff -c'
nerrors=0
nerrors=$EXIT_SUCCESS
verbose=yes
# setup my machine information.
@ -217,7 +221,9 @@ if test -z "$HDF5_NOCLEANUP"; then
fi
if test $nerrors -eq 0 ; then
echo "All $H5TOOL tests passed."
echo "All $TESTNAME tests passed."
exit $EXIT_SUCCESS
else
echo "$TESTNAME tests failed with $nerrors errors."
exit $EXIT_FAILURE
fi
exit $nerrors

View File

@ -36,6 +36,10 @@ HL="@HL@"
## ##
############################################################################
# Constants definitions
EXIT_SUCCESS=0
EXIT_FAILURE=1
host_os="@host_os@"
prog_name="`basename $0`"
@ -89,7 +93,7 @@ usage() {
echo " HDF5_FC - use a different Fortran 90 or 95 compiler"
echo " HDF5_FLINKER - use a different linker"
echo " "
exit 1
exit $EXIT_FAILURE
}
# Show the configuration summary of the library recorded in the
@ -101,7 +105,7 @@ showconfigure()
}
# Main
status=0
status=$EXIT_SUCCESS
if test "$#" = "0"; then
# No parameters specified, issue usage statement and exit.

View File

@ -38,6 +38,10 @@ HL="@HL@"
## ##
############################################################################
# Constants definitions
EXIT_SUCCESS=0
EXIT_FAILURE=1
host_os="@host_os@"
prog_name="`basename $0`"
@ -95,7 +99,7 @@ usage() {
echo " HDF5_USE_SHLIB=[yes|no] - use shared or static version of the HDF5 library"
echo " [default: no]"
echo " "
exit 1
exit $EXIT_FAILURE
}
# Show the configuration summary of the library recorded in the
@ -107,7 +111,7 @@ showconfigure()
}
# Main
status=0
status=$EXIT_SUCCESS
if test "$#" = "0"; then
# No parameters specified, issue usage statement and exit.

View File

@ -18,6 +18,10 @@
## in a new location.
## For help page, use "h5redeploy -help"
# Constants definitions
EXIT_SUCCESS=0
EXIT_FAILURE=1
# Function definitions
# show help page
@ -34,7 +38,7 @@ usage() {
echo " directory and writable. [default: $h5tools]"
echo " -show Show the commands without executing them"
echo " "
exit 1
exit $EXIT_FAILURE
}
# display variable values
@ -96,7 +100,7 @@ for arg in $@ ; do
*)
ERROR "Unknown Option($arg)"
usage
exit 1
exit $EXIT_FAILURE
;;
esac
done
@ -104,7 +108,7 @@ done
# Sanity checks
if [ ! -d $prefix ]; then
ERROR "prefix($prefix) is not an existing directory"
exit 1
exit $EXIT_FAILURE
fi
for x in $h5tools; do
@ -112,14 +116,14 @@ for x in $h5tools; do
foundtools="$foundtools $x"
if [ ! -w $x ]; then
ERROR "h5tool($x) is not writable"
exit 1
exit $EXIT_FAILURE
fi
fi
done
if [ -z "$foundtools" ]; then
ERROR "found no tools to modify"
exit 1
exit $EXIT_FAILURE
fi
# Show actions to be taken and get consent
@ -131,7 +135,7 @@ if [ x-$fmode = x- ]; then
ans=`echo $ansx | tr "[A-Z]" "[a-z]"`
if [ x-$ans != x-yes ]; then
echo ABORT. No tools changed.
exit 1
exit $EXIT_FAILURE
fi
fi
@ -166,7 +170,7 @@ done
# Cleanup
rm -f $CMDFILE
exit 0
exit $EXIT_SUCCESS
# Some possible future features to add
# CCBASE - Name of the alternative C compiler

View File

@ -238,7 +238,7 @@ main (int argc, char *argv[])
} else if (!strcmp(argv[argno], "-V")) {
printf("This is %s version %u.%u release %u\n",
prog_name, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE);
exit(0);
exit(EXIT_SUCCESS);
} else if (!strcmp (argv[argno], "-family_to_sec2")) {
family_to_sec2 = TRUE;
argno++;