forked from g2forge/forklift
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest
More file actions
executable file
·41 lines (35 loc) · 828 Bytes
/
test
File metadata and controls
executable file
·41 lines (35 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -eu -o pipefail
function help () {
echo "$(basename ${0}): Run unit tests for forklift"
echo
echo "Usage: $(basename ${0})"
echo
}
SELF_DIR=$(cd $(dirname ${0}) && pwd -P)
SELF=${SELF_DIR}/$(basename ${0})
. ${SELF_DIR}/builtin/common/source.bash
if [[ $# -eq 1 ]]; then
COMMAND="${1}"
case ${COMMAND} in
-h|--help|help)
help
exit 0
;;
*)
fail "Unrecognized command ${COMMAND}"
;;
esac
elif [[ $# -gt 0 ]]; then
fail "No arguments allowed"
fi
TESTDIRECTORIES=$(find ./ -type d -name "test")
echo "Found tests in:"
for DIRECTORY in ${TESTDIRECTORIES}; do
echo " ${DIRECTORY}"
done
echo
for DIRECTORY in ${TESTDIRECTORIES}; do
echo -e "Executing tests in ${CFMT_CODE}${DIRECTORY}${CFMT_NORMAL}"
./forklift run com.github ${BATS_WAREHOUSE} ${BATS_VERSION} bin/bats ${DIRECTORY}
done