File: 4order.sh

package info (click to toggle)
cssc 1.0.1-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 3,620 kB
  • ctags: 1,424
  • sloc: cpp: 13,500; sh: 4,759; ansic: 2,971; perl: 342; makefile: 342; awk: 11
file content (55 lines) | stat: -rwxr-xr-x 1,371 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#! /bin/sh
# 4order.sh:  Testing for ordering of the components of the comment.

# Import common functions & definitions.
. ../common/test-common

g=testfile
s=s.$g
z=z.$g
x=z.$g
p=p.$g
files="$s $z $x $p"

remove command.log log log.stdout log.stderr base [sxzp].$g


# Create the input file.
cat > $g <<EOF
%M%: This is a test file containing nothing interesting.
EOF

# Create an SCCS file to work on.
docommand O1 "${admin} -i$g $s" 0 "" ""
remove $g


# Set the MR flag
docommand O2 "${admin} -fvtrue $s" 0 "" ""


# Add another MR.   Check the order is correct.
docommand O3 "${cdc} -r1.1 -yahoo '-mMR2 MR3 MR1' $s" 0 "" "" 
docommand O4 "${prs} -r1.1 -d:MR: $s" 0 "MR2\nMR3\nMR1\n\n" "" 

# Make sure that when we add another comment AND delete 
# an MT, the two parts of the comment end up in the 
# correct order.
docommand O5 "${cdc} -r1.1 -yMyExtraComment '-m!MR3' $s" 0 "" ""

remove comment
${prs} -d:C: -r1.1 $s > comment || fail prs failed unexpectedly

docommand O6 "sed -n 1p <comment" 0 "MyExtraComment\n" ""
docommand O7 "sed -n 2p <comment" 0 "*** LIST OF DELETED MRS ***\n" ""
docommand O8 "sed -n 3p <comment" 0 "MR3\n" ""
docommand O9 "sed -n 4p <comment|egrep \
'^\*\*\* CHANGED \*\*\* [0-9][0-9]/[01][0-9]/[0-3][0-9] [012][0-9]:[0-6][0-9]:[0-6][0-9] [^ ][^ ]*$'" 0 "IGNORE" ""


remove comment


remove command.log passwd $s $p $g $z $x
success