minor: test harness: Convert some global failure modes to TAP "Bail out" mode.

This commit is contained in:
Daniel Shahaf 2015-10-23 05:34:01 +00:00
parent 20d106bd4d
commit 663c760cc9
1 changed files with 6 additions and 6 deletions

View File

@ -31,20 +31,20 @@
# Check an highlighter was given as argument.
[[ -n "$1" ]] || {
echo "You must provide the name of a valid highlighter as argument." >&2
exit 1
echo >&2 "Bail out! You must provide the name of a valid highlighter as argument."
exit 2
}
# Check the highlighter is valid.
[[ -f ${0:h:h}/highlighters/$1/$1-highlighter.zsh ]] || {
echo "Could not find highlighter '$1'." >&2
exit 1
echo >&2 "Bail out! Could not find highlighter '$1'."
exit 2
}
# Check the highlighter has test data.
[[ -d ${0:h:h}/highlighters/$1/test-data ]] || {
echo "Highlighter '$1' has no test data." >&2
exit 1
echo >&2 "Bail out! Highlighter '$1' has no test data."
exit 2
}
# Load the main script.