freebsd-src/contrib/dialog/samples/run_test.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
922 B
Bash
Raw Normal View History

2018-10-20 20:32:57 +00:00
#!/bin/sh
# $Id: run_test.sh,v 1.5 2019/12/10 23:54:52 tom Exp $
2018-10-20 20:32:57 +00:00
# vile:ts=4 sw=4
THIS=`basename "$0"`
2018-10-20 20:32:57 +00:00
if [ -z "$DIALOG" ]
then
have=
want=dialog
for p in . .. ../bin
do
prog=$p/$want
[ -f $prog ] || continue
if [ -x $prog ]
then
have=$prog
break
fi
done
if [ -z "$have" ]
then
echo "? did not find $want" >&2
exit
fi
DIALOG=$have
export DIALOG
fi
want=`basename $DIALOG`
DIALOGOPTS="$DIALOGOPTS --trace $want.log"
export DIALOGOPTS
mylog=run_test.log
cat >$mylog <<EOF
** `date`
EOF
for name in "$@"
do
[ -f "$name" ] || continue
[ -x "$name" ] || continue
# skip this script and known utility-scripts
case `basename "$name"` in
2018-10-20 20:32:57 +00:00
$THIS|dft-*|killall|listing|rotated-data|shortlist|with-*)
echo "** skipping $name" >>$mylog
continue
;;
esac
rm -f trace "$want.log" "$name.log"
2018-10-20 20:32:57 +00:00
echo "** running $name" >>$mylog
$name
[ -f "$want.log" ] && cp "$want.log" "$name.log"
2018-10-20 20:32:57 +00:00
done