-
Notifications
You must be signed in to change notification settings - Fork 412
/
run-tests.sh
executable file
·55 lines (44 loc) · 967 Bytes
/
run-tests.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# Kill all subshells with ctrl-c
trap "kill 0" SIGINT
reset='\033[0m'
red='\033[0;31m'
green='\033[0;32m'
blue='\033[0;34m'
EXIT=0
SUMMARY="$blue##\n## SUMMARY\n##$reset\n\n"
TOOL=$1
for env in test-environments/*; do
if [[ ! -f $env/test.sh ]]; then
continue
fi
name=$(basename "$env")
if [[ -n $TOOL ]]; then
if [[ $name == bundle* ]]; then
if [[ $TOOL != 'clj' ]]; then
continue
fi
else
if [[ $TOOL != 'lein' ]]; then
continue
fi
fi
fi
echo -e "$blue##"
echo -e "## TESTING $name"
echo -e "##$reset"
echo
$env/test.sh
if [[ $? != "0" ]]; then
echo
echo -e "${red}FAIL $name$reset"
SUMMARY="$SUMMARY${red}FAIL $name$reset\n"
EXIT=1
else
SUMMARY="$SUMMARY${green}OK $name$reset\n"
fi
echo
echo
done
echo -e "$SUMMARY"
exit $EXIT