aboutsummaryrefslogtreecommitdiffstats
path: root/tests/01_add
diff options
context:
space:
mode:
authorAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-10-07 16:20:40 +0300
committerAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-10-07 16:20:40 +0300
commit5abff8c6661fd09180b0ec93cf4516d9993a1488 (patch)
tree2825b7d8e470d2d00ff7886b2d1731cec3a09942 /tests/01_add
parentd202883e6d642ba5a973996654cfed674420da22 (diff)
downloadck-5abff8c6661fd09180b0ec93cf4516d9993a1488.tar.gz
ck-5abff8c6661fd09180b0ec93cf4516d9993a1488.tar.bz2
ck-5abff8c6661fd09180b0ec93cf4516d9993a1488.zip
Add error function to reg tests and clean some clutter
Diffstat (limited to 'tests/01_add')
-rw-r--r--tests/01_add15
1 files changed, 5 insertions, 10 deletions
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
}