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)
37 35dc4510 2019-02-04 stsp echo 'M alpha' > $testroot/stdout.expected
38 2ec1f75b 2019-03-26 stsp echo 'D beta' >> $testroot/stdout.expected
39 35dc4510 2019-02-04 stsp echo '! epsilon/zeta' >> $testroot/stdout.expected
40 35dc4510 2019-02-04 stsp echo '? foo' >> $testroot/stdout.expected
41 d00136be 2019-03-26 stsp echo 'A new' >> $testroot/stdout.expected
43 35dc4510 2019-02-04 stsp (cd $testroot/wt && got status > $testroot/stdout)
45 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
47 e60e7f5b 2019-02-10 stsp if [ "$ret" != "0" ]; then
48 35dc4510 2019-02-04 stsp diff -u $testroot/stdout.expected $testroot/stdout
50 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
53 f02ba292 2019-02-05 stsp function test_status_subdir_no_mods {
54 f02ba292 2019-02-05 stsp local testroot=`test_init status_subdir_no_mods 1`
56 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Basic/
57 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Basic/Targets/
58 f02ba292 2019-02-05 stsp touch $testroot/repo/Basic/Targets/AArch64.cpp
59 f02ba292 2019-02-05 stsp touch $testroot/repo/Basic/Targets.cpp
60 f02ba292 2019-02-05 stsp touch $testroot/repo/Basic/Targets.h
61 f02ba292 2019-02-05 stsp (cd $testroot/repo && git add .)
62 f02ba292 2019-02-05 stsp git_commit $testroot/repo -m "add subdir with files"
64 f02ba292 2019-02-05 stsp got checkout $testroot/repo $testroot/wt > /dev/null
66 e60e7f5b 2019-02-10 stsp if [ "$ret" != "0" ]; then
67 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
71 f02ba292 2019-02-05 stsp touch $testroot/stdout.expected
73 f02ba292 2019-02-05 stsp # This used to erroneously print:
75 f02ba292 2019-02-05 stsp # ! Basic/Targets.cpp
76 f02ba292 2019-02-05 stsp # ? Basic/Targets.cpp
77 f02ba292 2019-02-05 stsp (cd $testroot/wt && got status > $testroot/stdout)
79 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
81 e60e7f5b 2019-02-10 stsp if [ "$ret" != "0" ]; then
82 f02ba292 2019-02-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
84 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
87 f02ba292 2019-02-05 stsp function test_status_subdir_no_mods2 {
88 f02ba292 2019-02-05 stsp local testroot=`test_init status_subdir_no_mods2 1`
90 f02ba292 2019-02-05 stsp mkdir $testroot/repo/AST
91 f02ba292 2019-02-05 stsp touch $testroot/repo/AST/APValue.cpp
92 f02ba292 2019-02-05 stsp mkdir $testroot/repo/ASTMatchers
93 f02ba292 2019-02-05 stsp touch $testroot/repo/ASTMatchers/ASTMatchFinder.cpp
94 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Frontend
95 f02ba292 2019-02-05 stsp touch $testroot/repo/Frontend/ASTConsumers.cpp
96 f02ba292 2019-02-05 stsp mkdir $testroot/repo/Frontend/Rewrite
97 f02ba292 2019-02-05 stsp touch $testroot/repo/Frontend/Rewrite/CMakeLists.txt
98 f02ba292 2019-02-05 stsp mkdir $testroot/repo/FrontendTool
99 f02ba292 2019-02-05 stsp touch $testroot/repo/FrontendTool/CMakeLists.txt
100 f02ba292 2019-02-05 stsp touch $testroot/repo/FrontendTool/ExecuteCompilerInvocation.cpp
101 f02ba292 2019-02-05 stsp (cd $testroot/repo && git add .)
102 f02ba292 2019-02-05 stsp git_commit $testroot/repo -m "add subdir with files"
104 f02ba292 2019-02-05 stsp got checkout $testroot/repo $testroot/wt > /dev/null
106 e60e7f5b 2019-02-10 stsp if [ "$ret" != "0" ]; then
107 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
111 f02ba292 2019-02-05 stsp touch $testroot/stdout.expected
113 f02ba292 2019-02-05 stsp # This used to erroneously print:
115 f02ba292 2019-02-05 stsp # ! AST/APValue.cpp
116 f02ba292 2019-02-05 stsp # ? AST/APValue.cpp
117 f02ba292 2019-02-05 stsp # ! Frontend/ASTConsumers.cpp
118 f02ba292 2019-02-05 stsp # ! Frontend/Rewrite/CMakeLists.txt
119 f02ba292 2019-02-05 stsp # ? Frontend/ASTConsumers.cpp
120 f02ba292 2019-02-05 stsp # ? Frontend/Rewrite/CMakeLists.txt
121 f02ba292 2019-02-05 stsp (cd $testroot/wt && got status > $testroot/stdout)
123 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
125 e60e7f5b 2019-02-10 stsp if [ "$ret" != "0" ]; then
126 f02ba292 2019-02-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
128 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
131 0dbc2271 2019-02-05 stsp function test_status_obstructed {
132 0dbc2271 2019-02-05 stsp local testroot=`test_init status_obstructed`
134 0dbc2271 2019-02-05 stsp got checkout $testroot/repo $testroot/wt > /dev/null
136 e60e7f5b 2019-02-10 stsp if [ "$ret" != "0" ]; then
137 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
141 0dbc2271 2019-02-05 stsp rm $testroot/wt/epsilon/zeta
142 0dbc2271 2019-02-05 stsp mkdir $testroot/wt/epsilon/zeta
144 0dbc2271 2019-02-05 stsp echo '~ epsilon/zeta' > $testroot/stdout.expected
146 0dbc2271 2019-02-05 stsp (cd $testroot/wt && got status > $testroot/stdout)
148 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
150 a062651c 2019-07-27 stsp if [ "$ret" != "0" ]; then
151 0dbc2271 2019-02-05 stsp diff -u $testroot/stdout.expected $testroot/stdout
153 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
156 02c07007 2019-02-10 stsp function test_status_shows_local_mods_after_update {
157 02c07007 2019-02-10 stsp local testroot=`test_init status_shows_local_mods_after_update 1`
159 02c07007 2019-02-10 stsp echo "1" > $testroot/repo/numbers
160 02c07007 2019-02-10 stsp echo "2" >> $testroot/repo/numbers
161 02c07007 2019-02-10 stsp echo "3" >> $testroot/repo/numbers
162 02c07007 2019-02-10 stsp echo "4" >> $testroot/repo/numbers
163 02c07007 2019-02-10 stsp echo "5" >> $testroot/repo/numbers
164 02c07007 2019-02-10 stsp echo "6" >> $testroot/repo/numbers
165 02c07007 2019-02-10 stsp echo "7" >> $testroot/repo/numbers
166 02c07007 2019-02-10 stsp echo "8" >> $testroot/repo/numbers
167 02c07007 2019-02-10 stsp (cd $testroot/repo && git add numbers)
168 02c07007 2019-02-10 stsp git_commit $testroot/repo -m "added numbers file"
170 02c07007 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
172 02c07007 2019-02-10 stsp if [ "$ret" != "0" ]; then
173 02c07007 2019-02-10 stsp test_done "$testroot" "$ret"
177 02c07007 2019-02-10 stsp sed -i 's/2/22/' $testroot/repo/numbers
178 02c07007 2019-02-10 stsp git_commit $testroot/repo -m "modified line 2"
180 02c07007 2019-02-10 stsp # modify line 7; both changes should merge cleanly
181 02c07007 2019-02-10 stsp sed -i 's/7/77/' $testroot/wt/numbers
183 02c07007 2019-02-10 stsp echo "G numbers" > $testroot/stdout.expected
184 02c07007 2019-02-10 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
185 02c07007 2019-02-10 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
186 02c07007 2019-02-10 stsp echo >> $testroot/stdout.expected
188 02c07007 2019-02-10 stsp (cd $testroot/wt && got update > $testroot/stdout)
190 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
192 02c07007 2019-02-10 stsp if [ "$ret" != "0" ]; then
193 02c07007 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
194 02c07007 2019-02-10 stsp test_done "$testroot" "$ret"
198 02c07007 2019-02-10 stsp echo 'M numbers' > $testroot/stdout.expected
200 02c07007 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
202 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
204 02c07007 2019-02-10 stsp if [ "$ret" != "0" ]; then
205 02c07007 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
207 e60e7f5b 2019-02-10 stsp test_done "$testroot" "$ret"
210 18831e78 2019-02-10 stsp function test_status_unversioned_subdirs {
211 18831e78 2019-02-10 stsp local testroot=`test_init status_unversioned_subdirs 1`
213 18831e78 2019-02-10 stsp mkdir $testroot/repo/cdfs/
214 18831e78 2019-02-10 stsp touch $testroot/repo/cdfs/Makefile
215 18831e78 2019-02-10 stsp mkdir $testroot/repo/common/
216 18831e78 2019-02-10 stsp touch $testroot/repo/common/Makefile
217 18831e78 2019-02-10 stsp mkdir $testroot/repo/iso/
218 18831e78 2019-02-10 stsp touch $testroot/repo/iso/Makefile
219 18831e78 2019-02-10 stsp mkdir $testroot/repo/ramdisk/
220 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk/Makefile
221 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk/list.local
222 18831e78 2019-02-10 stsp mkdir $testroot/repo/ramdisk_cd/
223 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk_cd/Makefile
224 18831e78 2019-02-10 stsp touch $testroot/repo/ramdisk_cd/list.local
225 18831e78 2019-02-10 stsp (cd $testroot/repo && git add .)
226 18831e78 2019-02-10 stsp git_commit $testroot/repo -m "first commit"
228 18831e78 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
230 18831e78 2019-02-10 stsp if [ "$ret" != "0" ]; then
231 18831e78 2019-02-10 stsp test_done "$testroot" "$ret"
235 18831e78 2019-02-10 stsp mkdir $testroot/wt/cdfs/obj
236 18831e78 2019-02-10 stsp mkdir $testroot/wt/ramdisk/obj
237 18831e78 2019-02-10 stsp mkdir $testroot/wt/ramdisk_cd/obj
238 18831e78 2019-02-10 stsp mkdir $testroot/wt/iso/obj
240 18831e78 2019-02-10 stsp echo -n > $testroot/stdout.expected
242 18831e78 2019-02-10 stsp # This used to erroneously print:
244 18831e78 2019-02-10 stsp # ! ramdisk_cd/Makefile
245 18831e78 2019-02-10 stsp # ! ramdisk_cd/list.local
246 18831e78 2019-02-10 stsp # ? ramdisk_cd/Makefile
247 18831e78 2019-02-10 stsp # ? ramdisk_cd/list.local
248 18831e78 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
250 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
252 18831e78 2019-02-10 stsp if [ "$ret" != "0" ]; then
253 18831e78 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
255 18831e78 2019-02-10 stsp test_done "$testroot" "$ret"
258 2c201a36 2019-02-10 stsp # 'got status' ignores symlinks at present; this might change eventually
259 2c201a36 2019-02-10 stsp function test_status_ignores_symlink {
260 2c201a36 2019-02-10 stsp local testroot=`test_init status_ignores_symlink 1`
262 2c201a36 2019-02-10 stsp mkdir $testroot/repo/ramdisk/
263 2c201a36 2019-02-10 stsp touch $testroot/repo/ramdisk/Makefile
264 2c201a36 2019-02-10 stsp (cd $testroot/repo && git add .)
265 2c201a36 2019-02-10 stsp git_commit $testroot/repo -m "first commit"
267 2c201a36 2019-02-10 stsp got checkout $testroot/repo $testroot/wt > /dev/null
269 2c201a36 2019-02-10 stsp if [ "$ret" != "0" ]; then
270 2c201a36 2019-02-10 stsp test_done "$testroot" "$ret"
274 2c201a36 2019-02-10 stsp ln -s /usr/obj/distrib/i386/ramdisk $testroot/wt/ramdisk/obj
276 3cbbd752 2019-02-19 stsp echo -n > $testroot/stdout.expected
278 3cbbd752 2019-02-19 stsp (cd $testroot/wt && got status > $testroot/stdout)
280 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
282 3cbbd752 2019-02-19 stsp if [ "$ret" != "0" ]; then
283 3cbbd752 2019-02-19 stsp diff -u $testroot/stdout.expected $testroot/stdout
285 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
288 3cbbd752 2019-02-19 stsp function test_status_shows_no_mods_after_complete_merge {
289 3cbbd752 2019-02-19 stsp local testroot=`test_init status_shows_no_mods_after_complete_merge 1`
291 3cbbd752 2019-02-19 stsp # make this file larger than the usual blob buffer size of 8192
292 3cbbd752 2019-02-19 stsp echo -n > $testroot/repo/numbers
293 3cbbd752 2019-02-19 stsp for i in `jot 16384`; do
294 3cbbd752 2019-02-19 stsp echo "$i" >> $testroot/repo/numbers
297 3cbbd752 2019-02-19 stsp (cd $testroot/repo && git add numbers)
298 3cbbd752 2019-02-19 stsp git_commit $testroot/repo -m "added numbers file"
300 3cbbd752 2019-02-19 stsp got checkout $testroot/repo $testroot/wt > /dev/null
302 3cbbd752 2019-02-19 stsp if [ "$ret" != "0" ]; then
303 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
307 3cbbd752 2019-02-19 stsp sed -i 's/2/22/' $testroot/repo/numbers
308 3cbbd752 2019-02-19 stsp git_commit $testroot/repo -m "modified line 2"
311 3cbbd752 2019-02-19 stsp # modify line 2 again; no local changes are left after merge
312 3cbbd752 2019-02-19 stsp sed -i 's/2/22/' $testroot/wt/numbers
314 3cbbd752 2019-02-19 stsp echo "G numbers" > $testroot/stdout.expected
315 3cbbd752 2019-02-19 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
316 3cbbd752 2019-02-19 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
317 3cbbd752 2019-02-19 stsp echo >> $testroot/stdout.expected
319 3cbbd752 2019-02-19 stsp (cd $testroot/wt && got update > $testroot/stdout)
321 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
323 3cbbd752 2019-02-19 stsp if [ "$ret" != "0" ]; then
324 3cbbd752 2019-02-19 stsp diff -u $testroot/stdout.expected $testroot/stdout
325 3cbbd752 2019-02-19 stsp test_done "$testroot" "$ret"
329 2c201a36 2019-02-10 stsp echo -n > $testroot/stdout.expected
331 2c201a36 2019-02-10 stsp (cd $testroot/wt && got status > $testroot/stdout)
333 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
335 2c201a36 2019-02-10 stsp if [ "$ret" != "0" ]; then
336 2c201a36 2019-02-10 stsp diff -u $testroot/stdout.expected $testroot/stdout
338 2c201a36 2019-02-10 stsp test_done "$testroot" "$ret"
341 7154f6ce 2019-03-27 stsp function test_status_shows_conflict {
342 7154f6ce 2019-03-27 stsp local testroot=`test_init status_shows_conflict 1`
344 7154f6ce 2019-03-27 stsp echo "1" > $testroot/repo/numbers
345 7154f6ce 2019-03-27 stsp echo "2" >> $testroot/repo/numbers
346 7154f6ce 2019-03-27 stsp echo "3" >> $testroot/repo/numbers
347 7154f6ce 2019-03-27 stsp echo "4" >> $testroot/repo/numbers
348 7154f6ce 2019-03-27 stsp echo "5" >> $testroot/repo/numbers
349 7154f6ce 2019-03-27 stsp echo "6" >> $testroot/repo/numbers
350 7154f6ce 2019-03-27 stsp echo "7" >> $testroot/repo/numbers
351 7154f6ce 2019-03-27 stsp echo "8" >> $testroot/repo/numbers
352 7154f6ce 2019-03-27 stsp (cd $testroot/repo && git add numbers)
353 7154f6ce 2019-03-27 stsp git_commit $testroot/repo -m "added numbers file"
355 7154f6ce 2019-03-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
357 7154f6ce 2019-03-27 stsp if [ "$ret" != "0" ]; then
358 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
362 7154f6ce 2019-03-27 stsp sed -i 's/2/22/' $testroot/repo/numbers
363 7154f6ce 2019-03-27 stsp git_commit $testroot/repo -m "modified line 2"
365 7154f6ce 2019-03-27 stsp # modify line 2 in a conflicting way
366 7154f6ce 2019-03-27 stsp sed -i 's/2/77/' $testroot/wt/numbers
368 7154f6ce 2019-03-27 stsp echo "C numbers" > $testroot/stdout.expected
369 7154f6ce 2019-03-27 stsp echo -n "Updated to commit " >> $testroot/stdout.expected
370 7154f6ce 2019-03-27 stsp git_show_head $testroot/repo >> $testroot/stdout.expected
371 7154f6ce 2019-03-27 stsp echo >> $testroot/stdout.expected
373 7154f6ce 2019-03-27 stsp (cd $testroot/wt && got update > $testroot/stdout)
375 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
377 7154f6ce 2019-03-27 stsp if [ "$ret" != "0" ]; then
378 7154f6ce 2019-03-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
379 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
383 7154f6ce 2019-03-27 stsp echo 'C numbers' > $testroot/stdout.expected
385 7154f6ce 2019-03-27 stsp (cd $testroot/wt && got status > $testroot/stdout)
387 c577a9ce 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
389 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
390 c577a9ce 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
392 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
395 c577a9ce 2019-07-27 stsp function test_status_empty_dir {
396 c577a9ce 2019-07-27 stsp local testroot=`test_init status_empty_dir`
398 c577a9ce 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
400 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
401 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
405 c577a9ce 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
407 c577a9ce 2019-07-27 stsp echo '! epsilon/zeta' > $testroot/stdout.expected
409 c577a9ce 2019-07-27 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
411 c577a9ce 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
413 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
414 c577a9ce 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
416 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
419 c577a9ce 2019-07-27 stsp function test_status_empty_dir_unversioned_file {
420 c577a9ce 2019-07-27 stsp local testroot=`test_init status_empty_dir_unversioned_file`
422 c577a9ce 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
424 c577a9ce 2019-07-27 stsp if [ "$ret" != "0" ]; then
425 c577a9ce 2019-07-27 stsp test_done "$testroot" "$ret"
429 c577a9ce 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
430 c577a9ce 2019-07-27 stsp touch $testroot/wt/epsilon/unversioned
432 c577a9ce 2019-07-27 stsp echo '? epsilon/unversioned' > $testroot/stdout.expected
433 c577a9ce 2019-07-27 stsp echo '! epsilon/zeta' >> $testroot/stdout.expected
435 c577a9ce 2019-07-27 stsp (cd $testroot/wt && got status epsilon > $testroot/stdout)
437 8d301dd9 2019-05-14 stsp cmp -s $testroot/stdout.expected $testroot/stdout
439 7154f6ce 2019-03-27 stsp if [ "$ret" != "0" ]; then
440 7154f6ce 2019-03-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
442 7154f6ce 2019-03-27 stsp test_done "$testroot" "$ret"
445 72ea6654 2019-07-27 stsp function test_status_many_paths {
446 72ea6654 2019-07-27 stsp local testroot=`test_init status_many_paths`
448 72ea6654 2019-07-27 stsp got checkout $testroot/repo $testroot/wt > /dev/null
450 72ea6654 2019-07-27 stsp if [ "$ret" != "0" ]; then
451 72ea6654 2019-07-27 stsp test_done "$testroot" "$ret"
455 72ea6654 2019-07-27 stsp echo "modified alpha" > $testroot/wt/alpha
456 72ea6654 2019-07-27 stsp (cd $testroot/wt && got rm beta >/dev/null)
457 72ea6654 2019-07-27 stsp echo "unversioned file" > $testroot/wt/foo
458 72ea6654 2019-07-27 stsp rm $testroot/wt/epsilon/zeta
459 72ea6654 2019-07-27 stsp touch $testroot/wt/beta
460 72ea6654 2019-07-27 stsp echo "new file" > $testroot/wt/new
461 72ea6654 2019-07-27 stsp mkdir $testroot/wt/newdir
462 72ea6654 2019-07-27 stsp (cd $testroot/wt && got add new >/dev/null)
464 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status newdir > $testroot/stdout.expected)
465 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status alpha >> $testroot/stdout.expected)
466 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status epsilon >> $testroot/stdout.expected)
467 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status foo >> $testroot/stdout.expected)
468 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status new >> $testroot/stdout.expected)
469 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status beta >> $testroot/stdout.expected)
470 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status . >> $testroot/stdout.expected)
472 72ea6654 2019-07-27 stsp (cd $testroot/wt && got status newdir alpha epsilon foo new beta . \
473 72ea6654 2019-07-27 stsp > $testroot/stdout)
475 6841da00 2019-08-08 stsp cmp -s $testroot/stdout.expected $testroot/stdout
477 6841da00 2019-08-08 stsp if [ "$ret" != "0" ]; then
478 6841da00 2019-08-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
480 6841da00 2019-08-08 stsp test_done "$testroot" "$ret"
483 6841da00 2019-08-08 stsp function test_status_cvsignore {
484 6841da00 2019-08-08 stsp local testroot=`test_init status_cvsignore`
486 6841da00 2019-08-08 stsp got checkout $testroot/repo $testroot/wt > /dev/null
488 6841da00 2019-08-08 stsp if [ "$ret" != "0" ]; then
489 6841da00 2019-08-08 stsp test_done "$testroot" "$ret"
493 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/foo
494 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/foop
495 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/bar
496 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/boo
497 6841da00 2019-08-08 stsp echo "unversioned file" > $testroot/wt/epsilon/moo
498 6841da00 2019-08-08 stsp echo "foo" > $testroot/wt/.cvsignore
499 6841da00 2019-08-08 stsp echo "bar" > $testroot/wt/epsilon/.cvsignore
500 6841da00 2019-08-08 stsp echo "moo" >> $testroot/wt/epsilon/.cvsignore
502 6841da00 2019-08-08 stsp echo '? .cvsignore' > $testroot/stdout.expected
503 6841da00 2019-08-08 stsp echo '? epsilon/.cvsignore' >> $testroot/stdout.expected
504 6841da00 2019-08-08 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
505 6841da00 2019-08-08 stsp echo '? foop' >> $testroot/stdout.expected
506 6841da00 2019-08-08 stsp (cd $testroot/wt && got status > $testroot/stdout)
508 b80270a7 2019-08-08 stsp cmp -s $testroot/stdout.expected $testroot/stdout
510 b80270a7 2019-08-08 stsp if [ "$ret" != "0" ]; then
511 b80270a7 2019-08-08 stsp diff -u $testroot/stdout.expected $testroot/stdout
512 b80270a7 2019-08-08 stsp test_done "$testroot" "$ret"
516 b80270a7 2019-08-08 stsp echo '? .cvsignore' > $testroot/stdout.expected
517 b80270a7 2019-08-08 stsp echo '? epsilon/.cvsignore' >> $testroot/stdout.expected
518 b80270a7 2019-08-08 stsp echo '? epsilon/boo' >> $testroot/stdout.expected
519 b80270a7 2019-08-08 stsp echo '? foop' >> $testroot/stdout.expected
520 b80270a7 2019-08-08 stsp (cd $testroot/wt/gamma && got status > $testroot/stdout)
522 72ea6654 2019-07-27 stsp cmp -s $testroot/stdout.expected $testroot/stdout
524 72ea6654 2019-07-27 stsp if [ "$ret" != "0" ]; then
525 72ea6654 2019-07-27 stsp diff -u $testroot/stdout.expected $testroot/stdout
527 72ea6654 2019-07-27 stsp test_done "$testroot" "$ret"
530 35dc4510 2019-02-04 stsp run_test test_status_basic
531 f02ba292 2019-02-05 stsp run_test test_status_subdir_no_mods
532 f02ba292 2019-02-05 stsp run_test test_status_subdir_no_mods2
533 0dbc2271 2019-02-05 stsp run_test test_status_obstructed
534 02c07007 2019-02-10 stsp run_test test_status_shows_local_mods_after_update
535 18831e78 2019-02-10 stsp run_test test_status_unversioned_subdirs
536 2c201a36 2019-02-10 stsp run_test test_status_ignores_symlink
537 3cbbd752 2019-02-19 stsp run_test test_status_shows_no_mods_after_complete_merge
538 7154f6ce 2019-03-27 stsp run_test test_status_shows_conflict
539 c577a9ce 2019-07-27 stsp run_test test_status_empty_dir
540 c577a9ce 2019-07-27 stsp run_test test_status_empty_dir_unversioned_file
541 72ea6654 2019-07-27 stsp run_test test_status_many_paths
542 6841da00 2019-08-08 stsp run_test test_status_cvsignore