crowdsec/tests/run-tests

28 lines
552 B
Text
Raw Normal View History

#!/usr/bin/env bash
set -eu
die() {
echo >&2 "$@"
exit 1
}
# shellcheck disable=SC1007
TEST_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
# shellcheck source=./.environment.sh
. "${TEST_DIR}/.environment.sh"
"${TEST_DIR}/check-requirements"
if [ $# -ge 1 ]; then
"${TEST_DIR}/lib/bats-core/bin/bats" \
--jobs 1 \
--print-output-on-failure \
-T "$@"
else
"${TEST_DIR}/lib/bats-core/bin/bats" \
--jobs 1 \
--print-output-on-failure \
-T "${TEST_DIR}/bats" "${TEST_DIR}/dyn-bats"
fi