summaryrefslogtreecommitdiff
path: root/futility/tests/common.sh
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2013-03-12 10:53:57 -0700
committerBill Richardson <wfrichar@chromium.org>2013-03-12 10:54:30 -0700
commit56836c50bff6541a2adece667320570d33b1c961 (patch)
tree33a22857fad5a1f2246caf064b3b4eec8867e00f /futility/tests/common.sh
parentdc6ab1e4671c2b03f1a06b4388fdca408674bfe6 (diff)
parentfeb2518166b1cd181e607c611cbb610f0c7300da (diff)
downloadvboot-futility.tar.gz
Sync with ToTfutility
We've now put all the futility stuff into ToT, so we can stop work on this branch. Make sure it matches m/master and just walk away... BUG=none BRANCH=none TEST=none Change-Id: Ic334c70ca43a9edc1ab391e09c10a92a20c6d0c7 Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'futility/tests/common.sh')
-rwxr-xr-xfutility/tests/common.sh21
1 files changed, 11 insertions, 10 deletions
diff --git a/futility/tests/common.sh b/futility/tests/common.sh
index 0105b0cd..ed187d7b 100755
--- a/futility/tests/common.sh
+++ b/futility/tests/common.sh
@@ -11,21 +11,22 @@ COL_BLUE='\E[34;1m'
COL_STOP='\E[0;m'
# args: [message]
-function green {
+green() {
echo -e "${COL_GREEN}$*${COL_STOP}"
}
# args: [message]
-function yellow {
+yellow() {
echo -e "${COL_YELLOW}WARNING: $*${COL_STOP}"
}
-function red {
+# args: [message]
+red() {
echo -e "${COL_RED}$*${COL_STOP}"
}
-# args: [nested level [message]]
-function error {
+# args: [nested level] [message]
+error() {
local lev=${1:-}
case "${1:-}" in
[0-9]*)
@@ -36,11 +37,11 @@ function error {
;;
esac
local x=$(caller $lev)
- local cline=${x%% *}
- local cfunc=${x#* }
- cfunc=${cfunc##*/}
+ local cline="${x%% *}"
+ local cfile="${x#* }"
+ cfile="${cfile##*/}"
local args="$*"
- local spacer=${args:+: }
- red "at ${cfunc}, line ${cline}${spacer}${args}" 1>&2
+ local spacer="${args:+: }"
+ red "at ${cfile}, line ${cline}${spacer}${args}" 1>&2
exit 1
}