3 # CkTestDB -- see if this dialect is has been tested
5 # This script builds a line from config.flags in the form of lines in
6 # ./TestDB, (See Add2TestDB.)
8 # It then compares the line to TestDB. If the line is found, the script
9 # exits. if the line is not found, the script issues a warning and requests
10 # a go-ahead confirmation.
12 # The script will exit 0 if the test line is in the DB or the go-ahead
13 # confirmation is positive.
15 # $Id: CkTestDB,v 1.2 2002/04/19 11:54:00 abe Exp $
17 # Check for config.flags.
19 if test ! -r config.cflags
21 echo "$0: no ./config.cflags file"
25 # Check for a current data base file.
29 echo "$0: no ./TestDB file"
33 # Form a data base line.
36 for i in `sort < config.cflags`
38 w=`echo $i | sed 's/^-D//'`
47 # See if the line is already in the data base. Exit with success (0), if it is.
49 grep "^$new\$" TestDB > /dev/null 2>&1
55 # This dialect may never have been validated with the test suite.
57 # If the standard input is not a TTY, quit, because no interaction
60 tty -s > /dev/null 2>&1
64 echo "This suite has not been validated on:"
71 # Establish trap and stty handling.
74 trap '$ISIG; exit 1' 1 2 3 15
75 stty -a 2>&1 | grep isig > /dev/null
78 stty -a 2>&1 | egrep -e -isig > /dev/null
86 # Establish echo type -- Berkeley or SYSV.
89 if test "X$j" = "X-n "
98 # Display a validation warning.
100 cat << .CAT_MARK > /dev/tty
102 ==================================================================
106 This dialect or its particular version may not have been validated
107 with the lsof test suite. Consequently some tests may fail or may
110 This is the computed identity of this dialect, not found in the
111 test data base file, ./TestDB:
114 echo " $new" > /dev/tty
119 echo $EO "Do you want to continue (y|n) [n]? $EC" > /dev/tty
121 if test "X$ANS" = "Xn" -o "X$ANS" = "XN"
125 if test "X$ANS" = "Xy" -o "X$ANS" = "XY"
129 echo "Please answer y or n." > /dev/tty
133 # Should never get here!
135 echo "$0: unexpected failure!"