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 e60e7f5b 2019-02-10 stsp if [ "$ret" != "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 e60e7f5b 2019-02-10 stsp if [ "$ret" != "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 e60e7f5b 2019-02-10 stsp if [ "$ret" != "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 e60e7f5b 2019-02-10 stsp if [ "$ret" != "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 e60e7f5b 2019-02-10 stsp if [ "$ret" != "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 e60e7f5b 2019-02-10 stsp if [ "$ret" != "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 e60e7f5b 2019-02-10 stsp if [ "$ret" != "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 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
153 a062651c 2019-07-27 stsp if [ "$ret" != "0" ]; then
154 0dbc2271 2019-02-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
156 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
159 f6cae3ed 2020-09-13 naddy test_status_shows_local_mods_after_update() {
160 02c07007 2019-02-10 stsp local testroot=`test_init status_shows_local_mods_after_update 1`
162 02c07007 2019-02-10 stsp echo "1" > $testroot/repo/numbers
163 02c07007 2019-02-10 stsp echo "2" >> $testroot/repo/numbers
164 02c07007 2019-02-10 stsp echo "3" >> $testroot/repo/numbers
165 02c07007 2019-02-10 stsp echo "4" >> $testroot/repo/numbers
166 02c07007 2019-02-10 stsp echo "5" >> $testroot/repo/numbers
167 02c07007 2019-02-10 stsp echo "6" >> $testroot/repo/numbers
168 02c07007 2019-02-10 stsp echo "7" >> $testroot/repo/numbers
169 02c07007 2019-02-10 stsp echo "8" >> $testroot/repo/numbers
170 02c07007 2019-02-10 stsp (cd $testroot/repo && git add numbers)
171 02c07007 2019-02-10 stsp git_commit $testroot/repo -m "added numbers file"
173 02c07007 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
175 02c07007 2019-02-10 stsp if [ "$ret" != "0" ]; then
176 02c07007 2019-02-10 stsp test_done "$testroot" "$ret"
180 02c07007 2019-02-10 stsp sed -i 's/2/22/' $testroot/repo/numbers
181 02c07007 2019-02-10 stsp git_commit $testroot/repo -m "modified line 2"
183 02c07007 2019-02-10 stsp # modify line 7; both changes should merge cleanly
184 02c07007 2019-02-10 stsp sed -i 's/7/77/' $testroot/wt/numbers
186 02c07007 2019-02-10 stsp echo "G numbers" > $testroot/stdout.expected
187 4f3c844b 2021-09-14 stsp echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
188 02c07007 2019-02-10 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
189 02c07007 2019-02-10 stsp echo >> $testroot/stdout.expected
191 02c07007 2019-02-10 stsp (cd $testroot/wt && got update > $testroot/stdout)
193 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
195 02c07007 2019-02-10 stsp if [ "$ret" != "0" ]; then
196 02c07007 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
197 02c07007 2019-02-10 stsp test_done "$testroot" "$ret"
201 02c07007 2019-02-10 stsp echo 'M numbers' > $testroot/stdout.expected
203 02c07007 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
205 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
207 02c07007 2019-02-10 stsp if [ "$ret" != "0" ]; then
208 02c07007 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
210 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
213 f6cae3ed 2020-09-13 naddy test_status_unversioned_subdirs() {
214 18831e78 2019-02-10 stsp local testroot=`test_init status_unversioned_subdirs 1`
216 18831e78 2019-02-10 stsp mkdir $testroot/repo/cdfs/
217 18831e78 2019-02-10 stsp touch $testroot/repo/cdfs/Makefile
218 18831e78 2019-02-10 stsp mkdir $testroot/repo/common/
219 18831e78 2019-02-10 stsp touch $testroot/repo/common/Makefile
220 18831e78 2019-02-10 stsp mkdir $testroot/repo/iso/
221 18831e78 2019-02-10 stsp touch $testroot/repo/iso/Makefile
222 18831e78 2019-02-10 stsp mkdir $testroot/repo/ramdisk/
223 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk/Makefile
224 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk/list.local
225 18831e78 2019-02-10 stsp mkdir $testroot/repo/ramdisk_cd/
226 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk_cd/Makefile
227 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk_cd/list.local
228 18831e78 2019-02-10 stsp (cd $testroot/repo && git add .)
229 18831e78 2019-02-10 stsp git_commit $testroot/repo -m "first commit"
231 18831e78 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
233 18831e78 2019-02-10 stsp if [ "$ret" != "0" ]; then
234 18831e78 2019-02-10 stsp test_done "$testroot" "$ret"
238 18831e78 2019-02-10 stsp mkdir $testroot/wt/cdfs/obj
239 18831e78 2019-02-10 stsp mkdir $testroot/wt/ramdisk/obj
240 18831e78 2019-02-10 stsp mkdir $testroot/wt/ramdisk_cd/obj
241 18831e78 2019-02-10 stsp mkdir $testroot/wt/iso/obj
243 18831e78 2019-02-10 stsp echo -n > $testroot/stdout.expected
245 18831e78 2019-02-10 stsp # This used to erroneously print:
247 18831e78 2019-02-10 stsp # ! ramdisk_cd/Makefile
248 18831e78 2019-02-10 stsp # ! ramdisk_cd/list.local
249 18831e78 2019-02-10 stsp # ? ramdisk_cd/Makefile
250 18831e78 2019-02-10 stsp # ? ramdisk_cd/list.local
251 18831e78 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
253 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
255 18831e78 2019-02-10 stsp if [ "$ret" != "0" ]; then
256 18831e78 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
258 18831e78 2019-02-10 stsp test_done "$testroot" "$ret"
261 f6cae3ed 2020-09-13 naddy test_status_symlink() {
262 00bb5ea0 2020-07-23 stsp local testroot=`test_init status_symlink`
264 2c201a36 2019-02-10 stsp mkdir $testroot/repo/ramdisk/
265 2c201a36 2019-02-10 stsp touch $testroot/repo/ramdisk/Makefile
266 d4ae64fa 2020-07-23 stsp (cd $testroot/repo && ln -s alpha alpha.link)
267 d4ae64fa 2020-07-23 stsp (cd $testroot/repo && ln -s epsilon epsilon.link)
268 d4ae64fa 2020-07-23 stsp (cd $testroot/repo && ln -s nonexistent nonexistent.link)
269 2c201a36 2019-02-10 stsp (cd $testroot/repo && git add .)
270 2c201a36 2019-02-10 stsp git_commit $testroot/repo -m "first commit"
272 2c201a36 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
274 2c201a36 2019-02-10 stsp if [ "$ret" != "0" ]; then
275 2c201a36 2019-02-10 stsp test_done "$testroot" "$ret"
279 2c201a36 2019-02-10 stsp ln -s /usr/obj/distrib/i386/ramdisk $testroot/wt/ramdisk/obj
281 00bb5ea0 2020-07-23 stsp echo "? ramdisk/obj" > $testroot/stdout.expected
283 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && got status > $testroot/stdout)
285 00bb5ea0 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
287 00bb5ea0 2020-07-23 stsp if [ "$ret" != "0" ]; then
288 00bb5ea0 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
289 00bb5ea0 2020-07-23 stsp test_done "$testroot" "$ret"
293 d4ae64fa 2020-07-23 stsp (cd $testroot/wt && ln -sf beta alpha.link)
294 d4ae64fa 2020-07-23 stsp (cd $testroot/wt && ln -sfh gamma epsilon.link)
296 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && ln -s /etc/passwd passwd.link)
297 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && ln -s ../beta epsilon/beta.link)
298 d4ae64fa 2020-07-23 stsp (cd $testroot/wt && got add passwd.link epsilon/beta.link > /dev/null)
300 d4ae64fa 2020-07-23 stsp (cd $testroot/wt && got rm nonexistent.link > /dev/null)
302 d4ae64fa 2020-07-23 stsp echo 'M alpha.link' > $testroot/stdout.expected
303 00bb5ea0 2020-07-23 stsp echo 'A epsilon/beta.link' >> $testroot/stdout.expected
304 d4ae64fa 2020-07-23 stsp echo 'M epsilon.link' >> $testroot/stdout.expected
305 d4ae64fa 2020-07-23 stsp echo 'D nonexistent.link' >> $testroot/stdout.expected
306 00bb5ea0 2020-07-23 stsp echo 'A passwd.link' >> $testroot/stdout.expected
307 00bb5ea0 2020-07-23 stsp echo "? ramdisk/obj" >> $testroot/stdout.expected
309 3cbbd752 2019-02-19 stsp (cd $testroot/wt && got status > $testroot/stdout)
311 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
313 3cbbd752 2019-02-19 stsp if [ "$ret" != "0" ]; then
314 3cbbd752 2019-02-19 stsp diff -u $testroot/stdout.expected $testroot/stdout
316 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
319 f6cae3ed 2020-09-13 naddy test_status_shows_no_mods_after_complete_merge() {
320 3cbbd752 2019-02-19 stsp local testroot=`test_init status_shows_no_mods_after_complete_merge 1`
322 3cbbd752 2019-02-19 stsp # make this file larger than the usual blob buffer size of 8192
323 3cbbd752 2019-02-19 stsp echo -n > $testroot/repo/numbers
324 3cbbd752 2019-02-19 stsp for i in `jot 16384`; do
325 3cbbd752 2019-02-19 stsp echo "$i" >> $testroot/repo/numbers
328 3cbbd752 2019-02-19 stsp (cd $testroot/repo && git add numbers)
329 3cbbd752 2019-02-19 stsp git_commit $testroot/repo -m "added numbers file"
331 3cbbd752 2019-02-19 stsp got checkout $testroot/repo $testroot/wt > /dev/null
333 3cbbd752 2019-02-19 stsp if [ "$ret" != "0" ]; then
334 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
338 3cbbd752 2019-02-19 stsp sed -i 's/2/22/' $testroot/repo/numbers
339 3cbbd752 2019-02-19 stsp git_commit $testroot/repo -m "modified line 2"
342 3cbbd752 2019-02-19 stsp # modify line 2 again; no local changes are left after merge
343 3cbbd752 2019-02-19 stsp sed -i 's/2/22/' $testroot/wt/numbers
345 3cbbd752 2019-02-19 stsp echo "G numbers" > $testroot/stdout.expected
346 4f3c844b 2021-09-14 stsp echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
347 3cbbd752 2019-02-19 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
348 3cbbd752 2019-02-19 stsp echo >> $testroot/stdout.expected
350 3cbbd752 2019-02-19 stsp (cd $testroot/wt && got update > $testroot/stdout)
352 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
354 3cbbd752 2019-02-19 stsp if [ "$ret" != "0" ]; then
355 3cbbd752 2019-02-19 stsp diff -u $testroot/stdout.expected $testroot/stdout
356 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
360 2c201a36 2019-02-10 stsp echo -n > $testroot/stdout.expected
362 2c201a36 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
364 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
366 2c201a36 2019-02-10 stsp if [ "$ret" != "0" ]; then
367 2c201a36 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
369 2c201a36 2019-02-10 stsp test_done "$testroot" "$ret"
372 f6cae3ed 2020-09-13 naddy test_status_shows_conflict() {
373 7154f6ce 2019-03-27 stsp local testroot=`test_init status_shows_conflict 1`
375 7154f6ce 2019-03-27 stsp echo "1" > $testroot/repo/numbers
376 7154f6ce 2019-03-27 stsp echo "2" >> $testroot/repo/numbers
377 7154f6ce 2019-03-27 stsp echo "3" >> $testroot/repo/numbers
378 7154f6ce 2019-03-27 stsp echo "4" >> $testroot/repo/numbers
379 7154f6ce 2019-03-27 stsp echo "5" >> $testroot/repo/numbers
380 7154f6ce 2019-03-27 stsp echo "6" >> $testroot/repo/numbers
381 7154f6ce 2019-03-27 stsp echo "7" >> $testroot/repo/numbers
382 7154f6ce 2019-03-27 stsp echo "8" >> $testroot/repo/numbers
383 7154f6ce 2019-03-27 stsp (cd $testroot/repo && git add numbers)
384 7154f6ce 2019-03-27 stsp git_commit $testroot/repo -m "added numbers file"
386 7154f6ce 2019-03-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
388 7154f6ce 2019-03-27 stsp if [ "$ret" != "0" ]; then
389 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
393 7154f6ce 2019-03-27 stsp sed -i 's/2/22/' $testroot/repo/numbers
394 7154f6ce 2019-03-27 stsp git_commit $testroot/repo -m "modified line 2"
396 7154f6ce 2019-03-27 stsp # modify line 2 in a conflicting way
397 7154f6ce 2019-03-27 stsp sed -i 's/2/77/' $testroot/wt/numbers
399 7154f6ce 2019-03-27 stsp echo "C numbers" > $testroot/stdout.expected
400 4f3c844b 2021-09-14 stsp echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
401 7154f6ce 2019-03-27 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
402 7154f6ce 2019-03-27 stsp echo >> $testroot/stdout.expected
403 9627c110 2020-04-18 stsp echo "Files with new merge conflicts: 1" >> $testroot/stdout.expected
405 7154f6ce 2019-03-27 stsp (cd $testroot/wt && got update > $testroot/stdout)
407 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
409 7154f6ce 2019-03-27 stsp if [ "$ret" != "0" ]; then
410 7154f6ce 2019-03-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
411 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
415 7154f6ce 2019-03-27 stsp echo 'C numbers' > $testroot/stdout.expected
417 7154f6ce 2019-03-27 stsp (cd $testroot/wt && got status > $testroot/stdout)
419 c577a9ce 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
421 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
422 c577a9ce 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
424 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
427 f6cae3ed 2020-09-13 naddy test_status_empty_dir() {
428 c577a9ce 2019-07-27 stsp local testroot=`test_init status_empty_dir`
430 c577a9ce 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
432 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
433 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
437 c577a9ce 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
439 c577a9ce 2019-07-27 stsp echo '! epsilon/zeta' > $testroot/stdout.expected
441 c577a9ce 2019-07-27 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
443 c577a9ce 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
445 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
446 c577a9ce 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
448 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
451 f6cae3ed 2020-09-13 naddy test_status_empty_dir_unversioned_file() {
452 c577a9ce 2019-07-27 stsp local testroot=`test_init status_empty_dir_unversioned_file`
454 c577a9ce 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
456 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
457 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
461 c577a9ce 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
462 c577a9ce 2019-07-27 stsp touch $testroot/wt/epsilon/unversioned
464 c577a9ce 2019-07-27 stsp echo '? epsilon/unversioned' > $testroot/stdout.expected
465 c577a9ce 2019-07-27 stsp echo '! epsilon/zeta' >> $testroot/stdout.expected
467 c577a9ce 2019-07-27 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
469 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
471 7154f6ce 2019-03-27 stsp if [ "$ret" != "0" ]; then
472 7154f6ce 2019-03-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
474 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
477 f6cae3ed 2020-09-13 naddy test_status_many_paths() {
478 72ea6654 2019-07-27 stsp local testroot=`test_init status_many_paths`
480 72ea6654 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
482 72ea6654 2019-07-27 stsp if [ "$ret" != "0" ]; then
483 72ea6654 2019-07-27 stsp test_done "$testroot" "$ret"
487 72ea6654 2019-07-27 stsp echo "modified alpha" > $testroot/wt/alpha
488 72ea6654 2019-07-27 stsp (cd $testroot/wt && got rm beta >/dev/null)
489 72ea6654 2019-07-27 stsp echo "unversioned file" > $testroot/wt/foo
490 72ea6654 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
491 72ea6654 2019-07-27 stsp touch $testroot/wt/beta
492 72ea6654 2019-07-27 stsp echo "new file" > $testroot/wt/new
493 72ea6654 2019-07-27 stsp mkdir $testroot/wt/newdir
494 72ea6654 2019-07-27 stsp (cd $testroot/wt && got add new >/dev/null)
496 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status newdir > $testroot/stdout.expected)
497 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status alpha >> $testroot/stdout.expected)
498 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status epsilon >> $testroot/stdout.expected)
499 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status foo >> $testroot/stdout.expected)
500 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status new >> $testroot/stdout.expected)
501 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status beta >> $testroot/stdout.expected)
502 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status . >> $testroot/stdout.expected)
504 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status newdir alpha epsilon foo new beta . \
505 72ea6654 2019-07-27 stsp > $testroot/stdout)
507 6841da00 2019-08-08 stsp cmp -s $testroot/stdout.expected $testroot/stdout
509 6841da00 2019-08-08 stsp if [ "$ret" != "0" ]; then
510 6841da00 2019-08-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
512 6841da00 2019-08-08 stsp test_done "$testroot" "$ret"
515 f6cae3ed 2020-09-13 naddy test_status_cvsignore() {
516 6841da00 2019-08-08 stsp local testroot=`test_init status_cvsignore`
518 6841da00 2019-08-08 stsp got checkout $testroot/repo $testroot/wt > /dev/null
520 6841da00 2019-08-08 stsp if [ "$ret" != "0" ]; then
521 6841da00 2019-08-08 stsp test_done "$testroot" "$ret"
525 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/foo
526 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/foop
527 3143d852 2020-06-25 stsp echo "unversioned file" > $testroot/wt/epsilon/foo
528 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/bar
529 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/boo
530 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/moo
531 3143d852 2020-06-25 stsp mkdir -p $testroot/wt/epsilon/new/
532 3143d852 2020-06-25 stsp echo "unversioned file" > $testroot/wt/epsilon/new/foo
533 3143d852 2020-06-25 stsp echo "**/foo" > $testroot/wt/.cvsignore
534 6841da00 2019-08-08 stsp echo "bar" > $testroot/wt/epsilon/.cvsignore
535 6841da00 2019-08-08 stsp echo "moo" >> $testroot/wt/epsilon/.cvsignore
537 6841da00 2019-08-08 stsp echo '? .cvsignore' > $testroot/stdout.expected
538 6841da00 2019-08-08 stsp echo '? epsilon/.cvsignore' >> $testroot/stdout.expected
539 6841da00 2019-08-08 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
540 6841da00 2019-08-08 stsp echo '? foop' >> $testroot/stdout.expected
541 6841da00 2019-08-08 stsp (cd $testroot/wt && got status > $testroot/stdout)
543 3143d852 2020-06-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
545 3143d852 2020-06-25 stsp if [ "$ret" != "0" ]; then
546 3143d852 2020-06-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
547 3143d852 2020-06-25 stsp test_done "$testroot" "$ret"
551 3143d852 2020-06-25 stsp echo '? epsilon/.cvsignore' > $testroot/stdout.expected
552 3143d852 2020-06-25 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
553 3143d852 2020-06-25 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
555 b80270a7 2019-08-08 stsp cmp -s $testroot/stdout.expected $testroot/stdout
557 b80270a7 2019-08-08 stsp if [ "$ret" != "0" ]; then
558 b80270a7 2019-08-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
559 b80270a7 2019-08-08 stsp test_done "$testroot" "$ret"
563 3143d852 2020-06-25 stsp echo -n '' > $testroot/stdout.expected
564 3143d852 2020-06-25 stsp (cd $testroot/wt && got status epsilon/new > $testroot/stdout)
566 3143d852 2020-06-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
568 3143d852 2020-06-25 stsp if [ "$ret" != "0" ]; then
569 3143d852 2020-06-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
570 3143d852 2020-06-25 stsp test_done "$testroot" "$ret"
574 b80270a7 2019-08-08 stsp echo '? .cvsignore' > $testroot/stdout.expected
575 b80270a7 2019-08-08 stsp echo '? epsilon/.cvsignore' >> $testroot/stdout.expected
576 b80270a7 2019-08-08 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
577 bd8de430 2019-10-04 stsp echo '? foop' >> $testroot/stdout.expected
578 bd8de430 2019-10-04 stsp (cd $testroot/wt/gamma && got status > $testroot/stdout)
580 f6343036 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
582 f6343036 2021-06-22 stsp if [ "$ret" != "0" ]; then
583 f6343036 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
584 f6343036 2021-06-22 stsp test_done "$testroot" "$ret"
588 f6343036 2021-06-22 stsp cat > $testroot/stdout.expected <<EOF
589 f6343036 2021-06-22 stsp ? .cvsignore
590 f6343036 2021-06-22 stsp ? epsilon/.cvsignore
591 f6343036 2021-06-22 stsp ? epsilon/bar
592 f6343036 2021-06-22 stsp ? epsilon/boo
593 f6343036 2021-06-22 stsp ? epsilon/foo
594 f6343036 2021-06-22 stsp ? epsilon/moo
595 f6343036 2021-06-22 stsp ? epsilon/new/foo
599 f6343036 2021-06-22 stsp (cd $testroot/wt && got status -I > $testroot/stdout)
601 f6343036 2021-06-22 stsp if [ "$ret" != "0" ]; then
602 f6343036 2021-06-22 stsp echo "got status failed unexpectedly" >&2
603 f6343036 2021-06-22 stsp test_done "$testroot" "1"
607 bd8de430 2019-10-04 stsp cmp -s $testroot/stdout.expected $testroot/stdout
609 bd8de430 2019-10-04 stsp if [ "$ret" != "0" ]; then
610 bd8de430 2019-10-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
612 bd8de430 2019-10-04 stsp test_done "$testroot" "$ret"
615 f6cae3ed 2020-09-13 naddy test_status_gitignore() {
616 bd8de430 2019-10-04 stsp local testroot=`test_init status_gitignore`
618 bd8de430 2019-10-04 stsp got checkout $testroot/repo $testroot/wt > /dev/null
620 bd8de430 2019-10-04 stsp if [ "$ret" != "0" ]; then
621 bd8de430 2019-10-04 stsp test_done "$testroot" "$ret"
625 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/foo
626 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/foop
627 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/barp
628 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/epsilon/bar
629 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/epsilon/boo
630 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/epsilon/moo
631 bd8de430 2019-10-04 stsp mkdir -p $testroot/wt/a/b/c/
632 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/a/b/c/foo
633 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/a/b/c/zoo
634 bd8de430 2019-10-04 stsp echo "foo" > $testroot/wt/.gitignore
635 bd8de430 2019-10-04 stsp echo "bar*" >> $testroot/wt/.gitignore
636 bd8de430 2019-10-04 stsp echo "epsilon/**" >> $testroot/wt/.gitignore
637 bd8de430 2019-10-04 stsp echo "a/**/foo" >> $testroot/wt/.gitignore
638 bd8de430 2019-10-04 stsp echo "**/zoo" >> $testroot/wt/.gitignore
640 bd8de430 2019-10-04 stsp echo '? .gitignore' > $testroot/stdout.expected
641 b80270a7 2019-08-08 stsp echo '? foop' >> $testroot/stdout.expected
642 bd8de430 2019-10-04 stsp (cd $testroot/wt && got status > $testroot/stdout)
644 bd8de430 2019-10-04 stsp cmp -s $testroot/stdout.expected $testroot/stdout
646 bd8de430 2019-10-04 stsp if [ "$ret" != "0" ]; then
647 bd8de430 2019-10-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
648 bd8de430 2019-10-04 stsp test_done "$testroot" "$ret"
652 bd8de430 2019-10-04 stsp echo '? .gitignore' > $testroot/stdout.expected
653 bd8de430 2019-10-04 stsp echo '? foop' >> $testroot/stdout.expected
654 b80270a7 2019-08-08 stsp (cd $testroot/wt/gamma && got status > $testroot/stdout)
656 72ea6654 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
658 72ea6654 2019-07-27 stsp if [ "$ret" != "0" ]; then
659 72ea6654 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
660 f6343036 2021-06-22 stsp test_done "$testroot" "$ret"
664 f6343036 2021-06-22 stsp cat > $testroot/stdout.expected <<EOF
665 f6343036 2021-06-22 stsp ? .gitignore
666 f6343036 2021-06-22 stsp ? a/b/c/foo
667 f6343036 2021-06-22 stsp ? a/b/c/zoo
669 f6343036 2021-06-22 stsp ? epsilon/bar
670 f6343036 2021-06-22 stsp ? epsilon/boo
671 f6343036 2021-06-22 stsp ? epsilon/moo
675 f6343036 2021-06-22 stsp (cd $testroot/wt && got status -I > $testroot/stdout)
677 f6343036 2021-06-22 stsp if [ "$ret" != "0" ]; then
678 f6343036 2021-06-22 stsp echo "got status failed unexpectedly" >&2
679 f6343036 2021-06-22 stsp test_done "$testroot" "1"
683 f6343036 2021-06-22 stsp cmp -s $testroot/stdout.expected $testroot/stdout
685 f6343036 2021-06-22 stsp if [ "$ret" != "0" ]; then
686 f6343036 2021-06-22 stsp diff -u $testroot/stdout.expected $testroot/stdout
688 72ea6654 2019-07-27 stsp test_done "$testroot" "$ret"
691 f6cae3ed 2020-09-13 naddy test_status_status_code() {
692 081470ac 2020-08-13 stsp local testroot=`test_init status_status_code`
694 081470ac 2020-08-13 stsp got checkout $testroot/repo $testroot/wt > /dev/null
696 081470ac 2020-08-13 stsp if [ "$ret" != "0" ]; then
697 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
701 081470ac 2020-08-13 stsp echo "modified alpha" > $testroot/wt/alpha
702 081470ac 2020-08-13 stsp (cd $testroot/wt && got rm beta >/dev/null)
703 081470ac 2020-08-13 stsp echo "unversioned file" > $testroot/wt/foo
704 081470ac 2020-08-13 stsp rm $testroot/wt/epsilon/zeta
705 081470ac 2020-08-13 stsp touch $testroot/wt/beta
706 081470ac 2020-08-13 stsp echo "new file" > $testroot/wt/new
707 081470ac 2020-08-13 stsp (cd $testroot/wt && got add new >/dev/null)
709 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s xDM \
710 081470ac 2020-08-13 stsp > $testroot/stdout 2> $testroot/stderr)
712 54c39596 2020-12-28 stsp if [ "$ret" = "0" ]; then
713 081470ac 2020-08-13 stsp echo "status succeeded unexpectedly" >&2
714 081470ac 2020-08-13 stsp test_done "$testroot" "1"
718 081470ac 2020-08-13 stsp echo "got: invalid status code 'x'" > $testroot/stderr.expected
719 081470ac 2020-08-13 stsp cmp -s $testroot/stderr.expected $testroot/stderr
721 081470ac 2020-08-13 stsp if [ "$ret" != "0" ]; then
722 081470ac 2020-08-13 stsp diff -u $testroot/stderr.expected $testroot/stderr
723 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
727 081470ac 2020-08-13 stsp echo 'M alpha' > $testroot/stdout.expected
728 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s M > $testroot/stdout)
729 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
731 081470ac 2020-08-13 stsp if [ "$ret" != "0" ]; then
732 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
733 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
737 081470ac 2020-08-13 stsp echo 'D beta' > $testroot/stdout.expected
738 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s D > $testroot/stdout)
739 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
741 081470ac 2020-08-13 stsp if [ "$ret" != "0" ]; then
742 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
743 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
747 081470ac 2020-08-13 stsp echo '! epsilon/zeta' > $testroot/stdout.expected
748 081470ac 2020-08-13 stsp echo '? foo' >> $testroot/stdout.expected
749 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -s !\? > $testroot/stdout)
750 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
752 081470ac 2020-08-13 stsp if [ "$ret" != "0" ]; then
753 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
754 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
758 081470ac 2020-08-13 stsp echo 'A new' > $testroot/stdout.expected
759 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s A > $testroot/stdout)
760 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
762 081470ac 2020-08-13 stsp if [ "$ret" != "0" ]; then
763 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
764 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
768 081470ac 2020-08-13 stsp (cd $testroot/wt && got stage new > $testroot/stdout)
770 081470ac 2020-08-13 stsp echo ' A new' > $testroot/stdout.expected
771 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s A > $testroot/stdout)
772 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
774 081470ac 2020-08-13 stsp if [ "$ret" != "0" ]; then
775 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
776 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
780 081470ac 2020-08-13 stsp echo 'changed file new' > $testroot/wt/new
782 081470ac 2020-08-13 stsp echo 'MA new' > $testroot/stdout.expected
783 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s A > $testroot/stdout)
784 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
786 081470ac 2020-08-13 stsp if [ "$ret" != "0" ]; then
787 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
788 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
792 081470ac 2020-08-13 stsp echo 'M alpha' > $testroot/stdout.expected
793 081470ac 2020-08-13 stsp echo 'MA new' >> $testroot/stdout.expected
794 081470ac 2020-08-13 stsp (cd $testroot/wt && got status -s M > $testroot/stdout)
795 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
797 67c65ed7 2021-09-14 tracey if [ "$ret" != "0" ]; then
798 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
799 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
803 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
806 67c65ed7 2021-09-14 tracey test_status_suppress() {
807 67c65ed7 2021-09-14 tracey local testroot=`test_init status_suppress`
809 67c65ed7 2021-09-14 tracey got checkout $testroot/repo $testroot/wt > /dev/null
811 67c65ed7 2021-09-14 tracey if [ "$ret" != "0" ]; then
812 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
816 67c65ed7 2021-09-14 tracey echo "modified alpha" > $testroot/wt/alpha
817 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got rm beta >/dev/null)
818 67c65ed7 2021-09-14 tracey echo "unversioned file" > $testroot/wt/foo
819 67c65ed7 2021-09-14 tracey rm $testroot/wt/epsilon/zeta
820 67c65ed7 2021-09-14 tracey touch $testroot/wt/beta
821 67c65ed7 2021-09-14 tracey echo "new file" > $testroot/wt/new
822 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got add new >/dev/null)
824 e3a46353 2021-09-14 stsp (cd $testroot/wt && got status -S A -s M \
825 e3a46353 2021-09-14 stsp > $testroot/stdout 2> $testroot/stderr)
827 e3a46353 2021-09-14 stsp if [ "$ret" = "0" ]; then
828 e3a46353 2021-09-14 stsp echo "status succeeded unexpectedly" >&2
829 e3a46353 2021-09-14 stsp test_done "$testroot" "1"
833 e3a46353 2021-09-14 stsp echo "got: -s and -S options are mutually exclusive" \
834 e3a46353 2021-09-14 stsp > $testroot/stderr.expected
835 e3a46353 2021-09-14 stsp cmp -s $testroot/stderr.expected $testroot/stderr
837 e3a46353 2021-09-14 stsp if [ "$ret" != "0" ]; then
838 e3a46353 2021-09-14 stsp diff -u $testroot/stderr.expected $testroot/stderr
839 e3a46353 2021-09-14 stsp test_done "$testroot" "$ret"
843 e3a46353 2021-09-14 stsp (cd $testroot/wt && got status -s A -S M \
844 e3a46353 2021-09-14 stsp > $testroot/stdout 2> $testroot/stderr)
846 e3a46353 2021-09-14 stsp if [ "$ret" = "0" ]; then
847 e3a46353 2021-09-14 stsp echo "status succeeded unexpectedly" >&2
848 e3a46353 2021-09-14 stsp test_done "$testroot" "1"
852 e3a46353 2021-09-14 stsp echo "got: -S and -s options are mutually exclusive" \
853 e3a46353 2021-09-14 stsp > $testroot/stderr.expected
854 e3a46353 2021-09-14 stsp cmp -s $testroot/stderr.expected $testroot/stderr
856 e3a46353 2021-09-14 stsp if [ "$ret" != "0" ]; then
857 e3a46353 2021-09-14 stsp diff -u $testroot/stderr.expected $testroot/stderr
858 e3a46353 2021-09-14 stsp test_done "$testroot" "$ret"
862 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got status -S xDM \
863 67c65ed7 2021-09-14 tracey > $testroot/stdout 2> $testroot/stderr)
865 67c65ed7 2021-09-14 tracey if [ "$ret" = "0" ]; then
866 67c65ed7 2021-09-14 tracey echo "status succeeded unexpectedly" >&2
867 67c65ed7 2021-09-14 tracey test_done "$testroot" "1"
871 67c65ed7 2021-09-14 tracey echo "got: invalid status code 'x'" > $testroot/stderr.expected
872 67c65ed7 2021-09-14 tracey cmp -s $testroot/stderr.expected $testroot/stderr
874 67c65ed7 2021-09-14 tracey if [ "$ret" != "0" ]; then
875 67c65ed7 2021-09-14 tracey diff -u $testroot/stderr.expected $testroot/stderr
876 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
880 67c65ed7 2021-09-14 tracey echo 'M alpha' > $testroot/stdout.expected
881 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S D\?A! > $testroot/stdout)
882 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
884 67c65ed7 2021-09-14 tracey if [ "$ret" != "0" ]; then
885 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
886 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
890 67c65ed7 2021-09-14 tracey echo 'D beta' > $testroot/stdout.expected
891 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S M\?A! > $testroot/stdout)
892 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
894 67c65ed7 2021-09-14 tracey if [ "$ret" != "0" ]; then
895 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
896 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
900 67c65ed7 2021-09-14 tracey echo '! epsilon/zeta' > $testroot/stdout.expected
901 67c65ed7 2021-09-14 tracey echo '? foo' >> $testroot/stdout.expected
902 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got status -S MDA > $testroot/stdout)
903 081470ac 2020-08-13 stsp cmp -s $testroot/stdout.expected $testroot/stdout
905 081470ac 2020-08-13 stsp if [ "$ret" != "0" ]; then
906 081470ac 2020-08-13 stsp diff -u $testroot/stdout.expected $testroot/stdout
907 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
911 67c65ed7 2021-09-14 tracey echo 'A new' > $testroot/stdout.expected
912 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S MD\?! > $testroot/stdout)
913 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
915 67c65ed7 2021-09-14 tracey if [ "$ret" != "0" ]; then
916 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
917 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
921 67c65ed7 2021-09-14 tracey (cd $testroot/wt && got stage new > $testroot/stdout)
923 67c65ed7 2021-09-14 tracey echo ' A new' > $testroot/stdout.expected
924 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S MD\?! > $testroot/stdout)
925 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
927 67c65ed7 2021-09-14 tracey if [ "$ret" != "0" ]; then
928 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
929 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
933 67c65ed7 2021-09-14 tracey echo 'changed file new' > $testroot/wt/new
935 67c65ed7 2021-09-14 tracey echo 'M alpha' > $testroot/stdout.expected
936 67c65ed7 2021-09-14 tracey echo 'MA new' >> $testroot/stdout.expected
937 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S D\?! > $testroot/stdout)
938 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
940 67c65ed7 2021-09-14 tracey if [ "$ret" != "0" ]; then
941 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
942 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
946 67c65ed7 2021-09-14 tracey echo 'M alpha' > $testroot/stdout.expected
947 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S AD\?! > $testroot/stdout)
948 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
950 67c65ed7 2021-09-14 tracey if [ "$ret" != "0" ]; then
951 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
952 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
956 67c65ed7 2021-09-14 tracey rm $testroot/stdout.expected
957 67c65ed7 2021-09-14 tracey touch $testroot/stdout.expected
959 67d7451c 2021-09-15 naddy (cd $testroot/wt && got status -S MD\?! > $testroot/stdout)
960 67c65ed7 2021-09-14 tracey cmp -s $testroot/stdout.expected $testroot/stdout
962 67c65ed7 2021-09-14 tracey if [ "$ret" != "0" ]; then
963 67c65ed7 2021-09-14 tracey diff -u $testroot/stdout.expected $testroot/stdout
964 67c65ed7 2021-09-14 tracey test_done "$testroot" "$ret"
968 081470ac 2020-08-13 stsp test_done "$testroot" "$ret"
971 4a26d3f8 2020-10-07 stsp test_status_empty_file() {
972 4a26d3f8 2020-10-07 stsp local testroot=`test_init status_empty_file`
974 4a26d3f8 2020-10-07 stsp got checkout $testroot/repo $testroot/wt > /dev/null
976 4a26d3f8 2020-10-07 stsp if [ "$ret" != "0" ]; then
977 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
981 4a26d3f8 2020-10-07 stsp echo -n "" > $testroot/wt/empty
982 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got add empty >/dev/null)
984 4a26d3f8 2020-10-07 stsp echo 'A empty' > $testroot/stdout.expected
986 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got status > $testroot/stdout)
988 4a26d3f8 2020-10-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
990 4a26d3f8 2020-10-07 stsp if [ "$ret" != "0" ]; then
991 4a26d3f8 2020-10-07 stsp diff -u $testroot/stdout.expected $testroot/stdout
992 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
996 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got commit -m "empty file" >/dev/null)
998 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got status > $testroot/stdout)
1000 4a26d3f8 2020-10-07 stsp echo -n > $testroot/stdout.expected
1001 4a26d3f8 2020-10-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1003 4a26d3f8 2020-10-07 stsp if [ "$ret" != "0" ]; then
1004 4a26d3f8 2020-10-07 stsp diff -u $testroot/stdout.expected $testroot/stdout
1005 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
1009 4a26d3f8 2020-10-07 stsp # update the timestamp; this used to make the file show up as:
1011 4a26d3f8 2020-10-07 stsp # which should not happen
1012 4a26d3f8 2020-10-07 stsp touch $testroot/wt/empty
1014 4a26d3f8 2020-10-07 stsp (cd $testroot/wt && got status > $testroot/stdout)
1016 4a26d3f8 2020-10-07 stsp echo -n > $testroot/stdout.expected
1017 4a26d3f8 2020-10-07 stsp cmp -s $testroot/stdout.expected $testroot/stdout
1019 4a26d3f8 2020-10-07 stsp if [ "$ret" != "0" ]; then
1020 4a26d3f8 2020-10-07 stsp diff -u $testroot/stdout.expected $testroot/stdout
1022 4a26d3f8 2020-10-07 stsp test_done "$testroot" "$ret"
1025 7fb414ae 2020-08-08 stsp test_parseargs "$@"
1026 35dc4510 2019-02-04 stsp run_test test_status_basic
1027 f02ba292 2019-02-05 stsp run_test test_status_subdir_no_mods
1028 f02ba292 2019-02-05 stsp run_test test_status_subdir_no_mods2
1029 0dbc2271 2019-02-05 stsp run_test test_status_obstructed
1030 02c07007 2019-02-10 stsp run_test test_status_shows_local_mods_after_update
1031 18831e78 2019-02-10 stsp run_test test_status_unversioned_subdirs
1032 00bb5ea0 2020-07-23 stsp run_test test_status_symlink
1033 3cbbd752 2019-02-19 stsp run_test test_status_shows_no_mods_after_complete_merge
1034 7154f6ce 2019-03-27 stsp run_test test_status_shows_conflict
1035 c577a9ce 2019-07-27 stsp run_test test_status_empty_dir
1036 c577a9ce 2019-07-27 stsp run_test test_status_empty_dir_unversioned_file
1037 72ea6654 2019-07-27 stsp run_test test_status_many_paths
1038 6841da00 2019-08-08 stsp run_test test_status_cvsignore
1039 bd8de430 2019-10-04 stsp run_test test_status_gitignore
1040 081470ac 2020-08-13 stsp run_test test_status_status_code
1041 67c65ed7 2021-09-14 tracey run_test test_status_suppress
1042 4a26d3f8 2020-10-07 stsp run_test test_status_empty_file