3 35dc4510 2019-02-04 stsp # Copyright (c) 2019 Stefan Sperling <stsp@openbsd.org>
5 35dc4510 2019-02-04 stsp # Permission to use, copy, modify, and distribute this software for any
6 35dc4510 2019-02-04 stsp # purpose with or without fee is hereby granted, provided that the above
7 35dc4510 2019-02-04 stsp # copyright notice and this permission notice appear in all copies.
9 35dc4510 2019-02-04 stsp # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 35dc4510 2019-02-04 stsp # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 35dc4510 2019-02-04 stsp # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 35dc4510 2019-02-04 stsp # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 35dc4510 2019-02-04 stsp # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 35dc4510 2019-02-04 stsp # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 35dc4510 2019-02-04 stsp # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 35dc4510 2019-02-04 stsp . ./common.sh
19 f6cae3ed 2020-09-13 naddy test_status_basic() {
20 35dc4510 2019-02-04 stsp local testroot=`test_init status_basic`
22 35dc4510 2019-02-04 stsp got checkout $testroot/repo $testroot/wt > /dev/null
24 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
25 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
29 35dc4510 2019-02-04 stsp echo "modified alpha" > $testroot/wt/alpha
30 2ec1f75b 2019-03-26 stsp (cd $testroot/wt && got rm beta >/dev/null)
31 35dc4510 2019-02-04 stsp echo "unversioned file" > $testroot/wt/foo
32 35dc4510 2019-02-04 stsp rm $testroot/wt/epsilon/zeta
33 14e5d4dc 2019-02-05 stsp touch $testroot/wt/beta
34 d00136be 2019-03-26 stsp echo "new file" > $testroot/wt/new
35 d00136be 2019-03-26 stsp (cd $testroot/wt && got add new >/dev/null)
36 40b289d7 2019-09-07 stsp mkdir -m 0000 $testroot/wt/bar
38 35dc4510 2019-02-04 stsp echo 'M alpha' > $testroot/stdout.expected
39 2ec1f75b 2019-03-26 stsp echo 'D beta' >> $testroot/stdout.expected
40 35dc4510 2019-02-04 stsp echo '! epsilon/zeta' >> $testroot/stdout.expected
41 35dc4510 2019-02-04 stsp echo '? foo' >> $testroot/stdout.expected
42 d00136be 2019-03-26 stsp echo 'A new' >> $testroot/stdout.expected
44 35dc4510 2019-02-04 stsp (cd $testroot/wt && got status > $testroot/stdout)
46 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
48 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
49 35dc4510 2019-02-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
51 40b289d7 2019-09-07 stsp chmod 700 $testroot/wt/bar
52 40b289d7 2019-09-07 stsp rmdir $testroot/wt/bar
53 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
56 f6cae3ed 2020-09-13 naddy test_status_subdir_no_mods() {
57 f02ba292 2019-02-05 stsp local testroot=`test_init status_subdir_no_mods 1`
59 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Basic/
60 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Basic/Targets/
61 f02ba292 2019-02-05 stsp touch $testroot/repo/Basic/Targets/AArch64.cpp
62 f02ba292 2019-02-05 stsp touch $testroot/repo/Basic/Targets.cpp
63 f02ba292 2019-02-05 stsp touch $testroot/repo/Basic/Targets.h
64 f02ba292 2019-02-05 stsp (cd $testroot/repo && git add .)
65 f02ba292 2019-02-05 stsp git_commit $testroot/repo -m "add subdir with files"
67 f02ba292 2019-02-05 stsp got checkout $testroot/repo $testroot/wt > /dev/null
69 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
70 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
74 f02ba292 2019-02-05 stsp touch $testroot/stdout.expected
76 f02ba292 2019-02-05 stsp # This used to erroneously print:
78 f02ba292 2019-02-05 stsp # ! Basic/Targets.cpp
79 f02ba292 2019-02-05 stsp # ? Basic/Targets.cpp
80 f02ba292 2019-02-05 stsp (cd $testroot/wt && got status > $testroot/stdout)
82 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
84 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
85 f02ba292 2019-02-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
87 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
90 f6cae3ed 2020-09-13 naddy test_status_subdir_no_mods2() {
91 f02ba292 2019-02-05 stsp local testroot=`test_init status_subdir_no_mods2 1`
93 f02ba292 2019-02-05 stsp mkdir $testroot/repo/AST
94 f02ba292 2019-02-05 stsp touch $testroot/repo/AST/APValue.cpp
95 f02ba292 2019-02-05 stsp mkdir $testroot/repo/ASTMatchers
96 f02ba292 2019-02-05 stsp touch $testroot/repo/ASTMatchers/ASTMatchFinder.cpp
97 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Frontend
98 f02ba292 2019-02-05 stsp touch $testroot/repo/Frontend/ASTConsumers.cpp
99 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Frontend/Rewrite
100 f02ba292 2019-02-05 stsp touch $testroot/repo/Frontend/Rewrite/CMakeLists.txt
101 f02ba292 2019-02-05 stsp mkdir $testroot/repo/FrontendTool
102 f02ba292 2019-02-05 stsp touch $testroot/repo/FrontendTool/CMakeLists.txt
103 f02ba292 2019-02-05 stsp touch $testroot/repo/FrontendTool/ExecuteCompilerInvocation.cpp
104 f02ba292 2019-02-05 stsp (cd $testroot/repo && git add .)
105 f02ba292 2019-02-05 stsp git_commit $testroot/repo -m "add subdir with files"
107 f02ba292 2019-02-05 stsp got checkout $testroot/repo $testroot/wt > /dev/null
109 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
110 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
114 f02ba292 2019-02-05 stsp touch $testroot/stdout.expected
116 f02ba292 2019-02-05 stsp # This used to erroneously print:
118 f02ba292 2019-02-05 stsp # ! AST/APValue.cpp
119 f02ba292 2019-02-05 stsp # ? AST/APValue.cpp
120 f02ba292 2019-02-05 stsp # ! Frontend/ASTConsumers.cpp
121 f02ba292 2019-02-05 stsp # ! Frontend/Rewrite/CMakeLists.txt
122 f02ba292 2019-02-05 stsp # ? Frontend/ASTConsumers.cpp
123 f02ba292 2019-02-05 stsp # ? Frontend/Rewrite/CMakeLists.txt
124 f02ba292 2019-02-05 stsp (cd $testroot/wt && got status > $testroot/stdout)
126 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
128 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
129 f02ba292 2019-02-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
131 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
134 f6cae3ed 2020-09-13 naddy test_status_obstructed() {
135 0dbc2271 2019-02-05 stsp local testroot=`test_init status_obstructed`
137 0dbc2271 2019-02-05 stsp got checkout $testroot/repo $testroot/wt > /dev/null
139 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
140 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
144 0dbc2271 2019-02-05 stsp rm $testroot/wt/epsilon/zeta
145 0dbc2271 2019-02-05 stsp mkdir $testroot/wt/epsilon/zeta
147 0dbc2271 2019-02-05 stsp echo '~ epsilon/zeta' > $testroot/stdout.expected
149 0dbc2271 2019-02-05 stsp (cd $testroot/wt && got status > $testroot/stdout)
151 a84c0d30 2022-03-12 stsp cmp -s $testroot/stdout.expected $testroot/stdout
153 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
154 a84c0d30 2022-03-12 stsp diff -u $testroot/stdout.expected $testroot/stdout
155 a84c0d30 2022-03-12 stsp test_done "$testroot" "$ret"
159 a84c0d30 2022-03-12 stsp (cd $testroot/wt && got status epsilon/zeta > $testroot/stdout)
161 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
163 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
164 0dbc2271 2019-02-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
166 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
169 f6cae3ed 2020-09-13 naddy test_status_shows_local_mods_after_update() {
170 02c07007 2019-02-10 stsp local testroot=`test_init status_shows_local_mods_after_update 1`
172 02c07007 2019-02-10 stsp echo "1" > $testroot/repo/numbers
173 02c07007 2019-02-10 stsp echo "2" >> $testroot/repo/numbers
174 02c07007 2019-02-10 stsp echo "3" >> $testroot/repo/numbers
175 02c07007 2019-02-10 stsp echo "4" >> $testroot/repo/numbers
176 02c07007 2019-02-10 stsp echo "5" >> $testroot/repo/numbers
177 02c07007 2019-02-10 stsp echo "6" >> $testroot/repo/numbers
178 02c07007 2019-02-10 stsp echo "7" >> $testroot/repo/numbers
179 02c07007 2019-02-10 stsp echo "8" >> $testroot/repo/numbers
180 02c07007 2019-02-10 stsp (cd $testroot/repo && git add numbers)
181 02c07007 2019-02-10 stsp git_commit $testroot/repo -m "added numbers file"
183 02c07007 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
185 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
186 02c07007 2019-02-10 stsp test_done "$testroot" "$ret"
190 02c07007 2019-02-10 stsp sed -i 's/2/22/' $testroot/repo/numbers
191 02c07007 2019-02-10 stsp git_commit $testroot/repo -m "modified line 2"
193 02c07007 2019-02-10 stsp # modify line 7; both changes should merge cleanly
194 02c07007 2019-02-10 stsp sed -i 's/7/77/' $testroot/wt/numbers
196 02c07007 2019-02-10 stsp echo "G numbers" > $testroot/stdout.expected
197 4f3c844b 2021-09-14 stsp echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
198 02c07007 2019-02-10 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
199 02c07007 2019-02-10 stsp echo >> $testroot/stdout.expected
201 02c07007 2019-02-10 stsp (cd $testroot/wt && got update > $testroot/stdout)
203 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
205 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
206 02c07007 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
207 02c07007 2019-02-10 stsp test_done "$testroot" "$ret"
211 02c07007 2019-02-10 stsp echo 'M numbers' > $testroot/stdout.expected
213 02c07007 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
215 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
217 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
218 02c07007 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
220 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
223 f6cae3ed 2020-09-13 naddy test_status_unversioned_subdirs() {
224 18831e78 2019-02-10 stsp local testroot=`test_init status_unversioned_subdirs 1`
226 18831e78 2019-02-10 stsp mkdir $testroot/repo/cdfs/
227 18831e78 2019-02-10 stsp touch $testroot/repo/cdfs/Makefile
228 18831e78 2019-02-10 stsp mkdir $testroot/repo/common/
229 18831e78 2019-02-10 stsp touch $testroot/repo/common/Makefile
230 18831e78 2019-02-10 stsp mkdir $testroot/repo/iso/
231 18831e78 2019-02-10 stsp touch $testroot/repo/iso/Makefile
232 18831e78 2019-02-10 stsp mkdir $testroot/repo/ramdisk/
233 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk/Makefile
234 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk/list.local
235 18831e78 2019-02-10 stsp mkdir $testroot/repo/ramdisk_cd/
236 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk_cd/Makefile
237 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk_cd/list.local
238 18831e78 2019-02-10 stsp (cd $testroot/repo && git add .)
239 18831e78 2019-02-10 stsp git_commit $testroot/repo -m "first commit"
241 18831e78 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
243 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
244 18831e78 2019-02-10 stsp test_done "$testroot" "$ret"
248 18831e78 2019-02-10 stsp mkdir $testroot/wt/cdfs/obj
249 18831e78 2019-02-10 stsp mkdir $testroot/wt/ramdisk/obj
250 18831e78 2019-02-10 stsp mkdir $testroot/wt/ramdisk_cd/obj
251 18831e78 2019-02-10 stsp mkdir $testroot/wt/iso/obj
253 18831e78 2019-02-10 stsp echo -n > $testroot/stdout.expected
255 18831e78 2019-02-10 stsp # This used to erroneously print:
257 18831e78 2019-02-10 stsp # ! ramdisk_cd/Makefile
258 18831e78 2019-02-10 stsp # ! ramdisk_cd/list.local
259 18831e78 2019-02-10 stsp # ? ramdisk_cd/Makefile
260 18831e78 2019-02-10 stsp # ? ramdisk_cd/list.local
261 18831e78 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
263 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
265 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
266 18831e78 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
268 18831e78 2019-02-10 stsp test_done "$testroot" "$ret"
271 f6cae3ed 2020-09-13 naddy test_status_symlink() {
272 00bb5ea0 2020-07-23 stsp local testroot=`test_init status_symlink`
274 2c201a36 2019-02-10 stsp mkdir $testroot/repo/ramdisk/
275 2c201a36 2019-02-10 stsp touch $testroot/repo/ramdisk/Makefile
276 d4ae64fa 2020-07-23 stsp (cd $testroot/repo && ln -s alpha alpha.link)
277 d4ae64fa 2020-07-23 stsp (cd $testroot/repo && ln -s epsilon epsilon.link)
278 d4ae64fa 2020-07-23 stsp (cd $testroot/repo && ln -s nonexistent nonexistent.link)
279 2c201a36 2019-02-10 stsp (cd $testroot/repo && git add .)
280 2c201a36 2019-02-10 stsp git_commit $testroot/repo -m "first commit"
282 2c201a36 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
284 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
285 2c201a36 2019-02-10 stsp test_done "$testroot" "$ret"
289 2c201a36 2019-02-10 stsp ln -s /usr/obj/distrib/i386/ramdisk $testroot/wt/ramdisk/obj
291 00bb5ea0 2020-07-23 stsp echo "? ramdisk/obj" > $testroot/stdout.expected
293 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && got status > $testroot/stdout)
295 00bb5ea0 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
297 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
298 00bb5ea0 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
299 00bb5ea0 2020-07-23 stsp test_done "$testroot" "$ret"
303 d4ae64fa 2020-07-23 stsp (cd $testroot/wt && ln -sf beta alpha.link)
304 d4ae64fa 2020-07-23 stsp (cd $testroot/wt && ln -sfh gamma epsilon.link)
306 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && ln -s /etc/passwd passwd.link)
307 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && ln -s ../beta epsilon/beta.link)
308 d4ae64fa 2020-07-23 stsp (cd $testroot/wt && got add passwd.link epsilon/beta.link > /dev/null)
310 d4ae64fa 2020-07-23 stsp (cd $testroot/wt && got rm nonexistent.link > /dev/null)
312 d4ae64fa 2020-07-23 stsp echo 'M alpha.link' > $testroot/stdout.expected
313 00bb5ea0 2020-07-23 stsp echo 'A epsilon/beta.link' >> $testroot/stdout.expected
314 d4ae64fa 2020-07-23 stsp echo 'M epsilon.link' >> $testroot/stdout.expected
315 d4ae64fa 2020-07-23 stsp echo 'D nonexistent.link' >> $testroot/stdout.expected
316 00bb5ea0 2020-07-23 stsp echo 'A passwd.link' >> $testroot/stdout.expected
317 00bb5ea0 2020-07-23 stsp echo "? ramdisk/obj" >> $testroot/stdout.expected
319 3cbbd752 2019-02-19 stsp (cd $testroot/wt && got status > $testroot/stdout)
321 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
323 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
324 3cbbd752 2019-02-19 stsp diff -u $testroot/stdout.expected $testroot/stdout
326 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
329 f6cae3ed 2020-09-13 naddy test_status_shows_no_mods_after_complete_merge() {
330 3cbbd752 2019-02-19 stsp local testroot=`test_init status_shows_no_mods_after_complete_merge 1`
332 3cbbd752 2019-02-19 stsp # make this file larger than the usual blob buffer size of 8192
333 c036d108 2022-04-15 op jot 16384 > $testroot/repo/numbers
335 3cbbd752 2019-02-19 stsp (cd $testroot/repo && git add numbers)
336 3cbbd752 2019-02-19 stsp git_commit $testroot/repo -m "added numbers file"
338 3cbbd752 2019-02-19 stsp got checkout $testroot/repo $testroot/wt > /dev/null
340 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
341 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
345 3cbbd752 2019-02-19 stsp sed -i 's/2/22/' $testroot/repo/numbers
346 3cbbd752 2019-02-19 stsp git_commit $testroot/repo -m "modified line 2"
349 3cbbd752 2019-02-19 stsp # modify line 2 again; no local changes are left after merge
350 3cbbd752 2019-02-19 stsp sed -i 's/2/22/' $testroot/wt/numbers
352 3cbbd752 2019-02-19 stsp echo "G numbers" > $testroot/stdout.expected
353 4f3c844b 2021-09-14 stsp echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
354 3cbbd752 2019-02-19 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
355 3cbbd752 2019-02-19 stsp echo >> $testroot/stdout.expected
357 3cbbd752 2019-02-19 stsp (cd $testroot/wt && got update > $testroot/stdout)
359 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
361 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
362 3cbbd752 2019-02-19 stsp diff -u $testroot/stdout.expected $testroot/stdout
363 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
367 2c201a36 2019-02-10 stsp echo -n > $testroot/stdout.expected
369 2c201a36 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
371 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
373 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
374 2c201a36 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
376 2c201a36 2019-02-10 stsp test_done "$testroot" "$ret"
379 f6cae3ed 2020-09-13 naddy test_status_shows_conflict() {
380 7154f6ce 2019-03-27 stsp local testroot=`test_init status_shows_conflict 1`
382 7154f6ce 2019-03-27 stsp echo "1" > $testroot/repo/numbers
383 7154f6ce 2019-03-27 stsp echo "2" >> $testroot/repo/numbers
384 7154f6ce 2019-03-27 stsp echo "3" >> $testroot/repo/numbers
385 7154f6ce 2019-03-27 stsp echo "4" >> $testroot/repo/numbers
386 7154f6ce 2019-03-27 stsp echo "5" >> $testroot/repo/numbers
387 7154f6ce 2019-03-27 stsp echo "6" >> $testroot/repo/numbers
388 7154f6ce 2019-03-27 stsp echo "7" >> $testroot/repo/numbers
389 7154f6ce 2019-03-27 stsp echo "8" >> $testroot/repo/numbers
390 7154f6ce 2019-03-27 stsp (cd $testroot/repo && git add numbers)
391 7154f6ce 2019-03-27 stsp git_commit $testroot/repo -m "added numbers file"
393 7154f6ce 2019-03-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
395 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
396 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
400 7154f6ce 2019-03-27 stsp sed -i 's/2/22/' $testroot/repo/numbers
401 7154f6ce 2019-03-27 stsp git_commit $testroot/repo -m "modified line 2"
403 7154f6ce 2019-03-27 stsp # modify line 2 in a conflicting way
404 7154f6ce 2019-03-27 stsp sed -i 's/2/77/' $testroot/wt/numbers
406 7154f6ce 2019-03-27 stsp echo "C numbers" > $testroot/stdout.expected
407 4f3c844b 2021-09-14 stsp echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
408 7154f6ce 2019-03-27 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
409 7154f6ce 2019-03-27 stsp echo >> $testroot/stdout.expected
410 9627c110 2020-04-18 stsp echo "Files with new merge conflicts: 1" >> $testroot/stdout.expected
412 7154f6ce 2019-03-27 stsp (cd $testroot/wt && got update > $testroot/stdout)
414 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
416 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
417 7154f6ce 2019-03-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
418 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
422 7154f6ce 2019-03-27 stsp echo 'C numbers' > $testroot/stdout.expected
424 7154f6ce 2019-03-27 stsp (cd $testroot/wt && got status > $testroot/stdout)
426 c577a9ce 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
428 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
429 c577a9ce 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
431 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
434 f6cae3ed 2020-09-13 naddy test_status_empty_dir() {
435 c577a9ce 2019-07-27 stsp local testroot=`test_init status_empty_dir`
437 c577a9ce 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
439 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
440 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
444 c577a9ce 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
446 c577a9ce 2019-07-27 stsp echo '! epsilon/zeta' > $testroot/stdout.expected
448 c577a9ce 2019-07-27 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
450 c577a9ce 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
452 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
453 c577a9ce 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
455 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
458 f6cae3ed 2020-09-13 naddy test_status_empty_dir_unversioned_file() {
459 c577a9ce 2019-07-27 stsp local testroot=`test_init status_empty_dir_unversioned_file`
461 c577a9ce 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
463 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
464 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
468 c577a9ce 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
469 c577a9ce 2019-07-27 stsp touch $testroot/wt/epsilon/unversioned
471 c577a9ce 2019-07-27 stsp echo '? epsilon/unversioned' > $testroot/stdout.expected
472 c577a9ce 2019-07-27 stsp echo '! epsilon/zeta' >> $testroot/stdout.expected
474 c577a9ce 2019-07-27 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
476 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
478 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
479 7154f6ce 2019-03-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
481 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
484 f6cae3ed 2020-09-13 naddy test_status_many_paths() {
485 72ea6654 2019-07-27 stsp local testroot=`test_init status_many_paths`
487 72ea6654 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
489 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
490 72ea6654 2019-07-27 stsp test_done "$testroot" "$ret"
494 72ea6654 2019-07-27 stsp echo "modified alpha" > $testroot/wt/alpha
495 72ea6654 2019-07-27 stsp (cd $testroot/wt && got rm beta >/dev/null)
496 72ea6654 2019-07-27 stsp echo "unversioned file" > $testroot/wt/foo
497 72ea6654 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
498 72ea6654 2019-07-27 stsp touch $testroot/wt/beta
499 72ea6654 2019-07-27 stsp echo "new file" > $testroot/wt/new
500 72ea6654 2019-07-27 stsp mkdir $testroot/wt/newdir
501 72ea6654 2019-07-27 stsp (cd $testroot/wt && got add new >/dev/null)
503 10a623df 2021-10-11 stsp (cd $testroot/wt && got status alpha > $testroot/stdout.expected)
504 10a623df 2021-10-11 stsp (cd $testroot/wt && got status beta >> $testroot/stdout.expected)
505 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status epsilon >> $testroot/stdout.expected)
506 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status foo >> $testroot/stdout.expected)
507 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status new >> $testroot/stdout.expected)
508 10a623df 2021-10-11 stsp (cd $testroot/wt && got status newdir >> $testroot/stdout.expected)
509 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status . >> $testroot/stdout.expected)
511 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status newdir alpha epsilon foo new beta . \
512 72ea6654 2019-07-27 stsp > $testroot/stdout)
514 6841da00 2019-08-08 stsp cmp -s $testroot/stdout.expected $testroot/stdout
516 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
517 6841da00 2019-08-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
519 6841da00 2019-08-08 stsp test_done "$testroot" "$ret"
522 f6cae3ed 2020-09-13 naddy test_status_cvsignore() {
523 6841da00 2019-08-08 stsp local testroot=`test_init status_cvsignore`
525 6841da00 2019-08-08 stsp got checkout $testroot/repo $testroot/wt > /dev/null
527 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
528 6841da00 2019-08-08 stsp test_done "$testroot" "$ret"
532 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/foo
533 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/foop
534 3143d852 2020-06-25 stsp echo "unversioned file" > $testroot/wt/epsilon/foo
535 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/bar
536 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/boo
537 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/moo
538 3143d852 2020-06-25 stsp mkdir -p $testroot/wt/epsilon/new/
539 3143d852 2020-06-25 stsp echo "unversioned file" > $testroot/wt/epsilon/new/foo
540 3143d852 2020-06-25 stsp echo "**/foo" > $testroot/wt/.cvsignore
541 8f2ca62d 2021-10-13 stsp echo "**/gamma" >> $testroot/wt/.cvsignore
542 6841da00 2019-08-08 stsp echo "bar" > $testroot/wt/epsilon/.cvsignore
543 6841da00 2019-08-08 stsp echo "moo" >> $testroot/wt/epsilon/.cvsignore
545 6841da00 2019-08-08 stsp echo '? .cvsignore' > $testroot/stdout.expected
546 6841da00 2019-08-08 stsp echo '? epsilon/.cvsignore' >> $testroot/stdout.expected
547 6841da00 2019-08-08 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
548 6841da00 2019-08-08 stsp echo '? foop' >> $testroot/stdout.expected
549 6841da00 2019-08-08 stsp (cd $testroot/wt && got status > $testroot/stdout)
551 3143d852 2020-06-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
553 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
554 3143d852 2020-06-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
555 3143d852 2020-06-25 stsp test_done "$testroot" "$ret"
559 3143d852 2020-06-25 stsp echo '? epsilon/.cvsignore' > $testroot/stdout.expected
560 3143d852 2020-06-25 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
561 3143d852 2020-06-25 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
563 b80270a7 2019-08-08 stsp cmp -s $testroot/stdout.expected $testroot/stdout
565 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
566 b80270a7 2019-08-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
567 b80270a7 2019-08-08 stsp test_done "$testroot" "$ret"
571 3143d852 2020-06-25 stsp echo -n '' > $testroot/stdout.expected
572 3143d852 2020-06-25 stsp (cd $testroot/wt && got status epsilon/new > $testroot/stdout)
574 3143d852 2020-06-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
576 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
577 3143d852 2020-06-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
578 3143d852 2020-06-25 stsp test_done "$testroot" "$ret"
582 b80270a7 2019-08-08 stsp echo '? .cvsignore' > $testroot/stdout.expected
583 b80270a7 2019-08-08 stsp echo '? epsilon/.cvsignore' >> $testroot/stdout.expected
584 b80270a7 2019-08-08 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
585 bd8de430 2019-10-04 stsp echo '? foop' >> $testroot/stdout.expected
586 bd8de430 2019-10-04 stsp (cd $testroot/wt/gamma && got status > $testroot/stdout)
588 f6343036 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
590 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
591 f6343036 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
592 f6343036 2021-06-22 stsp test_done "$testroot" "$ret"
596 f6343036 2021-06-22 stsp cat > $testroot/stdout.expected <<EOF
597 f6343036 2021-06-22 stsp ? .cvsignore
598 f6343036 2021-06-22 stsp ? epsilon/.cvsignore
599 f6343036 2021-06-22 stsp ? epsilon/bar
600 f6343036 2021-06-22 stsp ? epsilon/boo
601 f6343036 2021-06-22 stsp ? epsilon/foo
602 f6343036 2021-06-22 stsp ? epsilon/moo
603 f6343036 2021-06-22 stsp ? epsilon/new/foo
607 f6343036 2021-06-22 stsp (cd $testroot/wt && got status -I > $testroot/stdout)
609 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
610 f6343036 2021-06-22 stsp echo "got status failed unexpectedly" >&2
611 f6343036 2021-06-22 stsp test_done "$testroot" "1"
615 bd8de430 2019-10-04 stsp cmp -s $testroot/stdout.expected $testroot/stdout
617 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
618 bd8de430 2019-10-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
620 bd8de430 2019-10-04 stsp test_done "$testroot" "$ret"
623 f6cae3ed 2020-09-13 naddy test_status_gitignore() {
624 bd8de430 2019-10-04 stsp local testroot=`test_init status_gitignore`
626 bd8de430 2019-10-04 stsp got checkout $testroot/repo $testroot/wt > /dev/null
628 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
629 bd8de430 2019-10-04 stsp test_done "$testroot" "$ret"
633 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/foo
634 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/foop
635 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/barp
636 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/epsilon/bar
637 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/epsilon/boo
638 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/epsilon/moo
639 bd8de430 2019-10-04 stsp mkdir -p $testroot/wt/a/b/c/
640 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/a/b/c/foo
641 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/a/b/c/zoo
642 bd8de430 2019-10-04 stsp echo "foo" > $testroot/wt/.gitignore
643 bd8de430 2019-10-04 stsp echo "bar*" >> $testroot/wt/.gitignore
644 bd8de430 2019-10-04 stsp echo "epsilon/**" >> $testroot/wt/.gitignore
645 bd8de430 2019-10-04 stsp echo "a/**/foo" >> $testroot/wt/.gitignore
646 bd8de430 2019-10-04 stsp echo "**/zoo" >> $testroot/wt/.gitignore
648 bd8de430 2019-10-04 stsp echo '? .gitignore' > $testroot/stdout.expected
649 b80270a7 2019-08-08 stsp echo '? foop' >> $testroot/stdout.expected
650 bd8de430 2019-10-04 stsp (cd $testroot/wt && got status > $testroot/stdout)
652 bd8de430 2019-10-04 stsp cmp -s $testroot/stdout.expected $testroot/stdout
654 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
655 bd8de430 2019-10-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
656 bd8de430 2019-10-04 stsp test_done "$testroot" "$ret"
660 bd8de430 2019-10-04 stsp echo '? .gitignore' > $testroot/stdout.expected
661 bd8de430 2019-10-04 stsp echo '? foop' >> $testroot/stdout.expected
662 b80270a7 2019-08-08 stsp (cd $testroot/wt/gamma && got status > $testroot/stdout)
664 72ea6654 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
666 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
667 72ea6654 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
668 f6343036 2021-06-22 stsp test_done "$testroot" "$ret"
672 f6343036 2021-06-22 stsp cat > $testroot/stdout.expected <<EOF
673 f6343036 2021-06-22 stsp ? .gitignore
674 f6343036 2021-06-22 stsp ? a/b/c/foo
675 f6343036 2021-06-22 stsp ? a/b/c/zoo
677 f6343036 2021-06-22 stsp ? epsilon/bar
678 f6343036 2021-06-22 stsp ? epsilon/boo
679 f6343036 2021-06-22 stsp ? epsilon/moo
683 f6343036 2021-06-22 stsp (cd $testroot/wt && got status -I > $testroot/stdout)
685 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
686 f6343036 2021-06-22 stsp echo "got status failed unexpectedly" >&2
687 f6343036 2021-06-22 stsp test_done "$testroot" "1"
691 f6343036 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
693 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
694 f6343036 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
696 72ea6654 2019-07-27 stsp test_done "$testroot" "$ret"
699 f6cae3ed 2020-09-13 naddy test_status_status_code() {
700 081470ac 2020-08-13 stsp local testroot=`test_init status_status_code`
702 081470ac 2020-08-13 stsp got checkout $testroot/repo $testroot/wt > /dev/null
704 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
705 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
709 081470ac 2020-08-13 stsp echo "modified alpha" > $testroot/wt/alpha
710 081470ac 2020-08-13 stsp (cd $testroot/wt && got rm beta >/dev/null)
711 081470ac 2020-08-13 stsp echo "unversioned file" > $testroot/wt/foo
712 081470ac 2020-08-13 stsp rm $testroot/wt/epsilon/zeta
713 081470ac 2020-08-13 stsp touch $testroot/wt/beta
714 081470ac 2020-08-13 stsp echo "new file" > $testroot/wt/new
715 081470ac 2020-08-13 stsp (cd $testroot/wt && got add new >/dev/null)
717 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s xDM \
718 081470ac 2020-08-13 stsp > $testroot/stdout 2> $testroot/stderr)
720 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
721 081470ac 2020-08-13 stsp echo "status succeeded unexpectedly" >&2
722 081470ac 2020-08-13 stsp test_done "$testroot" "1"
726 081470ac 2020-08-13 stsp echo "got: invalid status code 'x'" > $testroot/stderr.expected
727 081470ac 2020-08-13 stsp cmp -s $testroot/stderr.expected $testroot/stderr
729 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
730 081470ac 2020-08-13 stsp diff -u $testroot/stderr.expected $testroot/stderr
731 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
735 081470ac 2020-08-13 stsp echo 'M alpha' > $testroot/stdout.expected
736 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s M > $testroot/stdout)
737 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
739 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
740 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
741 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
745 081470ac 2020-08-13 stsp echo 'D beta' > $testroot/stdout.expected
746 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s D > $testroot/stdout)
747 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
749 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
750 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
751 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
755 081470ac 2020-08-13 stsp echo '! epsilon/zeta' > $testroot/stdout.expected
756 081470ac 2020-08-13 stsp echo '? foo' >> $testroot/stdout.expected
757 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -s !\? > $testroot/stdout)
758 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
760 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
761 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
762 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
766 081470ac 2020-08-13 stsp echo 'A new' > $testroot/stdout.expected
767 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s A > $testroot/stdout)
768 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
770 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
771 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
772 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
776 081470ac 2020-08-13 stsp (cd $testroot/wt && got stage new > $testroot/stdout)
778 081470ac 2020-08-13 stsp echo ' A new' > $testroot/stdout.expected
779 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s A > $testroot/stdout)
780 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
782 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
783 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
784 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
788 081470ac 2020-08-13 stsp echo 'changed file new' > $testroot/wt/new
790 081470ac 2020-08-13 stsp echo 'MA new' > $testroot/stdout.expected
791 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s A > $testroot/stdout)
792 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
794 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
795 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
796 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
800 081470ac 2020-08-13 stsp echo 'M alpha' > $testroot/stdout.expected
801 081470ac 2020-08-13 stsp echo 'MA new' >> $testroot/stdout.expected
802 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s M > $testroot/stdout)
803 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
805 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
806 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
807 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
811 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
814 67c65ed7 2021-09-14 tracey test_status_suppress() {
815 67c65ed7 2021-09-14 tracey local testroot=`test_init status_suppress`
817 67c65ed7 2021-09-14 tracey got checkout $testroot/repo $testroot/wt > /dev/null
819 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
820 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
824 67c65ed7 2021-09-14 tracey echo "modified alpha" > $testroot/wt/alpha
825 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got rm beta >/dev/null)
826 67c65ed7 2021-09-14 tracey echo "unversioned file" > $testroot/wt/foo
827 67c65ed7 2021-09-14 tracey rm $testroot/wt/epsilon/zeta
828 67c65ed7 2021-09-14 tracey touch $testroot/wt/beta
829 67c65ed7 2021-09-14 tracey echo "new file" > $testroot/wt/new
830 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got add new >/dev/null)
832 e3a46353 2021-09-14 stsp (cd $testroot/wt && got status -S A -s M \
833 e3a46353 2021-09-14 stsp > $testroot/stdout 2> $testroot/stderr)
835 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
836 e3a46353 2021-09-14 stsp echo "status succeeded unexpectedly" >&2
837 e3a46353 2021-09-14 stsp test_done "$testroot" "1"
841 e3a46353 2021-09-14 stsp echo "got: -s and -S options are mutually exclusive" \
842 e3a46353 2021-09-14 stsp > $testroot/stderr.expected
843 e3a46353 2021-09-14 stsp cmp -s $testroot/stderr.expected $testroot/stderr
845 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
846 e3a46353 2021-09-14 stsp diff -u $testroot/stderr.expected $testroot/stderr
847 e3a46353 2021-09-14 stsp test_done "$testroot" "$ret"
851 e3a46353 2021-09-14 stsp (cd $testroot/wt && got status -s A -S M \
852 e3a46353 2021-09-14 stsp > $testroot/stdout 2> $testroot/stderr)
854 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
855 e3a46353 2021-09-14 stsp echo "status succeeded unexpectedly" >&2
856 e3a46353 2021-09-14 stsp test_done "$testroot" "1"
860 e3a46353 2021-09-14 stsp echo "got: -S and -s options are mutually exclusive" \
861 e3a46353 2021-09-14 stsp > $testroot/stderr.expected
862 e3a46353 2021-09-14 stsp cmp -s $testroot/stderr.expected $testroot/stderr
864 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
865 e3a46353 2021-09-14 stsp diff -u $testroot/stderr.expected $testroot/stderr
866 e3a46353 2021-09-14 stsp test_done "$testroot" "$ret"
870 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got status -S xDM \
871 67c65ed7 2021-09-14 tracey > $testroot/stdout 2> $testroot/stderr)
873 49c543a6 2022-03-31 naddy if [ $ret -eq 0 ]; then
874 67c65ed7 2021-09-14 tracey echo "status succeeded unexpectedly" >&2
875 67c65ed7 2021-09-14 tracey test_done "$testroot" "1"
879 67c65ed7 2021-09-14 tracey echo "got: invalid status code 'x'" > $testroot/stderr.expected
880 67c65ed7 2021-09-14 tracey cmp -s $testroot/stderr.expected $testroot/stderr
882 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
883 67c65ed7 2021-09-14 tracey diff -u $testroot/stderr.expected $testroot/stderr
884 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
888 67c65ed7 2021-09-14 tracey echo 'M alpha' > $testroot/stdout.expected
889 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S D\?A! > $testroot/stdout)
890 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
892 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
893 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
894 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
898 67c65ed7 2021-09-14 tracey echo 'D beta' > $testroot/stdout.expected
899 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S M\?A! > $testroot/stdout)
900 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
902 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
903 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
904 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
908 67c65ed7 2021-09-14 tracey echo '! epsilon/zeta' > $testroot/stdout.expected
909 67c65ed7 2021-09-14 tracey echo '? foo' >> $testroot/stdout.expected
910 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got status -S MDA > $testroot/stdout)
911 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
913 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
914 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
915 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
919 67c65ed7 2021-09-14 tracey echo 'A new' > $testroot/stdout.expected
920 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S MD\?! > $testroot/stdout)
921 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
923 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
924 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
925 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
929 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got stage new > $testroot/stdout)
931 67c65ed7 2021-09-14 tracey echo ' A new' > $testroot/stdout.expected
932 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S MD\?! > $testroot/stdout)
933 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
935 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
936 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
937 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
941 67c65ed7 2021-09-14 tracey echo 'changed file new' > $testroot/wt/new
943 67c65ed7 2021-09-14 tracey echo 'M alpha' > $testroot/stdout.expected
944 67c65ed7 2021-09-14 tracey echo 'MA new' >> $testroot/stdout.expected
945 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S D\?! > $testroot/stdout)
946 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
948 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
949 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
950 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
954 67c65ed7 2021-09-14 tracey echo 'M alpha' > $testroot/stdout.expected
955 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S AD\?! > $testroot/stdout)
956 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
958 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
959 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
960 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
964 67c65ed7 2021-09-14 tracey rm $testroot/stdout.expected
965 67c65ed7 2021-09-14 tracey touch $testroot/stdout.expected
967 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S MD\?! > $testroot/stdout)
968 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
970 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
971 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
972 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
976 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
979 4a26d3f8 2020-10-07 stsp test_status_empty_file() {
980 4a26d3f8 2020-10-07 stsp local testroot=`test_init status_empty_file`
982 4a26d3f8 2020-10-07 stsp got checkout $testroot/repo $testroot/wt > /dev/null
984 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
985 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
989 4a26d3f8 2020-10-07 stsp echo -n "" > $testroot/wt/empty
990 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got add empty >/dev/null)
992 4a26d3f8 2020-10-07 stsp echo 'A empty' > $testroot/stdout.expected
994 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got status > $testroot/stdout)
996 4a26d3f8 2020-10-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
998 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
999 4a26d3f8 2020-10-07 stsp diff -u $testroot/stdout.expected $testroot/stdout
1000 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
1004 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got commit -m "empty file" >/dev/null)
1006 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got status > $testroot/stdout)
1008 4a26d3f8 2020-10-07 stsp echo -n > $testroot/stdout.expected
1009 4a26d3f8 2020-10-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1011 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1012 4a26d3f8 2020-10-07 stsp diff -u $testroot/stdout.expected $testroot/stdout
1013 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
1017 4a26d3f8 2020-10-07 stsp # update the timestamp; this used to make the file show up as:
1019 4a26d3f8 2020-10-07 stsp # which should not happen
1020 4a26d3f8 2020-10-07 stsp touch $testroot/wt/empty
1022 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got status > $testroot/stdout)
1024 4a26d3f8 2020-10-07 stsp echo -n > $testroot/stdout.expected
1025 4a26d3f8 2020-10-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1027 49c543a6 2022-03-31 naddy if [ $ret -ne 0 ]; then
1028 4a26d3f8 2020-10-07 stsp diff -u $testroot/stdout.expected $testroot/stdout
1030 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
1033 7fb414ae 2020-08-08 stsp test_parseargs "$@"
1034 35dc4510 2019-02-04 stsp run_test test_status_basic
1035 f02ba292 2019-02-05 stsp run_test test_status_subdir_no_mods
1036 f02ba292 2019-02-05 stsp run_test test_status_subdir_no_mods2
1037 0dbc2271 2019-02-05 stsp run_test test_status_obstructed
1038 02c07007 2019-02-10 stsp run_test test_status_shows_local_mods_after_update
1039 18831e78 2019-02-10 stsp run_test test_status_unversioned_subdirs
1040 00bb5ea0 2020-07-23 stsp run_test test_status_symlink
1041 3cbbd752 2019-02-19 stsp run_test test_status_shows_no_mods_after_complete_merge
1042 7154f6ce 2019-03-27 stsp run_test test_status_shows_conflict
1043 c577a9ce 2019-07-27 stsp run_test test_status_empty_dir
1044 c577a9ce 2019-07-27 stsp run_test test_status_empty_dir_unversioned_file
1045 72ea6654 2019-07-27 stsp run_test test_status_many_paths
1046 6841da00 2019-08-08 stsp run_test test_status_cvsignore
1047 bd8de430 2019-10-04 stsp run_test test_status_gitignore
1048 081470ac 2020-08-13 stsp run_test test_status_status_code
1049 67c65ed7 2021-09-14 tracey run_test test_status_suppress
1050 4a26d3f8 2020-10-07 stsp run_test test_status_empty_file