aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan S. Arnold <ryan.arnold@linaro.org>2013-12-12 11:40:00 -0600
committerRyan S. Arnold <ryan.arnold@linaro.org>2013-12-12 11:40:00 -0600
commitcc7193d8ddb86c4ed7d16086f8ee968ae4bae87f (patch)
tree3ac4182ebcff7fd598d996bb32197902eff426e9
parent99977a2b045be70e41f384332059d86d21dc0c14 (diff)
cbuild2.sh: All error exit paths should use build_failure().
Change-Id: I95c8ebca58049b86fa9d4390bb1cdfd81e74a6f5
-rwxr-xr-xcbuild2.sh20
-rwxr-xr-xtest.sh1
2 files changed, 10 insertions, 11 deletions
diff --git a/cbuild2.sh b/cbuild2.sh
index c334648e..1c88e769 100755
--- a/cbuild2.sh
+++ b/cbuild2.sh
@@ -487,21 +487,19 @@ while test $# -gt 0; do
url="`get_source $2`"
if test $? -gt 0; then
error "Couldn't find the source for $2"
- exit 1
+ build_failure
fi
checkout ${url}
if test $? -gt 0; then
- time="`expr ${SECONDS} / 60`"
- error "Checkout process failed after ${time} minutes"
- exit 1
+ error "--checkout ${url} failed."
+ build_failure
fi
else
checkout_all
if test $? -gt 0; then
- time="`expr ${SECONDS} / 60`"
- error "Checkout process failed after ${time} minutes"
- exit 1
+ error "--checkout all failed."
+ build_failure
fi
fi
shift # Shift off the 'all' or the package identifier.
@@ -580,7 +578,9 @@ while test $# -gt 0; do
check_directive $1 set "set" $2
set_package $2
if test $? -gt 0; then
- exit 1
+ # The failure particular reason is output within the
+ # set_package function.
+ build_failure
fi
shift
;;
@@ -697,7 +697,7 @@ while test $# -gt 0; do
# Only allow valid combinations of target and clibrary.
crosscheck_clibrary_target ${name} ${target}
if test $? -gt 0; then
- exit 1
+ build_failure
fi
# Continue to process individually.
case ${name} in
@@ -722,7 +722,7 @@ while test $# -gt 0; do
esac
else
error "$1: Command not recognized."
- exit 1
+ build_failure
fi
;;
esac
diff --git a/test.sh b/test.sh
index eb05e1bb..c28a2367 100755
--- a/test.sh
+++ b/test.sh
@@ -159,7 +159,6 @@ test_pass()
# Continue to search for error so we don't get false positives.
out="`./cbuild2.sh ${cb_commands} 2>&1 | grep "${match}" | sed -e 's:\(^ERROR\).*\('"${match}"'\).*:\1 \2:'`"
-
cbtest ${testlineno} "${out}" "${match}" "VALID ${cb_commands}"
}