3 #-----------------------------------------------------------------------
4 # Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #-----------------------------------------------------------------------
24 # generic initialization
28 trap "rm -f /tmp/$$.; exit" 0 1 2 3 15
35 SRC_GROUPS=`find tests -not -path tests -type d -printf "%f "`
38 echo "Usage $0 test_dir"
39 echo "Available dirs are: $SRC_GROUPS"
47 if [ ! -f $tdir/group ]
49 echo "Creating the $tdir/group index ..."
50 cat <<'End-of-File' >$tdir/group
53 # define groups and default group owners
54 # do not start group name with a digit
61 # test-group association ... one line per test
66 if [ ! -w $tdir/group ]
69 echo "Warning: making the index file \"$tdir/group\" writeable"
76 echo "Warning: make failed -- some tests may be missing"
82 [ -f "$tdir/group" ] || usage
84 for found in `cat $tdir/group | $AWK_PROG '{ print $1 }'`
87 if [ -z "$found" ] || [ "$found" == "#" ];then
92 if [ "$id" != "$found" ];then
97 if [ $eof -eq 1 ]; then
100 id=`printf "%03d" $i`
103 echo "Next test is $id"
107 echo "Error: test $id already exists!"
112 echo -n "Creating skeletal script for you to edit ..."
116 cat <<End-of-File >$tdir/$id
120 # what am I here for?
122 #-----------------------------------------------------------------------
123 # Copyright (c) $year YOUR NAME HERE. All Rights Reserved.
125 # This program is free software; you can redistribute it and/or
126 # modify it under the terms of the GNU General Public License as
127 # published by the Free Software Foundation.
129 # This program is distributed in the hope that it would be useful,
130 # but WITHOUT ANY WARRANTY; without even the implied warranty of
131 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
132 # GNU General Public License for more details.
134 # You should have received a copy of the GNU General Public License
135 # along with this program; if not, write the Free Software Foundation,
136 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
137 #-----------------------------------------------------------------------
141 seqres=\$RESULT_DIR/\$seq
142 echo "QA output created by \$seq"
146 status=1 # failure is the default!
147 trap "_cleanup; exit \\\$status" 0 1 2 3 15
155 # get standard environment, filters and checks
159 # real QA test starts here
161 # Modify as appropriate.
162 _supported_fs generic
163 _supported_os IRIX Linux
169 # optional stuff if your test has verbose output to help resolve problems
171 #echo "If failure, check \$seqres.full (this) and \$seqres.full.ok (reference)"
178 sleep 2 # latency to read messages to this point
182 ${EDITOR-vi} $tdir/$id
189 echo -n "Add to group(s) [other] (? for list): "
191 [ -z "$ans" ] && ans=other
192 if [ "X$ans" = "X?" ]
194 for d in $SRC_GROUPS; do
195 l=$(sed -n < tests/$d/group \
198 -e 's;\(^[0-9][0-9][0-9]\)\(.*$\);\2;p')
201 lst=`for word in $grpl; do echo $word; done | sort| uniq `
208 # expert mode, groups are on the command line
212 if grep "^$g[ ]" $tdir/group >/dev/null
216 echo "Warning: group \"$g\" not defined in $tdir/group"
222 echo -n "Adding $id to group index ..."
223 head -n $(($line-1)) $tdir/group > /tmp/$$.group
224 echo "$id $ans" >> /tmp/$$.group
225 tail -n +$((line)) $tdir/group >> /tmp/$$.group
226 mv /tmp/$$.group $tdir/group