-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
53 lines (32 loc) · 662 Bytes
/
test.sh
File metadata and controls
53 lines (32 loc) · 662 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
42
43
44
45
46
47
48
49
50
51
52
53
exec 3<> /dev/null
function red {
printf "\e[91m$1\e[0m\n"
}
function green {
printf "\e[32m$1\e[0m\n"
}
if [ "$1" = "--help" ]; then
cat << EOF
/bin/bash $0 --help
/bin/bash $0 --watchAll
EOF
exit 0
fi
set -e
set -x
if [ ! -e node_modules/.bin/promises-aplus-tests ]; then
make ct
yarn
make cp
git checkout yarn.lock
fi
TEST="node node_modules/.bin/promises-aplus-tests test/adapter.js"
{ green "\n\n executing tests:\n $TEST\n\n"; } 2>&3
$TEST
STATUS=$?
if [ "$STATUS" = "0" ]; then
{ green "\n Tests passed\n"; } 2>&3
else
{ red "\n Tests crashed\n"; } 2>&3
exit $STATUS
fi