Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(629)

Unified Diff: tests/common.sh

Issue 5352005: Add 'prioritize' command to cgpt tool. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « firmware/version.c ('k') | tests/run_cgpt_tests.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/common.sh
diff --git a/tests/common.sh b/tests/common.sh
index cd7695f0bd62aae932245ea9e2803301a143a3c2..5145004bc7f977c404b195648a05b337ca424a55 100755
--- a/tests/common.sh
+++ b/tests/common.sh
@@ -27,23 +27,41 @@ COL_BLUE='\E[34;1m'
COL_STOP='\E[0;m'
hash_algos=( sha1 sha256 sha512 )
-key_lengths=( 1024 2048 4096 8192 )
+key_lengths=( 1024 2048 4096 8192 )
function happy {
echo -e "${COL_GREEN}$*${COL_STOP}" 1>&2
}
+# args: [nested level [message]]
function warning {
echo -e "${COL_YELLOW}WARNING: $*${COL_STOP}" 1>&2
}
+# args: [nested level [message]]
function error {
- echo -e "${COL_RED}ERROR: $*${COL_STOP}" 1>&2
+ local lev=${1:-}
+ case "${1:-}" in
+ [0-9]*)
+ lev=$1
+ shift
+ ;;
+ *) lev=0
+ ;;
+ esac
+ local x=$(caller $lev)
+ local cline=${x%% *}
+ local cfunc=${x#* }
+ cfunc=${cfunc##*/}
+ local args="$*"
+ local spacer=${args:+: }
+ echo -e "${COL_RED}ERROR at ${cfunc}, line ${cline}${spacer}${args}" \
+ "${COL_STOP}" 1>&2
exit 1
}
function check_test_keys {
[ -d ${TESTKEY_DIR} ] || \
- error "You must run gen_test_keys.sh to generate test keys first."
+ error 1 "You must run gen_test_keys.sh to generate test keys first."
}
« no previous file with comments | « firmware/version.c ('k') | tests/run_cgpt_tests.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698