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 35dc4510 2019-02-04 stsp function 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 f02ba292 2019-02-05 stsp function 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 f02ba292 2019-02-05 stsp function 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 0dbc2271 2019-02-05 stsp function 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 02c07007 2019-02-10 stsp function 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 02c07007 2019-02-10 stsp echo -n "Updated to commit " >> $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 18831e78 2019-02-10 stsp function 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 00bb5ea0 2020-07-23 stsp function 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 2c201a36 2019-02-10 stsp (cd $testroot/repo && git add .)
267 2c201a36 2019-02-10 stsp git_commit $testroot/repo -m "first commit"
269 2c201a36 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
271 2c201a36 2019-02-10 stsp if [ "$ret" != "0" ]; then
272 2c201a36 2019-02-10 stsp test_done "$testroot" "$ret"
276 2c201a36 2019-02-10 stsp ln -s /usr/obj/distrib/i386/ramdisk $testroot/wt/ramdisk/obj
278 00bb5ea0 2020-07-23 stsp echo "? ramdisk/obj" > $testroot/stdout.expected
280 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && got status > $testroot/stdout)
282 00bb5ea0 2020-07-23 stsp cmp -s $testroot/stdout.expected $testroot/stdout
284 00bb5ea0 2020-07-23 stsp if [ "$ret" != "0" ]; then
285 00bb5ea0 2020-07-23 stsp diff -u $testroot/stdout.expected $testroot/stdout
286 00bb5ea0 2020-07-23 stsp test_done "$testroot" "$ret"
290 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && ln -s alpha alpha.link)
291 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && ln -s epsilon epsilon.link)
292 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && ln -s /etc/passwd passwd.link)
293 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && ln -s ../beta epsilon/beta.link)
294 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && ln -s nonexistent nonexistent.link)
295 00bb5ea0 2020-07-23 stsp (cd $testroot/wt && got add alpha.link epsilon.link \
296 00bb5ea0 2020-07-23 stsp passwd.link epsilon/beta.link nonexistent.link > /dev/null)
298 00bb5ea0 2020-07-23 stsp echo 'A alpha.link' > $testroot/stdout.expected
299 00bb5ea0 2020-07-23 stsp echo 'A epsilon/beta.link' >> $testroot/stdout.expected
300 00bb5ea0 2020-07-23 stsp echo 'A epsilon.link' >> $testroot/stdout.expected
301 00bb5ea0 2020-07-23 stsp echo 'A nonexistent.link' >> $testroot/stdout.expected
302 00bb5ea0 2020-07-23 stsp echo 'A passwd.link' >> $testroot/stdout.expected
303 00bb5ea0 2020-07-23 stsp echo "? ramdisk/obj" >> $testroot/stdout.expected
305 3cbbd752 2019-02-19 stsp (cd $testroot/wt && got status > $testroot/stdout)
307 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
309 3cbbd752 2019-02-19 stsp if [ "$ret" != "0" ]; then
310 3cbbd752 2019-02-19 stsp diff -u $testroot/stdout.expected $testroot/stdout
312 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
315 3cbbd752 2019-02-19 stsp function test_status_shows_no_mods_after_complete_merge {
316 3cbbd752 2019-02-19 stsp local testroot=`test_init status_shows_no_mods_after_complete_merge 1`
318 3cbbd752 2019-02-19 stsp # make this file larger than the usual blob buffer size of 8192
319 3cbbd752 2019-02-19 stsp echo -n > $testroot/repo/numbers
320 3cbbd752 2019-02-19 stsp for i in `jot 16384`; do
321 3cbbd752 2019-02-19 stsp echo "$i" >> $testroot/repo/numbers
324 3cbbd752 2019-02-19 stsp (cd $testroot/repo && git add numbers)
325 3cbbd752 2019-02-19 stsp git_commit $testroot/repo -m "added numbers file"
327 3cbbd752 2019-02-19 stsp got checkout $testroot/repo $testroot/wt > /dev/null
329 3cbbd752 2019-02-19 stsp if [ "$ret" != "0" ]; then
330 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
334 3cbbd752 2019-02-19 stsp sed -i 's/2/22/' $testroot/repo/numbers
335 3cbbd752 2019-02-19 stsp git_commit $testroot/repo -m "modified line 2"
338 3cbbd752 2019-02-19 stsp # modify line 2 again; no local changes are left after merge
339 3cbbd752 2019-02-19 stsp sed -i 's/2/22/' $testroot/wt/numbers
341 3cbbd752 2019-02-19 stsp echo "G numbers" > $testroot/stdout.expected
342 3cbbd752 2019-02-19 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
343 3cbbd752 2019-02-19 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
344 3cbbd752 2019-02-19 stsp echo >> $testroot/stdout.expected
346 3cbbd752 2019-02-19 stsp (cd $testroot/wt && got update > $testroot/stdout)
348 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
350 3cbbd752 2019-02-19 stsp if [ "$ret" != "0" ]; then
351 3cbbd752 2019-02-19 stsp diff -u $testroot/stdout.expected $testroot/stdout
352 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
356 2c201a36 2019-02-10 stsp echo -n > $testroot/stdout.expected
358 2c201a36 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
360 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
362 2c201a36 2019-02-10 stsp if [ "$ret" != "0" ]; then
363 2c201a36 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
365 2c201a36 2019-02-10 stsp test_done "$testroot" "$ret"
368 7154f6ce 2019-03-27 stsp function test_status_shows_conflict {
369 7154f6ce 2019-03-27 stsp local testroot=`test_init status_shows_conflict 1`
371 7154f6ce 2019-03-27 stsp echo "1" > $testroot/repo/numbers
372 7154f6ce 2019-03-27 stsp echo "2" >> $testroot/repo/numbers
373 7154f6ce 2019-03-27 stsp echo "3" >> $testroot/repo/numbers
374 7154f6ce 2019-03-27 stsp echo "4" >> $testroot/repo/numbers
375 7154f6ce 2019-03-27 stsp echo "5" >> $testroot/repo/numbers
376 7154f6ce 2019-03-27 stsp echo "6" >> $testroot/repo/numbers
377 7154f6ce 2019-03-27 stsp echo "7" >> $testroot/repo/numbers
378 7154f6ce 2019-03-27 stsp echo "8" >> $testroot/repo/numbers
379 7154f6ce 2019-03-27 stsp (cd $testroot/repo && git add numbers)
380 7154f6ce 2019-03-27 stsp git_commit $testroot/repo -m "added numbers file"
382 7154f6ce 2019-03-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
384 7154f6ce 2019-03-27 stsp if [ "$ret" != "0" ]; then
385 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
389 7154f6ce 2019-03-27 stsp sed -i 's/2/22/' $testroot/repo/numbers
390 7154f6ce 2019-03-27 stsp git_commit $testroot/repo -m "modified line 2"
392 7154f6ce 2019-03-27 stsp # modify line 2 in a conflicting way
393 7154f6ce 2019-03-27 stsp sed -i 's/2/77/' $testroot/wt/numbers
395 7154f6ce 2019-03-27 stsp echo "C numbers" > $testroot/stdout.expected
396 7154f6ce 2019-03-27 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
397 7154f6ce 2019-03-27 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
398 7154f6ce 2019-03-27 stsp echo >> $testroot/stdout.expected
399 9627c110 2020-04-18 stsp echo "Files with new merge conflicts: 1" >> $testroot/stdout.expected
401 7154f6ce 2019-03-27 stsp (cd $testroot/wt && got update > $testroot/stdout)
403 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
405 7154f6ce 2019-03-27 stsp if [ "$ret" != "0" ]; then
406 7154f6ce 2019-03-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
407 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
411 7154f6ce 2019-03-27 stsp echo 'C numbers' > $testroot/stdout.expected
413 7154f6ce 2019-03-27 stsp (cd $testroot/wt && got status > $testroot/stdout)
415 c577a9ce 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
417 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
418 c577a9ce 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
420 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
423 c577a9ce 2019-07-27 stsp function test_status_empty_dir {
424 c577a9ce 2019-07-27 stsp local testroot=`test_init status_empty_dir`
426 c577a9ce 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
428 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
429 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
433 c577a9ce 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
435 c577a9ce 2019-07-27 stsp echo '! epsilon/zeta' > $testroot/stdout.expected
437 c577a9ce 2019-07-27 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
439 c577a9ce 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
441 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
442 c577a9ce 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
444 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
447 c577a9ce 2019-07-27 stsp function test_status_empty_dir_unversioned_file {
448 c577a9ce 2019-07-27 stsp local testroot=`test_init status_empty_dir_unversioned_file`
450 c577a9ce 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
452 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
453 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
457 c577a9ce 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
458 c577a9ce 2019-07-27 stsp touch $testroot/wt/epsilon/unversioned
460 c577a9ce 2019-07-27 stsp echo '? epsilon/unversioned' > $testroot/stdout.expected
461 c577a9ce 2019-07-27 stsp echo '! epsilon/zeta' >> $testroot/stdout.expected
463 c577a9ce 2019-07-27 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
465 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
467 7154f6ce 2019-03-27 stsp if [ "$ret" != "0" ]; then
468 7154f6ce 2019-03-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
470 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
473 72ea6654 2019-07-27 stsp function test_status_many_paths {
474 72ea6654 2019-07-27 stsp local testroot=`test_init status_many_paths`
476 72ea6654 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
478 72ea6654 2019-07-27 stsp if [ "$ret" != "0" ]; then
479 72ea6654 2019-07-27 stsp test_done "$testroot" "$ret"
483 72ea6654 2019-07-27 stsp echo "modified alpha" > $testroot/wt/alpha
484 72ea6654 2019-07-27 stsp (cd $testroot/wt && got rm beta >/dev/null)
485 72ea6654 2019-07-27 stsp echo "unversioned file" > $testroot/wt/foo
486 72ea6654 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
487 72ea6654 2019-07-27 stsp touch $testroot/wt/beta
488 72ea6654 2019-07-27 stsp echo "new file" > $testroot/wt/new
489 72ea6654 2019-07-27 stsp mkdir $testroot/wt/newdir
490 72ea6654 2019-07-27 stsp (cd $testroot/wt && got add new >/dev/null)
492 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status newdir > $testroot/stdout.expected)
493 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status alpha >> $testroot/stdout.expected)
494 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status epsilon >> $testroot/stdout.expected)
495 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status foo >> $testroot/stdout.expected)
496 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status new >> $testroot/stdout.expected)
497 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status beta >> $testroot/stdout.expected)
498 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status . >> $testroot/stdout.expected)
500 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status newdir alpha epsilon foo new beta . \
501 72ea6654 2019-07-27 stsp > $testroot/stdout)
503 6841da00 2019-08-08 stsp cmp -s $testroot/stdout.expected $testroot/stdout
505 6841da00 2019-08-08 stsp if [ "$ret" != "0" ]; then
506 6841da00 2019-08-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
508 6841da00 2019-08-08 stsp test_done "$testroot" "$ret"
511 6841da00 2019-08-08 stsp function test_status_cvsignore {
512 6841da00 2019-08-08 stsp local testroot=`test_init status_cvsignore`
514 6841da00 2019-08-08 stsp got checkout $testroot/repo $testroot/wt > /dev/null
516 6841da00 2019-08-08 stsp if [ "$ret" != "0" ]; then
517 6841da00 2019-08-08 stsp test_done "$testroot" "$ret"
521 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/foo
522 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/foop
523 3143d852 2020-06-25 stsp echo "unversioned file" > $testroot/wt/epsilon/foo
524 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/bar
525 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/boo
526 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/moo
527 3143d852 2020-06-25 stsp mkdir -p $testroot/wt/epsilon/new/
528 3143d852 2020-06-25 stsp echo "unversioned file" > $testroot/wt/epsilon/new/foo
529 3143d852 2020-06-25 stsp echo "**/foo" > $testroot/wt/.cvsignore
530 6841da00 2019-08-08 stsp echo "bar" > $testroot/wt/epsilon/.cvsignore
531 6841da00 2019-08-08 stsp echo "moo" >> $testroot/wt/epsilon/.cvsignore
533 6841da00 2019-08-08 stsp echo '? .cvsignore' > $testroot/stdout.expected
534 6841da00 2019-08-08 stsp echo '? epsilon/.cvsignore' >> $testroot/stdout.expected
535 6841da00 2019-08-08 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
536 6841da00 2019-08-08 stsp echo '? foop' >> $testroot/stdout.expected
537 6841da00 2019-08-08 stsp (cd $testroot/wt && got status > $testroot/stdout)
539 3143d852 2020-06-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
541 3143d852 2020-06-25 stsp if [ "$ret" != "0" ]; then
542 3143d852 2020-06-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
543 3143d852 2020-06-25 stsp test_done "$testroot" "$ret"
547 3143d852 2020-06-25 stsp echo '? epsilon/.cvsignore' > $testroot/stdout.expected
548 3143d852 2020-06-25 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
549 3143d852 2020-06-25 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
551 b80270a7 2019-08-08 stsp cmp -s $testroot/stdout.expected $testroot/stdout
553 b80270a7 2019-08-08 stsp if [ "$ret" != "0" ]; then
554 b80270a7 2019-08-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
555 b80270a7 2019-08-08 stsp test_done "$testroot" "$ret"
559 3143d852 2020-06-25 stsp echo -n '' > $testroot/stdout.expected
560 3143d852 2020-06-25 stsp (cd $testroot/wt && got status epsilon/new > $testroot/stdout)
562 3143d852 2020-06-25 stsp cmp -s $testroot/stdout.expected $testroot/stdout
564 3143d852 2020-06-25 stsp if [ "$ret" != "0" ]; then
565 3143d852 2020-06-25 stsp diff -u $testroot/stdout.expected $testroot/stdout
566 3143d852 2020-06-25 stsp test_done "$testroot" "$ret"
570 b80270a7 2019-08-08 stsp echo '? .cvsignore' > $testroot/stdout.expected
571 b80270a7 2019-08-08 stsp echo '? epsilon/.cvsignore' >> $testroot/stdout.expected
572 b80270a7 2019-08-08 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
573 bd8de430 2019-10-04 stsp echo '? foop' >> $testroot/stdout.expected
574 bd8de430 2019-10-04 stsp (cd $testroot/wt/gamma && got status > $testroot/stdout)
576 bd8de430 2019-10-04 stsp cmp -s $testroot/stdout.expected $testroot/stdout
578 bd8de430 2019-10-04 stsp if [ "$ret" != "0" ]; then
579 bd8de430 2019-10-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
581 bd8de430 2019-10-04 stsp test_done "$testroot" "$ret"
584 bd8de430 2019-10-04 stsp function test_status_gitignore {
585 bd8de430 2019-10-04 stsp local testroot=`test_init status_gitignore`
587 bd8de430 2019-10-04 stsp got checkout $testroot/repo $testroot/wt > /dev/null
589 bd8de430 2019-10-04 stsp if [ "$ret" != "0" ]; then
590 bd8de430 2019-10-04 stsp test_done "$testroot" "$ret"
594 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/foo
595 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/foop
596 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/barp
597 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/epsilon/bar
598 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/epsilon/boo
599 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/epsilon/moo
600 bd8de430 2019-10-04 stsp mkdir -p $testroot/wt/a/b/c/
601 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/a/b/c/foo
602 bd8de430 2019-10-04 stsp echo "unversioned file" > $testroot/wt/a/b/c/zoo
603 bd8de430 2019-10-04 stsp echo "foo" > $testroot/wt/.gitignore
604 bd8de430 2019-10-04 stsp echo "bar*" >> $testroot/wt/.gitignore
605 bd8de430 2019-10-04 stsp echo "epsilon/**" >> $testroot/wt/.gitignore
606 bd8de430 2019-10-04 stsp echo "a/**/foo" >> $testroot/wt/.gitignore
607 bd8de430 2019-10-04 stsp echo "**/zoo" >> $testroot/wt/.gitignore
609 bd8de430 2019-10-04 stsp echo '? .gitignore' > $testroot/stdout.expected
610 b80270a7 2019-08-08 stsp echo '? foop' >> $testroot/stdout.expected
611 bd8de430 2019-10-04 stsp (cd $testroot/wt && got status > $testroot/stdout)
613 bd8de430 2019-10-04 stsp cmp -s $testroot/stdout.expected $testroot/stdout
615 bd8de430 2019-10-04 stsp if [ "$ret" != "0" ]; then
616 bd8de430 2019-10-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
617 bd8de430 2019-10-04 stsp test_done "$testroot" "$ret"
621 bd8de430 2019-10-04 stsp echo '? .gitignore' > $testroot/stdout.expected
622 bd8de430 2019-10-04 stsp echo '? foop' >> $testroot/stdout.expected
623 b80270a7 2019-08-08 stsp (cd $testroot/wt/gamma && got status > $testroot/stdout)
625 72ea6654 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
627 72ea6654 2019-07-27 stsp if [ "$ret" != "0" ]; then
628 72ea6654 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
630 72ea6654 2019-07-27 stsp test_done "$testroot" "$ret"
633 35dc4510 2019-02-04 stsp run_test test_status_basic
634 f02ba292 2019-02-05 stsp run_test test_status_subdir_no_mods
635 f02ba292 2019-02-05 stsp run_test test_status_subdir_no_mods2
636 0dbc2271 2019-02-05 stsp run_test test_status_obstructed
637 02c07007 2019-02-10 stsp run_test test_status_shows_local_mods_after_update
638 18831e78 2019-02-10 stsp run_test test_status_unversioned_subdirs
639 00bb5ea0 2020-07-23 stsp run_test test_status_symlink
640 3cbbd752 2019-02-19 stsp run_test test_status_shows_no_mods_after_complete_merge
641 7154f6ce 2019-03-27 stsp run_test test_status_shows_conflict
642 c577a9ce 2019-07-27 stsp run_test test_status_empty_dir
643 c577a9ce 2019-07-27 stsp run_test test_status_empty_dir_unversioned_file
644 72ea6654 2019-07-27 stsp run_test test_status_many_paths
645 6841da00 2019-08-08 stsp run_test test_status_cvsignore
646 bd8de430 2019-10-04 stsp run_test test_status_gitignore