]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/dialog/samples/run_test.sh
Import DTS files from Linux 5.0
[FreeBSD/FreeBSD.git] / contrib / dialog / samples / run_test.sh
1 #!/bin/sh
2 # $Id: run_test.sh,v 1.4 2017/02/01 01:50:09 tom Exp $
3 # vile:ts=4 sw=4
4 THIS=`basename $0`
5
6 if [ -z "$DIALOG" ]
7 then
8         have=
9         want=dialog
10         for p in . .. ../bin
11         do
12                 prog=$p/$want
13                 [ -f $prog ] || continue
14                 if [ -x $prog ]
15                 then
16                         have=$prog
17                         break
18                 fi
19         done
20
21         if [ -z "$have" ]
22         then
23                 echo "? did not find $want" >&2
24                 exit
25         fi
26
27         DIALOG=$have
28         export DIALOG
29 fi
30
31 want=`basename $DIALOG`
32
33 DIALOGOPTS="$DIALOGOPTS --trace $want.log"
34 export DIALOGOPTS
35
36 mylog=run_test.log
37 cat >$mylog <<EOF
38 ** `date`
39 EOF
40
41 for name in "$@"
42 do
43         [ -f "$name" ] || continue
44         [ -x "$name" ] || continue
45         # skip this script and known utility-scripts
46         case `basename $name` in
47         $THIS|dft-*|killall|listing|rotated-data|shortlist|with-*)
48                 echo "** skipping $name" >>$mylog
49                 continue
50                 ;;
51         esac
52         rm -f trace $want.log $name.log
53         echo "** running $name" >>$mylog
54         $name
55         [ -f $want.log ] && cp $want.log $name.log
56 done