3 # Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of version 2 of the GNU General Public License as
7 # published by the Free Software Foundation.
9 # This program is distributed in the hope that it would be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 # Further, this software is distributed without any warranty that it is
14 # free of the rightful claim of any third person regarding infringement
15 # or the like. Any license provided herein, whether implied or
16 # otherwise, applies only to this software file. Patent licenses, if
17 # any, provided herein do not apply to combinations of this program with
18 # other software, or any other product whatsoever.
20 # You should have received a copy of the GNU General Public License along
21 # with this program; if not, write the Free Software Foundation, Inc., 59
22 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
24 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
25 # Mountain View, CA 94043, or:
29 # For further information regarding this notice, see:
31 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
33 # common procedures for QA scripts
35 # $Header: /disk7/depot/linux/pcp/dev/qa/RCS/common,v 2.52 2000/04/05 18:24:51 kenmcd Exp $
52 if $MAKE_PROG >/tmp/$$.gmake 2>&1
57 echo "Warning: $MAKE_PROG failed -- some tests may be missing"
64 if [ ! -z "$DISPLAY" ]
66 which xdiff >/dev/null 2>&1 && diff=xdiff
67 which gdiff >/dev/null 2>&1 && diff=gdiff
68 which tkdiff >/dev/null 2>&1 && diff=tkdiff
69 which xxdiff >/dev/null 2>&1 && diff=xxdiff
79 rm -f $tmp.list $tmp.tmp $tmp.sed
89 group_list=`sed -n <group -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{
92 if [ -z "$group_list" ]
94 echo "Group \"$r\" is empty or not defined?"
97 [ ! -s $tmp.list ] && touch $tmp.list
100 if grep -s "^$t\$" $tmp.list >/dev/null
104 echo "$t" >>$tmp.list
113 [ ! -s $tmp.list ] && ls [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] >$tmp.list 2>/dev/null
114 group_list=`sed -n <group -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{
117 if [ -z "$group_list" ]
119 echo "Group \"$r\" is empty or not defined?"
126 if [ $numsed -gt 100 ]
128 sed -f $tmp.sed <$tmp.list >$tmp.tmp
129 mv $tmp.tmp $tmp.list
133 echo "/^$t\$/d" >>$tmp.sed
134 numsed=`expr $numsed + 1`
136 sed -f $tmp.sed <$tmp.list >$tmp.tmp
137 mv $tmp.tmp $tmp.list
147 echo "Usage: $0 [options] [testlist]"'
156 -g group[,group...] include tests from these groups
157 -l line mode diff [xdiff]
158 -n show me, do not run tests
159 -q quick, no checks (you are on your own)
161 -x group[,group...] exclude tests from these groups
167 -udf) # -udf ... set FSTYP to udf
172 -xfs) # -xfs ... set FSTYP to xfs
177 -nfs) # -nfs ... set FSTYP to nfs
182 -g) # -g group ... pick from group file
187 -l) # line mode for diff, not gdiff over modems
192 -q) # "quick", no checks (you are on your own)
197 -n) # show me, don't do it
202 -T) # turn on timestamp output
211 -x) # -x group ... exclude from group file
215 '[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]')
222 eval `echo $r | sed -e 's/^/start=/' -e 's/-/ end=/'`
226 eval `echo $r | sed -e 's/^/start=/' -e 's/-//'`
227 end=`echo [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] | sed -e 's/\[0-9]//g' -e 's/ *$//' -e 's/.* //'`
230 echo "No tests in range \"$r\"?"
243 # get rid of leading 0s as can be interpreted as octal
244 start=`echo $start | sed 's/^0*//'`
245 end=`echo $end | sed 's/^0*//'`
250 $AWK_PROG </dev/null '
251 BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \
254 if grep -s "^$id " group >/dev/null
256 # in group file ... OK
259 if [ -f expunged ] && $expunge && egrep "^$id([ ]|\$)" expunged >/dev/null
261 # expunged ... will be reported, but not run, later
265 echo "$id - unknown test, ignored"
275 # found some valid test numbers ... this is good
280 # had test numbers, but none in group file ... do nothing
283 # no test numbers, do everything from group file
284 sed -n -e '/^[0-9][0-9][0-9]*/s/[ ].*//p' <group >$tmp.list
288 # should be sort -n, but this did not work for Linux when this
289 # was ported from IRIX
291 list=`sort $tmp.list`
292 rm -f $tmp.list $tmp.tmp $tmp.sed
299 if ( cd src; $MAKE_PROG -is)
304 echo ":----------------------------------------------"
305 echo ": Warning: $MAKE_PROG failed in src -- some tests may fail as a result"
306 echo ":----------------------------------------------"
315 [ "$XFS_LOGPRINT_PROG" = "" ] && _fatal "xfs_logprint not found"
316 [ "$XFS_REPAIR_PROG" = "" ] && _fatal "xfs_repair not found"
317 [ "$XFS_CHECK_PROG" = "" ] && _fatal "xfs_check not found"
318 [ "$XFS_DB_PROG" = "" ] && _fatal "xfs_db not found"
319 [ "$MKFS_XFS_PROG" = "" ] && _fatal "mkfs_xfs not found"
322 [ "$MKFS_UDF_PROG" = "" ] && _fatal "mkfs_udf/mkudffs not found"