Blame


1 94a3f4e9 2024-03-30 thomas #!/bin/sh
2 94a3f4e9 2024-03-30 thomas #
3 94a3f4e9 2024-03-30 thomas # Copyright (c) 2024 Omar Polo <op@openbsd.org>
4 94a3f4e9 2024-03-30 thomas #
5 94a3f4e9 2024-03-30 thomas # Permission to use, copy, modify, and distribute this software for any
6 94a3f4e9 2024-03-30 thomas # purpose with or without fee is hereby granted, provided that the above
7 94a3f4e9 2024-03-30 thomas # copyright notice and this permission notice appear in all copies.
8 94a3f4e9 2024-03-30 thomas #
9 94a3f4e9 2024-03-30 thomas # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 94a3f4e9 2024-03-30 thomas # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 94a3f4e9 2024-03-30 thomas # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 94a3f4e9 2024-03-30 thomas # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 94a3f4e9 2024-03-30 thomas # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 94a3f4e9 2024-03-30 thomas # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 94a3f4e9 2024-03-30 thomas # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 94a3f4e9 2024-03-30 thomas
17 94a3f4e9 2024-03-30 thomas . ../cmdline/common.sh
18 94a3f4e9 2024-03-30 thomas . ./common.sh
19 94a3f4e9 2024-03-30 thomas
20 94a3f4e9 2024-03-30 thomas test_file_changed() {
21 94a3f4e9 2024-03-30 thomas local testroot=`test_init file_changed 1`
22 94a3f4e9 2024-03-30 thomas
23 94a3f4e9 2024-03-30 thomas got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
24 94a3f4e9 2024-03-30 thomas ret=$?
25 94a3f4e9 2024-03-30 thomas if [ $ret -ne 0 ]; then
26 94a3f4e9 2024-03-30 thomas echo "got clone failed unexpectedly" >&2
27 94a3f4e9 2024-03-30 thomas test_done "$testroot" 1
28 94a3f4e9 2024-03-30 thomas return 1
29 94a3f4e9 2024-03-30 thomas fi
30 94a3f4e9 2024-03-30 thomas
31 94a3f4e9 2024-03-30 thomas got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
32 94a3f4e9 2024-03-30 thomas ret=$?
33 94a3f4e9 2024-03-30 thomas if [ $ret -ne 0 ]; then
34 94a3f4e9 2024-03-30 thomas echo "got checkout failed unexpectedly" >&2
35 94a3f4e9 2024-03-30 thomas test_done "$testroot" 1
36 94a3f4e9 2024-03-30 thomas return 1
37 94a3f4e9 2024-03-30 thomas fi
38 94a3f4e9 2024-03-30 thomas
39 94a3f4e9 2024-03-30 thomas echo "change alpha" > $testroot/wt/alpha
40 94a3f4e9 2024-03-30 thomas (cd $testroot/wt && got commit -m 'make changes' > /dev/null)
41 94a3f4e9 2024-03-30 thomas local commit_id=`git_show_head $testroot/repo-clone`
42 94a3f4e9 2024-03-30 thomas local author_time=`git_show_author_time $testroot/repo-clone`
43 94a3f4e9 2024-03-30 thomas
44 94a3f4e9 2024-03-30 thomas timeout 5 ./http-server -p $GOTD_TEST_HTTP_PORT \
45 94a3f4e9 2024-03-30 thomas > $testroot/stdout &
46 94a3f4e9 2024-03-30 thomas
47 94a3f4e9 2024-03-30 thomas got send -b main -q -r $testroot/repo-clone
48 94a3f4e9 2024-03-30 thomas ret=$?
49 94a3f4e9 2024-03-30 thomas if [ $ret -ne 0 ]; then
50 94a3f4e9 2024-03-30 thomas echo "got send failed unexpectedly" >&2
51 94a3f4e9 2024-03-30 thomas test_done "$testroot" "1"
52 94a3f4e9 2024-03-30 thomas return 1
53 94a3f4e9 2024-03-30 thomas fi
54 94a3f4e9 2024-03-30 thomas
55 94a3f4e9 2024-03-30 thomas wait %1 # wait for the http "server"
56 94a3f4e9 2024-03-30 thomas
57 94a3f4e9 2024-03-30 thomas d=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
58 94a3f4e9 2024-03-30 thomas
59 0178cac9 2024-03-30 thomas touch "$testroot/stdout.expected"
60 0178cac9 2024-03-30 thomas ed -s "$testroot/stdout.expected" <<-EOF
61 0178cac9 2024-03-30 thomas a
62 0178cac9 2024-03-30 thomas {"notifications":[{
63 71b7e0f5 2024-03-30 thomas "type":"commit",
64 0178cac9 2024-03-30 thomas "short":false,
65 0178cac9 2024-03-30 thomas "id":"$commit_id",
66 9c485a11 2024-03-30 thomas "author":{
67 9c485a11 2024-03-30 thomas "full":"$GOT_AUTHOR",
68 9c485a11 2024-03-30 thomas "name":"$GIT_AUTHOR_NAME",
69 9c485a11 2024-03-30 thomas "mail":"$GIT_AUTHOR_EMAIL",
70 9c485a11 2024-03-30 thomas "user":"$GOT_AUTHOR_11"
71 9c485a11 2024-03-30 thomas },
72 9c485a11 2024-03-30 thomas "committer":{
73 9c485a11 2024-03-30 thomas "full":"$GOT_AUTHOR",
74 9c485a11 2024-03-30 thomas "name":"$GIT_AUTHOR_NAME",
75 9c485a11 2024-03-30 thomas "mail":"$GIT_AUTHOR_EMAIL",
76 9c485a11 2024-03-30 thomas "user":"$GOT_AUTHOR_11"
77 9c485a11 2024-03-30 thomas },
78 0178cac9 2024-03-30 thomas "date":"$d",
79 9c485a11 2024-03-30 thomas "short_message":"make changes",
80 0178cac9 2024-03-30 thomas "message":"make changes\n",
81 9e56e3e7 2024-03-30 thomas "diffstat":{
82 9e56e3e7 2024-03-30 thomas "files":[{
83 9e56e3e7 2024-03-30 thomas "action":"modified",
84 9e56e3e7 2024-03-30 thomas "file":"alpha",
85 9e56e3e7 2024-03-30 thomas "added":1,
86 9e56e3e7 2024-03-30 thomas "removed":1
87 9e56e3e7 2024-03-30 thomas }],
88 9e56e3e7 2024-03-30 thomas "total":{
89 9e56e3e7 2024-03-30 thomas "added":1,
90 9e56e3e7 2024-03-30 thomas "removed":1
91 9e56e3e7 2024-03-30 thomas }
92 9e56e3e7 2024-03-30 thomas }
93 fcfdd0a1 2024-03-30 thomas }]}
94 fcfdd0a1 2024-03-30 thomas .
95 fcfdd0a1 2024-03-30 thomas ,j
96 fcfdd0a1 2024-03-30 thomas w
97 fcfdd0a1 2024-03-30 thomas EOF
98 fcfdd0a1 2024-03-30 thomas
99 fcfdd0a1 2024-03-30 thomas cmp -s $testroot/stdout.expected $testroot/stdout
100 fcfdd0a1 2024-03-30 thomas ret=$?
101 fcfdd0a1 2024-03-30 thomas if [ $ret -ne 0 ]; then
102 fcfdd0a1 2024-03-30 thomas diff -u $testroot/stdout.expected $testroot/stdout
103 fcfdd0a1 2024-03-30 thomas test_done "$testroot" "$ret"
104 fcfdd0a1 2024-03-30 thomas return 1
105 fcfdd0a1 2024-03-30 thomas fi
106 fcfdd0a1 2024-03-30 thomas
107 fcfdd0a1 2024-03-30 thomas test_done "$testroot" "$ret"
108 fcfdd0a1 2024-03-30 thomas }
109 fcfdd0a1 2024-03-30 thomas
110 fcfdd0a1 2024-03-30 thomas test_bad_utf8() {
111 fcfdd0a1 2024-03-30 thomas local testroot=`test_init bad_utf8 1`
112 fcfdd0a1 2024-03-30 thomas
113 fcfdd0a1 2024-03-30 thomas got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
114 fcfdd0a1 2024-03-30 thomas ret=$?
115 fcfdd0a1 2024-03-30 thomas if [ $ret -ne 0 ]; then
116 fcfdd0a1 2024-03-30 thomas echo "got clone failed unexpectedly" >&2
117 fcfdd0a1 2024-03-30 thomas test_done "$testroot" 1
118 fcfdd0a1 2024-03-30 thomas return 1
119 fcfdd0a1 2024-03-30 thomas fi
120 fcfdd0a1 2024-03-30 thomas
121 fcfdd0a1 2024-03-30 thomas got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
122 fcfdd0a1 2024-03-30 thomas ret=$?
123 fcfdd0a1 2024-03-30 thomas if [ $ret -ne 0 ]; then
124 fcfdd0a1 2024-03-30 thomas echo "got checkout failed unexpectedly" >&2
125 fcfdd0a1 2024-03-30 thomas test_done "$testroot" 1
126 fcfdd0a1 2024-03-30 thomas fi
127 fcfdd0a1 2024-03-30 thomas
128 5571f6ee 2024-03-30 thomas # invalid utf8 sequence
129 fcfdd0a1 2024-03-30 thomas commit_msg="make$(printf '\xED\xA0\x80')changes"
130 fcfdd0a1 2024-03-30 thomas
131 fcfdd0a1 2024-03-30 thomas echo "changed" > $testroot/wt/alpha
132 fcfdd0a1 2024-03-30 thomas (cd $testroot/wt && got commit -m "$commit_msg" > /dev/null)
133 fcfdd0a1 2024-03-30 thomas local commit_id=`git_show_head $testroot/repo-clone`
134 fcfdd0a1 2024-03-30 thomas local author_time=`git_show_author_time $testroot/repo-clone`
135 fcfdd0a1 2024-03-30 thomas
136 fcfdd0a1 2024-03-30 thomas timeout 5 ./http-server -p $GOTD_TEST_HTTP_PORT \
137 fcfdd0a1 2024-03-30 thomas > $testroot/stdout &
138 fcfdd0a1 2024-03-30 thomas
139 fcfdd0a1 2024-03-30 thomas got send -b main -q -r $testroot/repo-clone
140 fcfdd0a1 2024-03-30 thomas ret=$?
141 fcfdd0a1 2024-03-30 thomas if [ $ret -ne 0 ]; then
142 fcfdd0a1 2024-03-30 thomas echo "got send failed unexpectedly" >&2
143 fcfdd0a1 2024-03-30 thomas test_done "$testroot" "1"
144 fcfdd0a1 2024-03-30 thomas return 1
145 fcfdd0a1 2024-03-30 thomas fi
146 fcfdd0a1 2024-03-30 thomas
147 fcfdd0a1 2024-03-30 thomas wait %1 # wait for the http "server"
148 fcfdd0a1 2024-03-30 thomas
149 fcfdd0a1 2024-03-30 thomas d=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
150 fcfdd0a1 2024-03-30 thomas
151 fcfdd0a1 2024-03-30 thomas touch "$testroot/stdout.expected"
152 fcfdd0a1 2024-03-30 thomas ed -s "$testroot/stdout.expected" <<-EOF
153 fcfdd0a1 2024-03-30 thomas a
154 fcfdd0a1 2024-03-30 thomas {"notifications":[{
155 71b7e0f5 2024-03-30 thomas "type":"commit",
156 fcfdd0a1 2024-03-30 thomas "short":false,
157 fcfdd0a1 2024-03-30 thomas "id":"$commit_id",
158 9c485a11 2024-03-30 thomas "author":{
159 9c485a11 2024-03-30 thomas "full":"$GOT_AUTHOR",
160 9c485a11 2024-03-30 thomas "name":"$GIT_AUTHOR_NAME",
161 9c485a11 2024-03-30 thomas "mail":"$GIT_AUTHOR_EMAIL",
162 9c485a11 2024-03-30 thomas "user":"$GOT_AUTHOR_11"
163 9c485a11 2024-03-30 thomas },
164 9c485a11 2024-03-30 thomas "committer":{
165 9c485a11 2024-03-30 thomas "full":"$GOT_AUTHOR",
166 9c485a11 2024-03-30 thomas "name":"$GIT_AUTHOR_NAME",
167 9c485a11 2024-03-30 thomas "mail":"$GIT_AUTHOR_EMAIL",
168 9c485a11 2024-03-30 thomas "user":"$GOT_AUTHOR_11"
169 9c485a11 2024-03-30 thomas },
170 fcfdd0a1 2024-03-30 thomas "date":"$d",
171 9c485a11 2024-03-30 thomas "short_message":"make\uFFFD\uFFFDchanges",
172 fcfdd0a1 2024-03-30 thomas "message":"make\uFFFD\uFFFDchanges\n",
173 9e56e3e7 2024-03-30 thomas "diffstat":{
174 9e56e3e7 2024-03-30 thomas "files":[{
175 9e56e3e7 2024-03-30 thomas "action":"modified",
176 9e56e3e7 2024-03-30 thomas "file":"alpha",
177 9e56e3e7 2024-03-30 thomas "added":1,
178 9e56e3e7 2024-03-30 thomas "removed":1
179 9e56e3e7 2024-03-30 thomas }],
180 9e56e3e7 2024-03-30 thomas "total":{
181 9e56e3e7 2024-03-30 thomas "added":1,
182 9e56e3e7 2024-03-30 thomas "removed":1
183 9e56e3e7 2024-03-30 thomas }
184 9e56e3e7 2024-03-30 thomas }
185 0178cac9 2024-03-30 thomas }]}
186 0178cac9 2024-03-30 thomas .
187 0178cac9 2024-03-30 thomas ,j
188 0178cac9 2024-03-30 thomas w
189 94a3f4e9 2024-03-30 thomas EOF
190 94a3f4e9 2024-03-30 thomas
191 94a3f4e9 2024-03-30 thomas cmp -s $testroot/stdout.expected $testroot/stdout
192 94a3f4e9 2024-03-30 thomas ret=$?
193 94a3f4e9 2024-03-30 thomas if [ $ret -ne 0 ]; then
194 94a3f4e9 2024-03-30 thomas diff -u $testroot/stdout.expected $testroot/stdout
195 94a3f4e9 2024-03-30 thomas test_done "$testroot" "$ret"
196 94a3f4e9 2024-03-30 thomas return 1
197 94a3f4e9 2024-03-30 thomas fi
198 94a3f4e9 2024-03-30 thomas
199 94a3f4e9 2024-03-30 thomas test_done "$testroot" "$ret"
200 94a3f4e9 2024-03-30 thomas }
201 94a3f4e9 2024-03-30 thomas
202 94a3f4e9 2024-03-30 thomas test_many_commits_not_summarized() {
203 94a3f4e9 2024-03-30 thomas local testroot=`test_init many_commits_not_summarized 1`
204 94a3f4e9 2024-03-30 thomas
205 94a3f4e9 2024-03-30 thomas got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
206 94a3f4e9 2024-03-30 thomas ret=$?
207 94a3f4e9 2024-03-30 thomas if [ $ret -ne 0 ]; then
208 94a3f4e9 2024-03-30 thomas echo "got clone failed unexpectedly" >&2
209 94a3f4e9 2024-03-30 thomas test_done "$testroot" 1
210 94a3f4e9 2024-03-30 thomas return 1
211 94a3f4e9 2024-03-30 thomas fi
212 94a3f4e9 2024-03-30 thomas
213 94a3f4e9 2024-03-30 thomas got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
214 94a3f4e9 2024-03-30 thomas ret=$?
215 94a3f4e9 2024-03-30 thomas if [ $ret -ne 0 ]; then
216 94a3f4e9 2024-03-30 thomas echo "got checkout failed unexpectedly" >&2
217 94a3f4e9 2024-03-30 thomas test_done "$testroot" 1
218 94a3f4e9 2024-03-30 thomas return 1
219 94a3f4e9 2024-03-30 thomas fi
220 94a3f4e9 2024-03-30 thomas
221 94a3f4e9 2024-03-30 thomas for i in `seq 1 24`; do
222 94a3f4e9 2024-03-30 thomas echo "alpha $i" > $testroot/wt/alpha
223 94a3f4e9 2024-03-30 thomas (cd $testroot/wt && got commit -m 'make changes' > /dev/null)
224 94a3f4e9 2024-03-30 thomas local commit_id=`git_show_head $testroot/repo-clone`
225 94a3f4e9 2024-03-30 thomas local author_time=`git_show_author_time $testroot/repo-clone`
226 94a3f4e9 2024-03-30 thomas d=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
227 94a3f4e9 2024-03-30 thomas set -- "$@" "$commit_id $d"
228 94a3f4e9 2024-03-30 thomas done
229 94a3f4e9 2024-03-30 thomas
230 94a3f4e9 2024-03-30 thomas timeout 5 ./http-server -p "$GOTD_TEST_HTTP_PORT" \
231 94a3f4e9 2024-03-30 thomas > $testroot/stdout &
232 94a3f4e9 2024-03-30 thomas
233 94a3f4e9 2024-03-30 thomas got send -b main -q -r $testroot/repo-clone
234 94a3f4e9 2024-03-30 thomas ret=$?
235 94a3f4e9 2024-03-30 thomas if [ $ret -ne 0 ]; then
236 94a3f4e9 2024-03-30 thomas echo "got send failed unexpectedly" >&2
237 94a3f4e9 2024-03-30 thomas test_done "$testroot" "1"
238 94a3f4e9 2024-03-30 thomas return 1
239 94a3f4e9 2024-03-30 thomas fi
240 94a3f4e9 2024-03-30 thomas
241 94a3f4e9 2024-03-30 thomas wait %1 # wait for the http "server"
242 94a3f4e9 2024-03-30 thomas
243 86901c63 2024-03-30 thomas printf '{"notifications":[' > $testroot/stdout.expected
244 94a3f4e9 2024-03-30 thomas comma=""
245 94a3f4e9 2024-03-30 thomas for i in `seq 1 24`; do
246 94a3f4e9 2024-03-30 thomas s=`pop_idx $i "$@"`
247 94a3f4e9 2024-03-30 thomas commit_id=$(echo $s | cut -d' ' -f1)
248 54b4b049 2024-04-09 thomas commit_time=$(echo "$s" | sed -e "s/^$commit_id //g")
249 0178cac9 2024-03-30 thomas
250 0178cac9 2024-03-30 thomas echo "$comma"
251 0178cac9 2024-03-30 thomas comma=','
252 0178cac9 2024-03-30 thomas
253 0178cac9 2024-03-30 thomas cat <<-EOF
254 0178cac9 2024-03-30 thomas {
255 71b7e0f5 2024-03-30 thomas "type":"commit",
256 0178cac9 2024-03-30 thomas "short":false,
257 0178cac9 2024-03-30 thomas "id":"$commit_id",
258 9c485a11 2024-03-30 thomas "author":{
259 9c485a11 2024-03-30 thomas "full":"$GOT_AUTHOR",
260 9c485a11 2024-03-30 thomas "name":"$GIT_AUTHOR_NAME",
261 9c485a11 2024-03-30 thomas "mail":"$GIT_AUTHOR_EMAIL",
262 9c485a11 2024-03-30 thomas "user":"$GOT_AUTHOR_11"
263 9c485a11 2024-03-30 thomas },
264 9c485a11 2024-03-30 thomas "committer":{
265 9c485a11 2024-03-30 thomas "full":"$GOT_AUTHOR",
266 9c485a11 2024-03-30 thomas "name":"$GIT_AUTHOR_NAME",
267 9c485a11 2024-03-30 thomas "mail":"$GIT_AUTHOR_EMAIL",
268 9c485a11 2024-03-30 thomas "user":"$GOT_AUTHOR_11"
269 9c485a11 2024-03-30 thomas },
270 0178cac9 2024-03-30 thomas "date":"$commit_time",
271 9c485a11 2024-03-30 thomas "short_message":"make changes",
272 0178cac9 2024-03-30 thomas "message":"make changes\n",
273 9e56e3e7 2024-03-30 thomas "diffstat":{
274 9e56e3e7 2024-03-30 thomas "files":[{
275 9e56e3e7 2024-03-30 thomas "action":"modified",
276 9e56e3e7 2024-03-30 thomas "file":"alpha",
277 9e56e3e7 2024-03-30 thomas "added":1,
278 9e56e3e7 2024-03-30 thomas "removed":1
279 9e56e3e7 2024-03-30 thomas }],
280 9e56e3e7 2024-03-30 thomas "total":{
281 9e56e3e7 2024-03-30 thomas "added":1,
282 9e56e3e7 2024-03-30 thomas "removed":1
283 9e56e3e7 2024-03-30 thomas }
284 9e56e3e7 2024-03-30 thomas }
285 0178cac9 2024-03-30 thomas }
286 0178cac9 2024-03-30 thomas EOF
287 94a3f4e9 2024-03-30 thomas done >> $testroot/stdout.expected
288 94a3f4e9 2024-03-30 thomas echo "]}" >> $testroot/stdout.expected
289 0178cac9 2024-03-30 thomas ed -s "$testroot/stdout.expected" <<-EOF
290 0178cac9 2024-03-30 thomas ,j
291 0178cac9 2024-03-30 thomas w
292 0178cac9 2024-03-30 thomas EOF
293 94a3f4e9 2024-03-30 thomas
294 94a3f4e9 2024-03-30 thomas cmp -s $testroot/stdout.expected $testroot/stdout
295 94a3f4e9 2024-03-30 thomas ret=$?
296 94a3f4e9 2024-03-30 thomas if [ $ret -ne 0 ]; then
297 94a3f4e9 2024-03-30 thomas diff -u $testroot/stdout.expected $testroot/stdout
298 94a3f4e9 2024-03-30 thomas test_done "$testroot" "$ret"
299 94a3f4e9 2024-03-30 thomas return 1
300 94a3f4e9 2024-03-30 thomas fi
301 94a3f4e9 2024-03-30 thomas
302 94a3f4e9 2024-03-30 thomas test_done "$testroot" "$ret"
303 94a3f4e9 2024-03-30 thomas }
304 94a3f4e9 2024-03-30 thomas
305 94a3f4e9 2024-03-30 thomas test_many_commits_summarized() {
306 94a3f4e9 2024-03-30 thomas local testroot=`test_init many_commits_summarized 1`
307 94a3f4e9 2024-03-30 thomas
308 94a3f4e9 2024-03-30 thomas got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
309 94a3f4e9 2024-03-30 thomas ret=$?
310 94a3f4e9 2024-03-30 thomas if [ $ret -ne 0 ]; then
311 94a3f4e9 2024-03-30 thomas echo "got clone failed unexpectedly" >&2
312 94a3f4e9 2024-03-30 thomas test_done "$testroot" 1
313 94a3f4e9 2024-03-30 thomas return 1
314 94a3f4e9 2024-03-30 thomas fi
315 94a3f4e9 2024-03-30 thomas
316 94a3f4e9 2024-03-30 thomas got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
317 94a3f4e9 2024-03-30 thomas ret=$?
318 94a3f4e9 2024-03-30 thomas if [ $ret -ne 0 ]; then
319 94a3f4e9 2024-03-30 thomas echo "got checkout failed unexpectedly" >&2
320 94a3f4e9 2024-03-30 thomas test_done "$testroot" 1
321 94a3f4e9 2024-03-30 thomas return 1
322 94a3f4e9 2024-03-30 thomas fi
323 94a3f4e9 2024-03-30 thomas
324 94a3f4e9 2024-03-30 thomas for i in `seq 1 51`; do
325 94a3f4e9 2024-03-30 thomas echo "alpha $i" > $testroot/wt/alpha
326 94a3f4e9 2024-03-30 thomas (cd $testroot/wt && got commit -m 'make changes' > /dev/null)
327 94a3f4e9 2024-03-30 thomas local commit_id=`git_show_head $testroot/repo-clone`
328 94a3f4e9 2024-03-30 thomas local short_commit_id=`trim_obj_id 33 $commit_id`
329 94a3f4e9 2024-03-30 thomas local author_time=`git_show_author_time $testroot/repo-clone`
330 94a3f4e9 2024-03-30 thomas d=`date -u -r $author_time +"%G-%m-%d"`
331 94a3f4e9 2024-03-30 thomas set -- "$@" "$short_commit_id $d"
332 94a3f4e9 2024-03-30 thomas done
333 94a3f4e9 2024-03-30 thomas
334 94a3f4e9 2024-03-30 thomas timeout 5 ./http-server -p "$GOTD_TEST_HTTP_PORT" \
335 94a3f4e9 2024-03-30 thomas > $testroot/stdout &
336 94a3f4e9 2024-03-30 thomas
337 94a3f4e9 2024-03-30 thomas got send -b main -q -r $testroot/repo-clone
338 94a3f4e9 2024-03-30 thomas ret=$?
339 94a3f4e9 2024-03-30 thomas if [ $ret -ne 0 ]; then
340 94a3f4e9 2024-03-30 thomas echo "got send failed unexpectedly" >&2
341 94a3f4e9 2024-03-30 thomas test_done "$testroot" "1"
342 94a3f4e9 2024-03-30 thomas return 1
343 94a3f4e9 2024-03-30 thomas fi
344 94a3f4e9 2024-03-30 thomas
345 94a3f4e9 2024-03-30 thomas wait %1 # wait for the http "server"
346 94a3f4e9 2024-03-30 thomas
347 86901c63 2024-03-30 thomas printf '{"notifications":[' > $testroot/stdout.expected
348 94a3f4e9 2024-03-30 thomas comma=""
349 94a3f4e9 2024-03-30 thomas for i in `seq 1 51`; do
350 94a3f4e9 2024-03-30 thomas s=`pop_idx $i "$@"`
351 94a3f4e9 2024-03-30 thomas commit_id=$(echo $s | cut -d' ' -f1)
352 54b4b049 2024-04-09 thomas commit_time=$(echo "$s" | sed -e "s/^$commit_id //g")
353 0178cac9 2024-03-30 thomas
354 0178cac9 2024-03-30 thomas echo "$comma"
355 0178cac9 2024-03-30 thomas comma=','
356 0178cac9 2024-03-30 thomas
357 0178cac9 2024-03-30 thomas cat <<-EOF
358 0178cac9 2024-03-30 thomas {
359 71b7e0f5 2024-03-30 thomas "type":"commit",
360 0178cac9 2024-03-30 thomas "short":true,
361 0178cac9 2024-03-30 thomas "id":"$commit_id",
362 9c485a11 2024-03-30 thomas "committer":{
363 9c485a11 2024-03-30 thomas "user":"$GOT_AUTHOR_8"
364 9c485a11 2024-03-30 thomas },
365 0178cac9 2024-03-30 thomas "date":"$commit_time",
366 9c485a11 2024-03-30 thomas "short_message":"make changes"
367 0178cac9 2024-03-30 thomas }
368 0178cac9 2024-03-30 thomas EOF
369 94a3f4e9 2024-03-30 thomas done >> $testroot/stdout.expected
370 94a3f4e9 2024-03-30 thomas echo "]}" >> $testroot/stdout.expected
371 444f59b9 2024-03-30 thomas ed -s "$testroot/stdout.expected" <<-EOF
372 444f59b9 2024-03-30 thomas ,j
373 444f59b9 2024-03-30 thomas w
374 444f59b9 2024-03-30 thomas EOF
375 444f59b9 2024-03-30 thomas
376 444f59b9 2024-03-30 thomas cmp -s $testroot/stdout.expected $testroot/stdout
377 444f59b9 2024-03-30 thomas ret=$?
378 444f59b9 2024-03-30 thomas if [ $ret -ne 0 ]; then
379 444f59b9 2024-03-30 thomas diff -u $testroot/stdout.expected $testroot/stdout
380 444f59b9 2024-03-30 thomas test_done "$testroot" "$ret"
381 444f59b9 2024-03-30 thomas return 1
382 444f59b9 2024-03-30 thomas fi
383 444f59b9 2024-03-30 thomas
384 444f59b9 2024-03-30 thomas test_done "$testroot" "$ret"
385 444f59b9 2024-03-30 thomas }
386 444f59b9 2024-03-30 thomas
387 444f59b9 2024-03-30 thomas test_branch_created() {
388 444f59b9 2024-03-30 thomas local testroot=`test_init branch_created 1`
389 444f59b9 2024-03-30 thomas
390 444f59b9 2024-03-30 thomas got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
391 444f59b9 2024-03-30 thomas ret=$?
392 444f59b9 2024-03-30 thomas if [ $ret -ne 0 ]; then
393 444f59b9 2024-03-30 thomas echo "got clone failed unexpectedly" >&2
394 444f59b9 2024-03-30 thomas test_done "$testroot" 1
395 444f59b9 2024-03-30 thomas return 1
396 444f59b9 2024-03-30 thomas fi
397 444f59b9 2024-03-30 thomas
398 444f59b9 2024-03-30 thomas got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
399 444f59b9 2024-03-30 thomas ret=$?
400 444f59b9 2024-03-30 thomas if [ $ret -ne 0 ]; then
401 444f59b9 2024-03-30 thomas echo "got checkout failed unexpectedly" >&2
402 444f59b9 2024-03-30 thomas test_done "$testroot" 1
403 444f59b9 2024-03-30 thomas return 1
404 444f59b9 2024-03-30 thomas fi
405 444f59b9 2024-03-30 thomas
406 444f59b9 2024-03-30 thomas (cd $testroot/wt && got branch newbranch > /dev/null)
407 444f59b9 2024-03-30 thomas
408 444f59b9 2024-03-30 thomas echo "change alpha on branch" > $testroot/wt/alpha
409 444f59b9 2024-03-30 thomas (cd $testroot/wt && got commit -m 'newbranch' > /dev/null)
410 444f59b9 2024-03-30 thomas local commit_id=`git_show_branch_head $testroot/repo-clone newbranch`
411 444f59b9 2024-03-30 thomas local author_time=`git_show_author_time $testroot/repo-clone $commit_id`
412 444f59b9 2024-03-30 thomas
413 444f59b9 2024-03-30 thomas timeout 5 ./http-server -p "$GOTD_TEST_HTTP_PORT" \
414 444f59b9 2024-03-30 thomas > $testroot/stdout &
415 444f59b9 2024-03-30 thomas
416 444f59b9 2024-03-30 thomas got send -b newbranch -q -r $testroot/repo-clone
417 444f59b9 2024-03-30 thomas ret=$?
418 444f59b9 2024-03-30 thomas if [ $ret -ne 0 ]; then
419 444f59b9 2024-03-30 thomas echo "got send failed unexpectedly" >&2
420 444f59b9 2024-03-30 thomas test_done "$testroot" "1"
421 444f59b9 2024-03-30 thomas return 1
422 444f59b9 2024-03-30 thomas fi
423 444f59b9 2024-03-30 thomas
424 444f59b9 2024-03-30 thomas wait %1 # wait for the http "server"
425 444f59b9 2024-03-30 thomas
426 444f59b9 2024-03-30 thomas d=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
427 444f59b9 2024-03-30 thomas
428 444f59b9 2024-03-30 thomas # in the future it should contain something like this too
429 444f59b9 2024-03-30 thomas # {
430 444f59b9 2024-03-30 thomas # "type":"new-branch",
431 444f59b9 2024-03-30 thomas # "user":"${GOTD_DEVUSER}",
432 444f59b9 2024-03-30 thomas # "ref":"refs/heads/newbranch"
433 444f59b9 2024-03-30 thomas # },
434 444f59b9 2024-03-30 thomas
435 444f59b9 2024-03-30 thomas touch "$testroot/stdout.expected"
436 0178cac9 2024-03-30 thomas ed -s "$testroot/stdout.expected" <<-EOF
437 444f59b9 2024-03-30 thomas a
438 444f59b9 2024-03-30 thomas {"notifications":[
439 444f59b9 2024-03-30 thomas {
440 444f59b9 2024-03-30 thomas "type":"commit",
441 444f59b9 2024-03-30 thomas "short":false,
442 444f59b9 2024-03-30 thomas "id":"$commit_id",
443 444f59b9 2024-03-30 thomas "author":{
444 444f59b9 2024-03-30 thomas "full":"$GOT_AUTHOR",
445 444f59b9 2024-03-30 thomas "name":"$GIT_AUTHOR_NAME",
446 444f59b9 2024-03-30 thomas "mail":"$GIT_AUTHOR_EMAIL",
447 444f59b9 2024-03-30 thomas "user":"$GOT_AUTHOR_11"
448 444f59b9 2024-03-30 thomas },
449 444f59b9 2024-03-30 thomas "committer":{
450 444f59b9 2024-03-30 thomas "full":"$GOT_AUTHOR",
451 444f59b9 2024-03-30 thomas "name":"$GIT_AUTHOR_NAME",
452 444f59b9 2024-03-30 thomas "mail":"$GIT_AUTHOR_EMAIL",
453 444f59b9 2024-03-30 thomas "user":"$GOT_AUTHOR_11"
454 444f59b9 2024-03-30 thomas },
455 444f59b9 2024-03-30 thomas "date":"$d",
456 444f59b9 2024-03-30 thomas "short_message":"newbranch",
457 444f59b9 2024-03-30 thomas "message":"newbranch\n",
458 9e56e3e7 2024-03-30 thomas "diffstat":{
459 9e56e3e7 2024-03-30 thomas "files":[{
460 9e56e3e7 2024-03-30 thomas "action":"modified",
461 9e56e3e7 2024-03-30 thomas "file":"alpha",
462 9e56e3e7 2024-03-30 thomas "added":1,
463 9e56e3e7 2024-03-30 thomas "removed":1
464 9e56e3e7 2024-03-30 thomas }],
465 9e56e3e7 2024-03-30 thomas "total":{
466 9e56e3e7 2024-03-30 thomas "added":1,
467 9e56e3e7 2024-03-30 thomas "removed":1
468 9e56e3e7 2024-03-30 thomas }
469 9e56e3e7 2024-03-30 thomas }
470 444f59b9 2024-03-30 thomas }
471 444f59b9 2024-03-30 thomas ]}
472 444f59b9 2024-03-30 thomas .
473 0178cac9 2024-03-30 thomas ,j
474 0178cac9 2024-03-30 thomas w
475 0178cac9 2024-03-30 thomas EOF
476 94a3f4e9 2024-03-30 thomas
477 94a3f4e9 2024-03-30 thomas cmp -s $testroot/stdout.expected $testroot/stdout
478 94a3f4e9 2024-03-30 thomas ret=$?
479 94a3f4e9 2024-03-30 thomas if [ $ret -ne 0 ]; then
480 94a3f4e9 2024-03-30 thomas diff -u $testroot/stdout.expected $testroot/stdout
481 94a3f4e9 2024-03-30 thomas test_done "$testroot" "$ret"
482 94a3f4e9 2024-03-30 thomas return 1
483 94a3f4e9 2024-03-30 thomas fi
484 94a3f4e9 2024-03-30 thomas
485 94a3f4e9 2024-03-30 thomas test_done "$testroot" "$ret"
486 94a3f4e9 2024-03-30 thomas }
487 4808d170 2024-03-30 thomas
488 4808d170 2024-03-30 thomas test_branch_removed() {
489 4808d170 2024-03-30 thomas local testroot=`test_init branch_removed 1`
490 4808d170 2024-03-30 thomas
491 4808d170 2024-03-30 thomas got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
492 4808d170 2024-03-30 thomas ret=$?
493 4808d170 2024-03-30 thomas if [ $ret -ne 0 ]; then
494 4808d170 2024-03-30 thomas echo "got clone failed unexpectedly" >&2
495 4808d170 2024-03-30 thomas test_done "$testroot" 1
496 4808d170 2024-03-30 thomas return 1
497 4808d170 2024-03-30 thomas fi
498 94a3f4e9 2024-03-30 thomas
499 4808d170 2024-03-30 thomas timeout 5 ./http-server -p "$GOTD_TEST_HTTP_PORT" \
500 4808d170 2024-03-30 thomas > $testroot/stdout &
501 4808d170 2024-03-30 thomas
502 4808d170 2024-03-30 thomas local commit_id=`git_show_branch_head $testroot/repo-clone newbranch`
503 4808d170 2024-03-30 thomas
504 4808d170 2024-03-30 thomas got send -d newbranch -q -r $testroot/repo-clone
505 4808d170 2024-03-30 thomas ret=$?
506 4808d170 2024-03-30 thomas if [ $ret -ne 0 ]; then
507 4808d170 2024-03-30 thomas echo "got send failed unexpectedly" >&2
508 4808d170 2024-03-30 thomas test_done "$testroot" "1"
509 4808d170 2024-03-30 thomas return 1
510 4808d170 2024-03-30 thomas fi
511 4808d170 2024-03-30 thomas
512 4808d170 2024-03-30 thomas wait %1 # wait for the http "server"
513 4808d170 2024-03-30 thomas
514 4808d170 2024-03-30 thomas touch "$testroot/stdout.expected"
515 4808d170 2024-03-30 thomas ed -s "$testroot/stdout.expected" <<-EOF
516 4808d170 2024-03-30 thomas a
517 4808d170 2024-03-30 thomas {"notifications":[{
518 4808d170 2024-03-30 thomas "type":"branch-deleted",
519 4808d170 2024-03-30 thomas "ref":"refs/heads/newbranch",
520 4808d170 2024-03-30 thomas "id":"$commit_id"
521 e0d15dee 2024-03-30 thomas }]}
522 e0d15dee 2024-03-30 thomas .
523 e0d15dee 2024-03-30 thomas ,j
524 e0d15dee 2024-03-30 thomas w
525 e0d15dee 2024-03-30 thomas EOF
526 e0d15dee 2024-03-30 thomas
527 e0d15dee 2024-03-30 thomas cmp -s $testroot/stdout.expected $testroot/stdout
528 e0d15dee 2024-03-30 thomas ret=$?
529 e0d15dee 2024-03-30 thomas if [ $ret -ne 0 ]; then
530 e0d15dee 2024-03-30 thomas diff -u $testroot/stdout.expected $testroot/stdout
531 e0d15dee 2024-03-30 thomas test_done "$testroot" "$ret"
532 e0d15dee 2024-03-30 thomas return 1
533 e0d15dee 2024-03-30 thomas fi
534 e0d15dee 2024-03-30 thomas
535 e0d15dee 2024-03-30 thomas test_done "$testroot" "$ret"
536 e0d15dee 2024-03-30 thomas }
537 e0d15dee 2024-03-30 thomas
538 e0d15dee 2024-03-30 thomas test_tag_created() {
539 e0d15dee 2024-03-30 thomas local testroot=`test_init tag_created 1`
540 e0d15dee 2024-03-30 thomas
541 e0d15dee 2024-03-30 thomas got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
542 e0d15dee 2024-03-30 thomas ret=$?
543 e0d15dee 2024-03-30 thomas if [ $ret -ne 0 ]; then
544 e0d15dee 2024-03-30 thomas echo "got clone failed unexpectedly" >&2
545 e0d15dee 2024-03-30 thomas test_done "$testroot" 1
546 e0d15dee 2024-03-30 thomas return 1
547 e0d15dee 2024-03-30 thomas fi
548 e0d15dee 2024-03-30 thomas
549 e0d15dee 2024-03-30 thomas got tag -r $testroot/repo-clone -m "new tag" 1.0 > /dev/null
550 e0d15dee 2024-03-30 thomas local commit_id=`git_show_head $testroot/repo-clone`
551 e0d15dee 2024-03-30 thomas local tagger_time=`git_show_tagger_time $testroot/repo-clone 1.0`
552 e0d15dee 2024-03-30 thomas
553 e0d15dee 2024-03-30 thomas timeout 5 ./http-server -p "$GOTD_TEST_HTTP_PORT" \
554 e0d15dee 2024-03-30 thomas >$testroot/stdout &
555 e0d15dee 2024-03-30 thomas
556 e0d15dee 2024-03-30 thomas got send -t 1.0 -q -r $testroot/repo-clone
557 e0d15dee 2024-03-30 thomas ret=$?
558 e0d15dee 2024-03-30 thomas if [ $ret -ne 0 ]; then
559 e0d15dee 2024-03-30 thomas echo "got send failed unexpectedly" >&2
560 e0d15dee 2024-03-30 thomas test_done "$testroot" "1"
561 e0d15dee 2024-03-30 thomas return 1
562 e0d15dee 2024-03-30 thomas fi
563 e0d15dee 2024-03-30 thomas
564 e0d15dee 2024-03-30 thomas wait %1 # wait for the http "server"
565 e0d15dee 2024-03-30 thomas
566 e0d15dee 2024-03-30 thomas d=`date -u -r $tagger_time +"%a %b %e %X %Y UTC"`
567 e0d15dee 2024-03-30 thomas
568 e0d15dee 2024-03-30 thomas touch "$testroot/stdout.expected"
569 e0d15dee 2024-03-30 thomas ed -s "$testroot/stdout.expected" <<-EOF
570 e0d15dee 2024-03-30 thomas a
571 e0d15dee 2024-03-30 thomas {"notifications":[{
572 e0d15dee 2024-03-30 thomas "type":"tag",
573 e0d15dee 2024-03-30 thomas "tag":"refs/tags/1.0",
574 e0d15dee 2024-03-30 thomas "tagger":{
575 e0d15dee 2024-03-30 thomas "full":"$GOT_AUTHOR",
576 e0d15dee 2024-03-30 thomas "name":"$GIT_AUTHOR_NAME",
577 e0d15dee 2024-03-30 thomas "mail":"$GIT_AUTHOR_EMAIL",
578 e0d15dee 2024-03-30 thomas "user":"$GOT_AUTHOR_11"
579 e0d15dee 2024-03-30 thomas },
580 e0d15dee 2024-03-30 thomas "date":"$d",
581 e0d15dee 2024-03-30 thomas "object":{
582 e0d15dee 2024-03-30 thomas "type":"commit",
583 e0d15dee 2024-03-30 thomas "id":"$commit_id"
584 e0d15dee 2024-03-30 thomas },
585 e0d15dee 2024-03-30 thomas "message":"new tag\n\n"
586 4808d170 2024-03-30 thomas }]}
587 4808d170 2024-03-30 thomas .
588 4808d170 2024-03-30 thomas ,j
589 4808d170 2024-03-30 thomas w
590 4808d170 2024-03-30 thomas EOF
591 4808d170 2024-03-30 thomas
592 4808d170 2024-03-30 thomas cmp -s $testroot/stdout.expected $testroot/stdout
593 4808d170 2024-03-30 thomas ret=$?
594 4808d170 2024-03-30 thomas if [ $ret -ne 0 ]; then
595 4808d170 2024-03-30 thomas diff -u $testroot/stdout.expected $testroot/stdout
596 4808d170 2024-03-30 thomas test_done "$testroot" "$ret"
597 4808d170 2024-03-30 thomas return 1
598 4808d170 2024-03-30 thomas fi
599 4808d170 2024-03-30 thomas
600 4808d170 2024-03-30 thomas test_done "$testroot" "$ret"
601 4808d170 2024-03-30 thomas }
602 407d84f1 2024-03-30 thomas
603 407d84f1 2024-03-30 thomas test_tag_changed() {
604 407d84f1 2024-03-30 thomas local testroot=`test_init tag_changed 1`
605 407d84f1 2024-03-30 thomas
606 407d84f1 2024-03-30 thomas got clone -a -q ${GOTD_TEST_REPO_URL} $testroot/repo-clone
607 407d84f1 2024-03-30 thomas ret=$?
608 407d84f1 2024-03-30 thomas if [ $ret -ne 0 ]; then
609 407d84f1 2024-03-30 thomas echo "got clone failed unexpectedly" >&2
610 407d84f1 2024-03-30 thomas test_done "$testroot" 1
611 407d84f1 2024-03-30 thomas return 1
612 407d84f1 2024-03-30 thomas fi
613 407d84f1 2024-03-30 thomas
614 407d84f1 2024-03-30 thomas got checkout -q $testroot/repo-clone $testroot/wt >/dev/null
615 407d84f1 2024-03-30 thomas ret=$?
616 407d84f1 2024-03-30 thomas if [ $ret -ne 0 ]; then
617 407d84f1 2024-03-30 thomas echo "got checkout failed unexpectedly" >&2
618 407d84f1 2024-03-30 thomas test_done "$testroot" 1
619 407d84f1 2024-03-30 thomas return 1
620 407d84f1 2024-03-30 thomas fi
621 407d84f1 2024-03-30 thomas
622 407d84f1 2024-03-30 thomas echo "change alpha" > $testroot/wt/alpha
623 407d84f1 2024-03-30 thomas (cd $testroot/wt && got commit -m 'make changes' > /dev/null)
624 407d84f1 2024-03-30 thomas local commit_id=`git_show_head $testroot/repo-clone`
625 4808d170 2024-03-30 thomas
626 407d84f1 2024-03-30 thomas got ref -r $testroot/repo-clone -d refs/tags/1.0 >/dev/null
627 407d84f1 2024-03-30 thomas got tag -r $testroot/repo-clone -m "new tag" 1.0 > /dev/null
628 407d84f1 2024-03-30 thomas local tagger_time=`git_show_tagger_time $testroot/repo-clone 1.0`
629 407d84f1 2024-03-30 thomas
630 407d84f1 2024-03-30 thomas timeout 5 ./http-server -p "$GOTD_TEST_HTTP_PORT" \
631 407d84f1 2024-03-30 thomas > $testroot/stdout &
632 407d84f1 2024-03-30 thomas
633 407d84f1 2024-03-30 thomas got send -f -t 1.0 -q -r $testroot/repo-clone
634 407d84f1 2024-03-30 thomas ret=$?
635 407d84f1 2024-03-30 thomas if [ $ret -ne 0 ]; then
636 407d84f1 2024-03-30 thomas echo "got send failed unexpectedly" >&2
637 407d84f1 2024-03-30 thomas test_done "$testroot" "1"
638 407d84f1 2024-03-30 thomas return 1
639 407d84f1 2024-03-30 thomas fi
640 407d84f1 2024-03-30 thomas
641 407d84f1 2024-03-30 thomas wait %1 # wait for the http "server"
642 407d84f1 2024-03-30 thomas
643 407d84f1 2024-03-30 thomas d=`date -u -r $tagger_time +"%a %b %e %X %Y UTC"`
644 407d84f1 2024-03-30 thomas
645 407d84f1 2024-03-30 thomas # XXX: at the moment this is exactly the same as the "new tag"
646 407d84f1 2024-03-30 thomas # notification
647 407d84f1 2024-03-30 thomas
648 407d84f1 2024-03-30 thomas touch "$testroot/stdout.expected"
649 407d84f1 2024-03-30 thomas ed -s "$testroot/stdout.expected" <<-EOF
650 407d84f1 2024-03-30 thomas a
651 407d84f1 2024-03-30 thomas {"notifications":[{
652 407d84f1 2024-03-30 thomas "type":"tag",
653 407d84f1 2024-03-30 thomas "tag":"refs/tags/1.0",
654 407d84f1 2024-03-30 thomas "tagger":{
655 407d84f1 2024-03-30 thomas "full":"$GOT_AUTHOR",
656 407d84f1 2024-03-30 thomas "name":"$GIT_AUTHOR_NAME",
657 407d84f1 2024-03-30 thomas "mail":"$GIT_AUTHOR_EMAIL",
658 407d84f1 2024-03-30 thomas "user":"$GOT_AUTHOR_11"
659 407d84f1 2024-03-30 thomas },
660 407d84f1 2024-03-30 thomas "date":"$d",
661 407d84f1 2024-03-30 thomas "object":{
662 407d84f1 2024-03-30 thomas "type":"commit",
663 407d84f1 2024-03-30 thomas "id":"$commit_id"
664 407d84f1 2024-03-30 thomas },
665 407d84f1 2024-03-30 thomas "message":"new tag\n\n"
666 407d84f1 2024-03-30 thomas }]}
667 407d84f1 2024-03-30 thomas .
668 407d84f1 2024-03-30 thomas ,j
669 407d84f1 2024-03-30 thomas w
670 407d84f1 2024-03-30 thomas EOF
671 407d84f1 2024-03-30 thomas
672 407d84f1 2024-03-30 thomas cmp -s $testroot/stdout.expected $testroot/stdout
673 407d84f1 2024-03-30 thomas ret=$?
674 407d84f1 2024-03-30 thomas if [ $ret -ne 0 ]; then
675 407d84f1 2024-03-30 thomas diff -u $testroot/stdout.expected $testroot/stdout
676 407d84f1 2024-03-30 thomas test_done "$testroot" "$ret"
677 407d84f1 2024-03-30 thomas return 1
678 407d84f1 2024-03-30 thomas fi
679 407d84f1 2024-03-30 thomas
680 407d84f1 2024-03-30 thomas test_done "$testroot" "$ret"
681 407d84f1 2024-03-30 thomas }
682 407d84f1 2024-03-30 thomas
683 94a3f4e9 2024-03-30 thomas test_parseargs "$@"
684 94a3f4e9 2024-03-30 thomas run_test test_file_changed
685 fcfdd0a1 2024-03-30 thomas run_test test_bad_utf8
686 94a3f4e9 2024-03-30 thomas run_test test_many_commits_not_summarized
687 94a3f4e9 2024-03-30 thomas run_test test_many_commits_summarized
688 444f59b9 2024-03-30 thomas run_test test_branch_created
689 4808d170 2024-03-30 thomas run_test test_branch_removed
690 e0d15dee 2024-03-30 thomas run_test test_tag_created
691 407d84f1 2024-03-30 thomas run_test test_tag_changed