-
Notifications
You must be signed in to change notification settings - Fork 5
113 lines (84 loc) · 3.78 KB
/
ci.yml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: CI
on: [push, pull_request]
jobs:
test:
name: ${{ matrix.lisp }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
lisp: [sbcl-bin]
os: [ubuntu-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
- name: Install Roswell
env:
LISP: ${{ matrix.lisp }}
run: |
curl -L https://raw.githubusercontent.com/roswell/roswell/master/scripts/install-for-ci.sh | sh
- name: Run tests
run: roswell/run-fiveam.ros -l ci-utils/test :github-actions-tests :noncoveralls-tests :base-tests
- name: Run-test-forms tests
# specify shell without -e since we want to check non-0 exits manually
shell: bash {0}
run: |
# put test systems where asdf can find them
cp -av t ~/lisp/
fail=0
function check () {
# $1 = actual, $2 = expected
if [ $1 -eq $2 ]
then
echo -e "\033[0;32mGot $1, expected $2: OK\033[0m"
else
(( fail++ ))
echo -e "\033[0;31mGot $1, expected $2: BAD $fail\033[0m"
fi
}
# should fail
roswell/run-test-forms.ros -l ci-utils-test-systems "(ci-utils-test-system:return-nil)"
check $? 1
roswell/run-test-forms.ros -l ci-utils-test-systems "(ci-utils-test-system:return-x nil)"
check $? 1
roswell/run-test-forms.ros -l ci-utils-test-systems "(ci-utils-test-system:return-not-x 123)"
check $? 1
roswell/run-test-forms.ros -l ci-utils-test-systems "(ci-utils-test-system:return-not-x nil)" "(ci-utils-test-system:return-nil)" "(zerop (random 2))"
check $? 1
# should succeed
roswell/run-test-forms.ros -l ci-utils-test-systems "(ci-utils-test-system:return-t)"
check $? 0
roswell/run-test-forms.ros -l ci-utils-test-systems "(ci-utils-test-system:return-x 123)"
check $? 0
roswell/run-test-forms.ros -l ci-utils-test-systems "(ci-utils-test-system:return-not-x nil)"
check $? 0
roswell/run-test-forms.ros -l ci-utils-test-systems "(ci-utils-test-system:return-not-x nil)" "(ci-utils-test-system:return-t)" "(not (minusp (random 10)))"
check $? 0
# should error
roswell/run-test-forms.ros -l ci-utils-test-systems "(:incomplete-form"
check $? 2
roswell/run-test-forms.ros -l ci-utils-test-systems '(error "error1!")'
check $? 2
roswell/run-test-forms.ros -l ci-utils-test-systems "(ci-utils-test-system:return-not-x nil)" "(ci-utils-test-system:return-x 2)" '(error "error2!")' "(zerop (random 2))"
check $? 2
# dependency should error
roswell/run-test-forms.ros -l ci-utils-test-systems/dep-error "(ci-utils-test-system:return-t)"
check $? 3
roswell/run-test-forms.ros -l ci-utils-test-systems/compile-error "(ci-utils-test-system:return-t)"
check $? 3
roswell/run-test-forms.ros -l ci-utils-test-systems/dep-compile-error "(ci-utils-test-system:return-t)"
check $? 3
roswell/run-test-forms.ros -l ci-utils-test-systems/load-error "(ci-utils-test-system:return-t)"
check $? 3
# should succeed?
roswell/run-test-forms.ros -l ci-utils-test-systems/compile-warn "(ci-utils-test-system:return-t)"
check $? 0
roswell/run-test-forms.ros -l ci-utils-test-systems/load-warn "(ci-utils-test-system:return-t)"
check $? 0
echo done...
if [ $fail -eq 0 ]
then
echo -e "\033[0;32m$fail failures\033[0m"
exit 0
else
echo -e "\033[0;31m$fail failures\033[0m"
exit 1
fi