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 2c201a36 2019-02-10 stsp # 'got status' ignores symlinks at present; this might change eventually
262 2c201a36 2019-02-10 stsp function test_status_ignores_symlink {
263 2c201a36 2019-02-10 stsp local testroot=`test_init status_ignores_symlink 1`
265 2c201a36 2019-02-10 stsp mkdir $testroot/repo/ramdisk/
266 2c201a36 2019-02-10 stsp touch $testroot/repo/ramdisk/Makefile
267 2c201a36 2019-02-10 stsp (cd $testroot/repo && git add .)
268 2c201a36 2019-02-10 stsp git_commit $testroot/repo -m "first commit"
270 2c201a36 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
272 2c201a36 2019-02-10 stsp if [ "$ret" != "0" ]; then
273 2c201a36 2019-02-10 stsp test_done "$testroot" "$ret"
277 2c201a36 2019-02-10 stsp ln -s /usr/obj/distrib/i386/ramdisk $testroot/wt/ramdisk/obj
279 3cbbd752 2019-02-19 stsp echo -n > $testroot/stdout.expected
281 3cbbd752 2019-02-19 stsp (cd $testroot/wt && got status > $testroot/stdout)
283 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
285 3cbbd752 2019-02-19 stsp if [ "$ret" != "0" ]; then
286 3cbbd752 2019-02-19 stsp diff -u $testroot/stdout.expected $testroot/stdout
288 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
291 3cbbd752 2019-02-19 stsp function test_status_shows_no_mods_after_complete_merge {
292 3cbbd752 2019-02-19 stsp local testroot=`test_init status_shows_no_mods_after_complete_merge 1`
294 3cbbd752 2019-02-19 stsp # make this file larger than the usual blob buffer size of 8192
295 3cbbd752 2019-02-19 stsp echo -n > $testroot/repo/numbers
296 3cbbd752 2019-02-19 stsp for i in `jot 16384`; do
297 3cbbd752 2019-02-19 stsp echo "$i" >> $testroot/repo/numbers
300 3cbbd752 2019-02-19 stsp (cd $testroot/repo && git add numbers)
301 3cbbd752 2019-02-19 stsp git_commit $testroot/repo -m "added numbers file"
303 3cbbd752 2019-02-19 stsp got checkout $testroot/repo $testroot/wt > /dev/null
305 3cbbd752 2019-02-19 stsp if [ "$ret" != "0" ]; then
306 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
310 3cbbd752 2019-02-19 stsp sed -i 's/2/22/' $testroot/repo/numbers
311 3cbbd752 2019-02-19 stsp git_commit $testroot/repo -m "modified line 2"
314 3cbbd752 2019-02-19 stsp # modify line 2 again; no local changes are left after merge
315 3cbbd752 2019-02-19 stsp sed -i 's/2/22/' $testroot/wt/numbers
317 3cbbd752 2019-02-19 stsp echo "G numbers" > $testroot/stdout.expected
318 3cbbd752 2019-02-19 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
319 3cbbd752 2019-02-19 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
320 3cbbd752 2019-02-19 stsp echo >> $testroot/stdout.expected
322 3cbbd752 2019-02-19 stsp (cd $testroot/wt && got update > $testroot/stdout)
324 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
326 3cbbd752 2019-02-19 stsp if [ "$ret" != "0" ]; then
327 3cbbd752 2019-02-19 stsp diff -u $testroot/stdout.expected $testroot/stdout
328 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
332 2c201a36 2019-02-10 stsp echo -n > $testroot/stdout.expected
334 2c201a36 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
336 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
338 2c201a36 2019-02-10 stsp if [ "$ret" != "0" ]; then
339 2c201a36 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
341 2c201a36 2019-02-10 stsp test_done "$testroot" "$ret"
344 7154f6ce 2019-03-27 stsp function test_status_shows_conflict {
345 7154f6ce 2019-03-27 stsp local testroot=`test_init status_shows_conflict 1`
347 7154f6ce 2019-03-27 stsp echo "1" > $testroot/repo/numbers
348 7154f6ce 2019-03-27 stsp echo "2" >> $testroot/repo/numbers
349 7154f6ce 2019-03-27 stsp echo "3" >> $testroot/repo/numbers
350 7154f6ce 2019-03-27 stsp echo "4" >> $testroot/repo/numbers
351 7154f6ce 2019-03-27 stsp echo "5" >> $testroot/repo/numbers
352 7154f6ce 2019-03-27 stsp echo "6" >> $testroot/repo/numbers
353 7154f6ce 2019-03-27 stsp echo "7" >> $testroot/repo/numbers
354 7154f6ce 2019-03-27 stsp echo "8" >> $testroot/repo/numbers
355 7154f6ce 2019-03-27 stsp (cd $testroot/repo && git add numbers)
356 7154f6ce 2019-03-27 stsp git_commit $testroot/repo -m "added numbers file"
358 7154f6ce 2019-03-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
360 7154f6ce 2019-03-27 stsp if [ "$ret" != "0" ]; then
361 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
365 7154f6ce 2019-03-27 stsp sed -i 's/2/22/' $testroot/repo/numbers
366 7154f6ce 2019-03-27 stsp git_commit $testroot/repo -m "modified line 2"
368 7154f6ce 2019-03-27 stsp # modify line 2 in a conflicting way
369 7154f6ce 2019-03-27 stsp sed -i 's/2/77/' $testroot/wt/numbers
371 7154f6ce 2019-03-27 stsp echo "C numbers" > $testroot/stdout.expected
372 7154f6ce 2019-03-27 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
373 7154f6ce 2019-03-27 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
374 7154f6ce 2019-03-27 stsp echo >> $testroot/stdout.expected
376 7154f6ce 2019-03-27 stsp (cd $testroot/wt && got update > $testroot/stdout)
378 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
380 7154f6ce 2019-03-27 stsp if [ "$ret" != "0" ]; then
381 7154f6ce 2019-03-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
382 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
386 7154f6ce 2019-03-27 stsp echo 'C numbers' > $testroot/stdout.expected
388 7154f6ce 2019-03-27 stsp (cd $testroot/wt && got status > $testroot/stdout)
390 c577a9ce 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
392 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
393 c577a9ce 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
395 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
398 c577a9ce 2019-07-27 stsp function test_status_empty_dir {
399 c577a9ce 2019-07-27 stsp local testroot=`test_init status_empty_dir`
401 c577a9ce 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
403 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
404 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
408 c577a9ce 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
410 c577a9ce 2019-07-27 stsp echo '! epsilon/zeta' > $testroot/stdout.expected
412 c577a9ce 2019-07-27 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
414 c577a9ce 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
416 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
417 c577a9ce 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
419 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
422 c577a9ce 2019-07-27 stsp function test_status_empty_dir_unversioned_file {
423 c577a9ce 2019-07-27 stsp local testroot=`test_init status_empty_dir_unversioned_file`
425 c577a9ce 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
427 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
428 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
432 c577a9ce 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
433 c577a9ce 2019-07-27 stsp touch $testroot/wt/epsilon/unversioned
435 c577a9ce 2019-07-27 stsp echo '? epsilon/unversioned' > $testroot/stdout.expected
436 c577a9ce 2019-07-27 stsp echo '! epsilon/zeta' >> $testroot/stdout.expected
438 c577a9ce 2019-07-27 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
440 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
442 7154f6ce 2019-03-27 stsp if [ "$ret" != "0" ]; then
443 7154f6ce 2019-03-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
445 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
448 72ea6654 2019-07-27 stsp function test_status_many_paths {
449 72ea6654 2019-07-27 stsp local testroot=`test_init status_many_paths`
451 72ea6654 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
453 72ea6654 2019-07-27 stsp if [ "$ret" != "0" ]; then
454 72ea6654 2019-07-27 stsp test_done "$testroot" "$ret"
458 72ea6654 2019-07-27 stsp echo "modified alpha" > $testroot/wt/alpha
459 72ea6654 2019-07-27 stsp (cd $testroot/wt && got rm beta >/dev/null)
460 72ea6654 2019-07-27 stsp echo "unversioned file" > $testroot/wt/foo
461 72ea6654 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
462 72ea6654 2019-07-27 stsp touch $testroot/wt/beta
463 72ea6654 2019-07-27 stsp echo "new file" > $testroot/wt/new
464 72ea6654 2019-07-27 stsp mkdir $testroot/wt/newdir
465 72ea6654 2019-07-27 stsp (cd $testroot/wt && got add new >/dev/null)
467 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status newdir > $testroot/stdout.expected)
468 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status alpha >> $testroot/stdout.expected)
469 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status epsilon >> $testroot/stdout.expected)
470 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status foo >> $testroot/stdout.expected)
471 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status new >> $testroot/stdout.expected)
472 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status beta >> $testroot/stdout.expected)
473 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status . >> $testroot/stdout.expected)
475 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status newdir alpha epsilon foo new beta . \
476 72ea6654 2019-07-27 stsp > $testroot/stdout)
478 6841da00 2019-08-08 stsp cmp -s $testroot/stdout.expected $testroot/stdout
480 6841da00 2019-08-08 stsp if [ "$ret" != "0" ]; then
481 6841da00 2019-08-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
483 6841da00 2019-08-08 stsp test_done "$testroot" "$ret"
486 6841da00 2019-08-08 stsp function test_status_cvsignore {
487 6841da00 2019-08-08 stsp local testroot=`test_init status_cvsignore`
489 6841da00 2019-08-08 stsp got checkout $testroot/repo $testroot/wt > /dev/null
491 6841da00 2019-08-08 stsp if [ "$ret" != "0" ]; then
492 6841da00 2019-08-08 stsp test_done "$testroot" "$ret"
496 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/foo
497 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/foop
498 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/bar
499 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/boo
500 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/moo
501 6841da00 2019-08-08 stsp echo "foo" > $testroot/wt/.cvsignore
502 6841da00 2019-08-08 stsp echo "bar" > $testroot/wt/epsilon/.cvsignore
503 6841da00 2019-08-08 stsp echo "moo" >> $testroot/wt/epsilon/.cvsignore
505 6841da00 2019-08-08 stsp echo '? .cvsignore' > $testroot/stdout.expected
506 6841da00 2019-08-08 stsp echo '? epsilon/.cvsignore' >> $testroot/stdout.expected
507 6841da00 2019-08-08 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
508 6841da00 2019-08-08 stsp echo '? foop' >> $testroot/stdout.expected
509 6841da00 2019-08-08 stsp (cd $testroot/wt && got status > $testroot/stdout)
511 b80270a7 2019-08-08 stsp cmp -s $testroot/stdout.expected $testroot/stdout
513 b80270a7 2019-08-08 stsp if [ "$ret" != "0" ]; then
514 b80270a7 2019-08-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
515 b80270a7 2019-08-08 stsp test_done "$testroot" "$ret"
519 b80270a7 2019-08-08 stsp echo '? .cvsignore' > $testroot/stdout.expected
520 b80270a7 2019-08-08 stsp echo '? epsilon/.cvsignore' >> $testroot/stdout.expected
521 b80270a7 2019-08-08 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
522 b80270a7 2019-08-08 stsp echo '? foop' >> $testroot/stdout.expected
523 b80270a7 2019-08-08 stsp (cd $testroot/wt/gamma && got status > $testroot/stdout)
525 72ea6654 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
527 72ea6654 2019-07-27 stsp if [ "$ret" != "0" ]; then
528 72ea6654 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
530 72ea6654 2019-07-27 stsp test_done "$testroot" "$ret"
533 35dc4510 2019-02-04 stsp run_test test_status_basic
534 f02ba292 2019-02-05 stsp run_test test_status_subdir_no_mods
535 f02ba292 2019-02-05 stsp run_test test_status_subdir_no_mods2
536 0dbc2271 2019-02-05 stsp run_test test_status_obstructed
537 02c07007 2019-02-10 stsp run_test test_status_shows_local_mods_after_update
538 18831e78 2019-02-10 stsp run_test test_status_unversioned_subdirs
539 2c201a36 2019-02-10 stsp run_test test_status_ignores_symlink
540 3cbbd752 2019-02-19 stsp run_test test_status_shows_no_mods_after_complete_merge
541 7154f6ce 2019-03-27 stsp run_test test_status_shows_conflict
542 c577a9ce 2019-07-27 stsp run_test test_status_empty_dir
543 c577a9ce 2019-07-27 stsp run_test test_status_empty_dir_unversioned_file
544 72ea6654 2019-07-27 stsp run_test test_status_many_paths
545 6841da00 2019-08-08 stsp run_test test_status_cvsignore