See ChangeLog: Tue Oct 26 20:03:44 CEST 1999 Werner Koch
[gnupg.git] / checks / defs.inc
1 # definitions for the check scripts
2
3 #--------------------------------
4 #------ constants ---------------
5 #--------------------------------
6
7 # Note that usrpass1 is also used in Makefile.am
8 usrname1="one"
9 usrpass1="def"
10 usrname2="two"
11 usrpass2=""
12 usrname3="three"
13 usrpass3="abc"
14
15
16 dsa_usrname1="pgp5"
17 # we use the sub key because we do not yet have the logic to
18 # to derive the first encryption key from a keyblock (I guess)
19 dsa_usrname2="0xCB879DE9"
20
21 dsa_keyrings="--keyring ./pubring.pkr --secret-keyring ./secring.skr"
22
23
24 plain_files="plain-1 plain-2 plain-3"
25 data_files="data-500 data-9000 data-32000 data-80000"
26 exp_files=""
27
28 # The testscripts expect the original language
29 LANG=
30 LANGUAGE=
31 LC_ALL=
32
33 #--------------------------------
34 #------ utility functions -------
35 #--------------------------------
36
37 fatal () {
38     echo "$pgmname: fatal:" $* >&2
39     exit 1;
40 }
41
42 error () {
43     echo "$pgmname:" $* >&2
44     exit 1
45 }
46
47 info () {
48     echo "$pgmname:" $* >&2
49 }
50
51 chdir () {
52     cd $1 || fatal "cannot cd to $1"
53 }
54
55 echo_n_init=no
56 echo_n () {
57   if test "$echo_n_init" = "no"; then
58     if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
59       if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
60         echo_n_n=
61         echo_n_c='
62 '
63       else
64         echo_n_n='-n'
65         echo_n_c=
66       fi
67     else
68       echo_n_n=
69       echo_n_c='\c'
70     fi
71     echo_n_init=yes
72   fi
73   echo $echo_n_n "${1}$echo_n_c"
74 }
75
76
77 #cleanup () {
78 #    rm $cleanup_files 2>/dev/null || true
79 #    echo "#empty" >./options
80 #}
81
82
83 #add_cleanup () {
84 #    cleanup_files="$cleanup_files $*"
85 #}
86
87
88 have_hash_algo () {
89   if  ../g10/gpg --homedir .  --version | grep "Hash:.*$1" >/dev/null
90   then
91         true
92   else
93         false
94   fi
95 }
96
97 set -e
98 pgmname=`basename $0`
99 #trap cleanup SIGHUP SIGINT SIGQUIT
100
101 [ -z "$srcdir" ] && fatal "not called from make"
102
103 cat <<EOF  >./options
104 no-greeting
105 no-secmem-warning
106 load-extension ../cipher/tiger
107 batch
108 EOF
109