telegram-bot-bash/test/ALL-tests.inc.sh

33 lines
716 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2019-04-21 11:45:51 +00:00
#### $$VERSION$$ 0.70-dev-21-gd4cd756
# common variables
export TESTME DIRME TESTDIR LOGFILE REFDIR TESTNAME
TESTME="$(basename "$0")"
DIRME="$(pwd)"
TESTDIR="$1"
LOGFILE="${TESTDIR}/${TESTME}.log"
REFDIR="${TESTME%.sh}"
TESTNAME="${REFDIR//-/ }"
# common filenames
export TOKENFILE ACLFILE COUNTFILE ADMINFILE
TOKENFILE="token"
ACLFILE="botacl"
COUNTFILE="count"
ADMINFILE="botadmin"
# SUCCESS NOSUCCES
export SUCCESS NOSUCCESS
SUCCESS=" OK"
NOSUCCESS=" FAILED!"
echo "Running ${TESTNAME#? } ..."
echo "............................"
[ "${TESTDIR}" = "" ] && echo "${NOSUCCESS} not called from testsuite, exit" && exit 1
# reset env for test
unset IFS; set -f
export TERM=""