use different exit codes for ayn failure

This commit is contained in:
George Danchev 2011-06-26 21:06:32 +00:00
parent 44f6e831dc
commit 3dc6d83db7
2 changed files with 43 additions and 42 deletions

View File

@ -17,6 +17,7 @@ http://www.gnu.org/software/xorriso/
+ well documented configuration file test.conf{.template}
+ throw FAIL string to stdout if any failure is detected
+ exit code 0 on success, non-zero on failure
+ use different exit codes for any failure (10, 20, ... 100)
* TESTS LIST

View File

@ -32,14 +32,14 @@ HLP
}
# help
if [ ! "${1}" -o "${1}" == "-help" ]; then print_help && exit 0; fi
if [ ! "${1}" -o "${1}" == "-help" ]; then print_help && exit 10; fi
# config file
if [ "${1}" == "-rc" ]; then
if [ -e ${CONFFILE} ]; then
. ${CONFFILE}
printf "$0: Using config file %s\n" ${CONFFILE}
else
echo -e "\n$0: Config file ${CONFFILE} not found.\n" && exit 1
echo -e "\n$0: Config file ${CONFFILE} not found.\n" && exit 20
fi
if [ "${2}" == "-clean" ]; then CLEAN=1; fi
# command line args
@ -54,17 +54,17 @@ elif [ "${3}" ]; then
fi
# the rest
else
print_help && exit 0
print_help && exit 30
fi
if [ "${XOR}" == "" -o "${DIR}" == "" -o "${IMG}" == "" ]; then
echo -e "\n$0: xorriso_cmd IN_dir and OUT_image are required\n"
exit 1
exit 40
fi
if [ ! -x "${XOR}" ]; then
printf "$0: Not found or not an executable: $XOR\n"
exit 1
exit 50
fi
# all must be set at this point
@ -94,7 +94,7 @@ if which jigdo-gen-md5-list >/dev/null 2>&1; then
else
printf "\n$0: Not found: jigdo-gen-md5-list. Install jigit."
printf "\n$0: See http://www.einval.com/~steve/software/JTE/\n"
exit 1
exit 60
fi
# build the command - general section
@ -149,7 +149,7 @@ if which jigit-mkimage >/dev/null 2>&1; then
else
printf "\n$0: Not found: jigit-mkimage. Install jigit."
printf "\n$0: See http://www.einval.com/~steve/software/JTE/\n"
exit 1
exit 70
fi
# trap the exit code of diff and let the Universe explode
@ -168,7 +168,7 @@ esac
if [ ${CLEAN} -eq 1 ]; then
# safety net, just in case -> we want to be in the starting
# directory before removing whatever self-generated stuff
cd "${START_DIR_DONT_CHANGE}" || exit 1
cd "${START_DIR_DONT_CHANGE}" || exit 80
rm -f ${RES}
printf "$0: removed %s\n" ${RES}
else