From 5abff8c6661fd09180b0ec93cf4516d9993a1488 Mon Sep 17 00:00:00 2001 From: Anastasis Grammenos Date: Sun, 7 Oct 2018 16:20:40 +0300 Subject: Add error function to reg tests and clean some clutter --- tests/01_add | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'tests/01_add') diff --git a/tests/01_add b/tests/01_add index 15ff2b0..74c9558 100644 --- a/tests/01_add +++ b/tests/01_add @@ -13,19 +13,16 @@ function run_add { wait $! if [ $? -ne 0 ]; then - echo -e $ERROR" ck crashed." - exit 1 + err "ck crashed." fi # check db if [ "$(sqlite3 $BIN/ckdb "select name from program where name = '$1'")" != "$1" ]; then - echo -e $ERROR $1" is not in the db." - exit 1 + err "$1 is not in the db." fi if [ "$(sqlite3 $BIN/ckdb "select path from config where path = '$BIN/$2'")" != "$BIN/$2" ]; then - echo -e $ERROR $2" is not in the db." - exit 1 + err "$2 is not in the db." fi # check files @@ -35,13 +32,11 @@ function run_add { fi if [ ! -f $TEST_LOCATION/$FOLDER/$1/$2 ]; then - echo -e $ERROR$2" No move (add "$3" "$4")" - exit 1 + err "$2 No move (add $3 $4)" fi if [ ! -L $BIN/$2 ]; then - echo -e $ERROR$2" No symlink (add "$3" "$4")" - exit 1 + err "$2 No symlink (add $3 $4)" fi } -- cgit v1.2.3