chiark / gitweb /
make bible-kjv-text recommend bible-kjv rather than depend on it (fix for #626321)
[bible-kjv.git] / testall
1 #!/bin/sh
2 ###############################################################################
3 #
4 # File:         testall
5 # RCS:          $Header: /home/matthew/cvs/bible-kjv-4.10/testall,v 2.0 2003/01/08 15:29:52 matthew Exp $
6 # Description:  Test file for Bible software
7 # Author:       Chip Chapin, Hewlett Packard Company
8 # Created:      Wed Aug 30 15:42:35 1989
9 # Modified:     Mon Oct  2 22:32:14 1989 (Chip Chapin) chip@hpcllz2
10 # Language:     Bourne Shell
11 # Package:      Bible Retrieval System
12 # Status:       Experimental (Do Not Distribute)
13 #
14 # $Log: testall,v $
15 # Revision 2.0  2003/01/08 15:29:52  matthew
16 # versions collected from the net
17 #
18 # Revision 1.8  89/10/02  22:41:36  22:41:36  chip (Chip Chapin)
19 # *** empty log message ***
20
21 # Revision 1.7  89/10/02  22:24:45  22:24:45  chip (Chip Chapin)
22 # Revised to print command string prior to each test.
23 # New tests for -l bugs, and for blank-line-after-verse-range.
24
25 # Revision 1.6  89/09/14  20:34:26  20:34:26  chip (Chip Chapin)
26 # Release 1-2.  Supports -f and -l options for formatting the output.
27 # Updates primarily brl.c, bible.c, and bible.1.
28
29 # Revision 1.5  89/09/13  21:50:22  21:50:22  chip (Chip Chapin)
30 # Implement -f and -l options.
31
32 # Revision 1.4  89/09/11  17:37:03  17:37:03  chip (Chip Chapin)
33 # Fix bug in auto-checking.
34
35 # Revision 1.3  89/09/08  13:23:44  13:23:44  chip (Chip Chapin)
36 # Better error checking on verse syntax; automatic test suite.
37
38 # Revision 1.2  89/09/08  09:01:44  09:01:44  chip (Chip Chapin)
39 # Bug fix and simplification: send whole input lines or arguments to BRL,
40 # and let BRL worry about multiple references.  We don't care.
41
42 # Revision 1.1  89/09/05  17:50:00  17:50:00  chip (Chip Chapin)
43 # Initial revision
44
45 #
46 ###############################################################################
47
48 P=./bible
49 T=/tmp/list$$
50 T2=/tmp/bible.dump$$
51 trap "/bin/rm -f $T1 $T2; exit" 0 1 3
52
53 PROG()
54 {
55         echo "\n$P $*"
56         $P $@
57 }
58
59 cat <<-EOF >$T
60         ge1:1 ex1:1 lev1:1 num1:1 deut1:1 jos1:1 jdg1:1 ruth1:1 1sa1:1 2sa1:1
61         1ki1:1 2ki1:1 1ch1:1 2ch1:1 ezr1:1 neh1:1 est1:1 job1:1 ps1:1 pr1:1
62         ecc1:1 so1:1 is1:1 jer1:1 lam1:1 eze1:1 dan1:1 hos1:1 joe1:1 amo1:1 
63         ob1:1 jon1:1 mic1:1 nah1:1 hab1:1 zep1:1 hag1:1 zec1:1 mal1:1
64         mt1:1 mk1:1 lu1:1 jn1:1 acts1:1 ro1:1 1co1:1 2co1:1 gal1:1 eph1:1
65         php1:1 col1:1 1th1:1 2th1:1 1ti1:1 2ti1:1 ti1:1 phm1:1 he1:1
66         jas1:1 1pe1:1 2pe1:1 1jn1:1 2jn1:1 3jn1:1 jude1:1 rev1:1
67 EOF
68
69
70 echo "Basic command tests"
71 PROG jn3:16
72 PROG <<-EOF
73         jn3:16
74         
75         
76 EOF
77 PROG < $T
78 PROG -m0 jn3:16
79 PROG -m 1 jn3:16
80 PROG -d bible.data -p". /usr/local/lib" jn3:16
81 PROG -f jn4
82 PROG -f jn4 jn5
83 PROG -f -l 66 jn4
84 PROG -fl66 jn4
85 PROG -l jn4
86 PROG -l66 -f jn4
87 PROG -l66 jn4
88 PROG -fl jn4
89 PROG -lf jn4
90 PROG -l 2peter
91 PROG -l 2 2peter
92 PROG -l 1 2peter
93 PROG -l 10 2peter
94 PROG -l1 2peter
95 PROG -l0 2peter
96 PROG -fl0 2peter
97
98 echo "\n\nVerse Reference Syntax tests"
99 PROG <<-EOF 
100         jn3:16,17
101         jn 3:16 17
102         jn 3:16 17
103         jn3-4
104         jn-4
105         jn-1:4
106 EOF
107 echo "\nBad Syntax tests"
108 PROG <<-EOF     
109         jn:
110         jn :
111 EOF
112
113 echo "\n\nPretty Printing tests"
114 PROG -fl66 <<-EOF
115         gen
116         jn
117         gen2
118         jn2
119         job1-5
120         
121         
122 EOF
123 PROG -f <<-EOF
124         jn3
125         
126         
127         2peter1:1-5
128         
129         
130 EOF
131 PROG <<-EOF
132         jn3
133         
134         
135         2peter1:1-5
136         
137         
138 EOF
139
140 echo "\n\nBad command option tests"
141 echo PROG -m
142 PROG -m
143 echo PROG -m foobar
144 PROG -m foobar
145 echo PROG -mfoobar
146 PROG -mfoobar
147 echo PROG -d
148 PROG -d
149 echo PROG -d foobar
150 PROG -d foobar
151 echo PROG -dfoobar
152 PROG -dfoobar
153 echo PROG -p
154 PROG -p
155 echo PROG -p foobar
156 PROG -p foobar
157 echo PROG -pfoobar
158 PROG -pfoobar
159
160
161 # BUFFER tests
162 # Assumes that the window size on the bible data is 64k
163 #
164 echo "\n\nTests with one buffer"
165 PROG -m1 ge1:1 ps1:1 mt1:1 mt1:1 ge1:1 ps1:1
166 PROG -m1 <$T
167
168 echo "\n\nTests with two buffers"
169 PROG -m130  ge1:1 ps1:1 mt1:1 mt1:1 ge1:1 ps1:1
170 PROG -m 130 <$T
171
172 echo "\n\nTests with three buffers"
173 PROG -m 200 ge1:1 ps1:1 mt1:1 mt1:1 ge1:1 ps1:1
174 PROG -m200 <$T
175
176 # dump whole file
177 echo "\n\nDumping whole bible.  Watch the line count, head and tail"
178 PROG gen1:1-rev99:99 > $T2
179 wc    < $T2
180 head -4 $T2
181 tail -4 $T2
182
183 echo "\n\nTests completed"
184 exit
185 #
186
187
188