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

Unified Diff: tests/common.sh

Issue 2719008: Nearly complete rewrite of cgpt tool. (Closed) Base URL: ssh://git@chromiumos-git//vboot_reference.git
Patch Set: Created 10 years, 6 months 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 | « tests/cgptlib_test.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 421f6290dee19f0fb997361109da4142ec8ff8a0..6afcd7765a0cd441e2c07b065c98ec6704b654ea 100755
--- a/tests/common.sh
+++ b/tests/common.sh
@@ -30,10 +30,21 @@ COL_STOP='\E[0;m'
hash_algos=( sha1 sha256 sha512 )
key_lengths=( 1024 2048 4096 8192 )
+function happy {
+ echo -e "${COL_GREEN}$*${COL_STOP}" 1>&2
+}
+
+function warning {
+ echo -e "${COL_YELLOW}WARNING: $*${COL_STOP}" 1>&2
+}
+
+function error {
+ echo -e "${COL_RED}ERROR: $*${COL_STOP}" 1>&2
+ exit 1
+}
+
function check_test_keys {
- if [ ! -d ${TESTKEY_DIR} ]
- then
- echo "You must run gen_test_keys.sh to generate test keys first."
- exit 1
- fi
+ [ -d ${TESTKEY_DIR} ] || \
+ error "You must run gen_test_keys.sh to generate test keys first."
}
+
« no previous file with comments | « tests/cgptlib_test.c ('k') | tests/run_cgpt_tests.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698