qa: update 660 to generate index.html, fixing pcp-testsuite runs
[pcp.git] / qa / check-group
blob9f77d6df1284619a961f99265467a54005b47b9b
1 #!/bin/sh
3 # Check group file and qa scripts for a specific pcp command ($1)
5 # $1 is assumed to be _both_ the name of a command that appears in
6 # the QA scripts (or part of a command, e.g. purify in _setup_purify)
7 # and the name of a group in the group file
10 tmp=/var/tmp/$$
11 trap "rm -f $tmp.*; exit 0" 0 1 2 3 15
13 if [ $# -ne 1 ]
14 then
15 echo "Usage: $0 pcp-app"
16 exit 1
19 touch $tmp.tmp
20 for seq in [0-9][0-9][0-9] [0-9][0-9][0-9][0-9]
22 if grep -q "^$seq[: ]" group
23 then
25 else
26 echo "$seq: Error: file exists but missing from group"
28 # special control lines
29 # check-group-include: group ..
30 # check-group-exclude: group ..
31 grep '# check-group-' $seq >$tmp.chk
32 if [ -s $tmp.chk ]
33 then
34 if egrep "check-group-include:.* $1( |\$)" <$tmp.chk >/dev/null
35 then
36 #debug# echo "$seq: explicit include"
37 echo $seq >>$tmp.tmp
38 continue
40 if egrep "check-group-exclude:.* $1( |\$)" <$tmp.chk >/dev/null
41 then
42 #debug# echo "$seq: explicit exclude"
43 continue
46 ( grep -v '^#' $seq \
47 | egrep -q "(^$1([ \'\"]|$))|([ /\'\"_]$1([ \'\"_]|$))" ) && echo $seq >>$tmp.tmp
48 done
50 sed <group -e '/^$/d' -e '/^[^0-9]/d' -e 's/[: ].*//' \
51 | while read seq
53 [ -f "$seq" ] && continue
54 echo "$seq: Error: in group but file not found"
55 done
57 sort -o $tmp.scripts $tmp.tmp
59 check -r -n -g "$1" | sort \
60 | while read f
62 [ -f "$f" ] && echo "$f"
63 done >$tmp.group
65 comm -23 $tmp.scripts $tmp.group >$tmp.tmp
66 if [ -s $tmp.tmp ]
67 then
68 echo "$1 in QA scripts and NOT in group ..."
69 sort -n $tmp.tmp | sed -e 's/^/ /'
70 echo
73 comm -13 $tmp.scripts $tmp.group >$tmp.tmp
74 if [ -s $tmp.tmp ]
75 then
76 echo "$1 in group and NOT in QA scripts ..."
77 sort -n $tmp.tmp | sed -e 's/^/ /'
80 comm -12 $tmp.scripts $tmp.group >$tmp.tmp
81 echo "$1 in group and QA scripts `wc -l <$tmp.tmp | sed -e 's/ //g'` times"