1#! /bin/sh
2
3# Basic tests for SCCS flag -N
4
5# Read test core functions
6. ../../common/test-common
7
8g=foo
9s=s.$g
10p=p.$g
11z=z.$g
12g2=foo2
13s2=s.$g2
14p2=p.$g2
15z2=z.$g2
16
17remove $z $s $p $g $z2 $s2 $p2 $g2 XXXX a
18
19echo '%M%' > $g
20echo '%M%' > $g2
21
22docommand ad_bulk1 "${admin} -NXXXX -n $g $g2" 0 "" ""
23remove XXXX
24docommand ad_bulk2 "${admin} -NXXXX -i. $g $g2" 0 "" ""
25docommand ad_bulk3 "${admin} -NXXXX -fb $g $g2" 0 "" ""
26docommand ad_bulk4 "${prs}  -d:FL: XXXX/$s XXXX/$s2" 0 "branch\n\nbranch\n\n" ""
27docommand ad_bulk5 "${admin} -NXXXX -db $g $g2" 0 "" ""
28docommand ad_bulk6 "${prs}  -d:FL: XXXX/$s XXXX/$s2" 0 "\n\n" ""
29remove XXXX
30
31docommand ad_bulk11 "${admin} -N -n $g $g2" 0 "" ""
32remove $s $s2
33docommand ad_bulk12 "${admin} -N -i. $g $g2" 0 "" ""
34docommand ad_bulk13 "${admin} -N -fb $g $g2" 0 "" ""
35docommand ad_bulk14 "${prs}  -d:FL: $s $s2" 0 "branch\n\nbranch\n\n" ""
36docommand ad_bulk15 "${admin} -N -db $g $g2" 0 "" ""
37docommand ad_bulk16 "${prs}  -d:FL: $s $s2" 0 "\n\n" ""
38remove $s $s2
39
40docommand ad_bulk21 "${admin} -Ns. -n $s $s2" 0 "" ""
41remove $s $s2
42docommand ad_bulk22 "${admin} -Ns. -i. $s $s2" 0 "" ""
43docommand ad_bulk23 "${admin} -Ns. -fb $s $s2" 0 "" ""
44docommand ad_bulk24 "${prs}  -d:FL: $s $s2" 0 "branch\n\nbranch\n\n" ""
45docommand ad_bulk25 "${admin} -Ns. -db $s $s2" 0 "" ""
46docommand ad_bulk26 "${prs}  -d:FL: $s $s2" 0 "\n\n" ""
47remove $s $s2
48
49docommand ad_bulk31 "${admin} -NXXXX/s. -n XXXX/$s XXXX/$s2" 0 "" ""
50remove XXXX
51docommand ad_bulk32 "${admin} -NXXXX/s. -i. XXXX/$s XXXX/$s2" 0 "" ""
52docommand ad_bulk33 "${admin} -NXXXX/s. -fb XXXX/$s XXXX/$s2" 0 "" ""
53docommand ad_bulk34 "${prs}  -d:FL: XXXX/$s XXXX/$s2" 0 "branch\n\nbranch\n\n" ""
54docommand ad_bulk35 "${admin} -NXXXX/s. -db XXXX/$s XXXX/$s2" 0 "" ""
55docommand ad_bulk36 "${prs}  -d:FL: XXXX/$s XXXX/$s2" 0 "\n\n" ""
56
57docommand ad_bulk51 "${admin} -NXXXX -fy -n a/b/c/$g a/b/c/$g2" 0 "" ""
58if [ ! -r a/b/c/XXXX/$s ] || [ ! -r a/b/c/XXXX/$s2 ] ; then
59	fail "SCCS admin did not create a/b/c/XXXX/$s or a/b/c/XXXX/$s2"
60fi
61remove a
62
63docommand ad_bulk52 "${admin} -N -fy -n a/b/c/$g a/b/c/$g2" 0 "" ""
64if [ ! -r a/b/c/$s ] || [ ! -r a/b/c/$s2 ] ; then
65	fail "SCCS admin did not create a/b/c/$s or a/b/c/$s2"
66fi
67remove a
68
69docommand ad_bulk53 "${admin} -Ns. -fy -n a/b/c/$s a/b/c/$s2" 0 "" ""
70if [ ! -r a/b/c/$s ] || [ ! -r a/b/c/$s2 ] ; then
71	fail "SCCS admin did not create a/b/c/$s or a/b/c/$s2"
72fi
73remove a
74
75docommand ad_bulk54 "${admin} -NXXXX/s. -fy -n a/b/c/XXXX/$s a/b/c/XXXX/$s2" 0 "" ""
76if [ ! -r a/b/c/XXXX/$s ] || [ ! -r a/b/c/XXXX/$s2 ] ; then
77	fail "SCCS admin did not create a/b/c/XXXX/$s or a/b/c/XXXX/$s2"
78fi
79remove a
80
81
82remove $z $s $p $g $z2 $s2 $p2 $g2 XXXX a
83success
84