t40c term[] count fix
[minix.git] / usr.bin / make / unit-tests / test.exp
blob932d84e305a6862e76619815d30a68bcc5431d75
1 comment testing start
2 this is foo
3 This is how a comment looks: # comment
4 comment testing done
5 make: "cond1" line 75: warning: extra else
6 make: "cond1" line 85: warning: extra else
7 2 is prime
8 A='other' B='unknown' C='clever' o='no,no'
9 Passed:
10 var
11 ("var")
12 (var != var)
13 var != var
14 !((var != var) && defined(name))
15 var == quoted
17 1 is not prime
18 2 is prime
19 3 is prime
20 4 is not prime
21 5 is prime
23 make: warning: String comparison operator should be either == or !=
24 make: Bad conditional expression `"0" > 0' in "0" > 0?OK:No
27 make: "error" line 3: just FYI
28 make: "error" line 4: warning: this could be serious
29 make: "error" line 5: this is fatal
30 UT_DOLLAR=This is $UT_FU
31 UT_FOO=foobar is fubar
32 UT_FU=fubar
33 UT_TEST=export
34 UT_ZOO=hoopie
35 UT_ALL=even this gets exported
36 UT_BADDIR=unit-tests
37 UT_DOLLAR=This is $UT_FU
38 UT_F=fine
39 UT_FOO=foobar is fubar
40 UT_FU=fubar
41 UT_NO=all
42 UT_OK=good
43 UT_OKDIR=unit-tests
44 UT_TEST=export-all
45 UT_ZOO=hoopie
46 At first, I am
47 happy
48 and now: sad
49 .ERROR: Looks like 'sad' is upset.
50 *** Error code 1
52 Stop.
53 make: stopped in unit-tests
54 simple.1
55 simple.1
56 simple.2
57 simple.2
58 recursive.1.1.*
59 recursive.1.1.*
60 recursive.1.1.*
61 recursive.1.1.*
62 recursive.1.99
63 recursive.1.99
64 recursive.2.1.*
65 recursive.2.1.*
66 recursive.2.1.*
67 recursive.2.1.*
68 recursive.2.99
69 recursive.2.99
70 shared.0
71 shared.0
72 shared.1.99
73 shared.1.99
74 shared.2.1
75 shared.2.1
76 shared.2.99
77 shared.2.99
78 make: Graph cycles through `cycle.2.99'
79 make: Graph cycles through `cycle.2.98'
80 make: Graph cycles through `cycle.2.97'
81 cycle.1.99
82 cycle.1.99
83 x=one
84 x="two and three"
85 x=four
86 x="five"
87 x=-I/this
88 x=-I"This or that"
89 x=-Ithat
90 x="-DTHIS=\"this and that\""
91 cfl=-I/this -I"This or that" -Ithat "-DTHIS=\"this and that\""
92 a=one b="two and three"
93 a=four b="five"
94 a=ONE b="TWO AND THREE"
95 a=FOUR b="FIVE"
96 We expect an error next:
97 make: "forloop" line 38: Wrong number of words (9) in .for substitution list with 2 vars
98 make: Fatal errors encountered -- cannot continue
99 make: stopped in unit-tests
101 .for with :S;... OK
102 b2af338b
103 3360ac65
104 7747f046
105 9ca87054
106 880fe816
107 208fcbd3
108 d5d376eb
109 de41416c
110 Expect: Unknown modifier 'Z'
111 make: Unknown modifier 'Z'
112 VAR:Z=
113 Expect: Unknown modifier 'Z'
114 make: Unknown modifier 'Z'
115 VAR:Z=
116 Expect: Unclosed variable specification for VAR
117 make: Unclosed variable specification (expecting '}') for "VAR" (value "Thevariable") modifier S
118 VAR:S,V,v,=Thevariable
119 Expect: Unclosed variable specification for VAR
120 make: Unclosed variable specification after complex modifier (expecting '}') for VAR
121 VAR:S,V,v,=Thevariable
122 Expect: Unclosed substitution for VAR (, missing)
123 make: Unclosed substitution for VAR (, missing)
124 VAR:S,V,v=
125 LIB=a X_LIBS:M${LIB${LIB:tu}} is "/tmp/liba.a"
126 LIB=a X_LIBS:M*/lib${LIB}.a is "/tmp/liba.a"
127 LIB=a X_LIBS:M*/lib${LIB}.a:tu is "/TMP/LIBA.A"
128 LIB=b X_LIBS:M${LIB${LIB:tu}} is ""
129 LIB=b X_LIBS:M*/lib${LIB}.a is ""
130 LIB=b X_LIBS:M*/lib${LIB}.a:tu is ""
131 LIB=c X_LIBS:M${LIB${LIB:tu}} is ""
132 LIB=c X_LIBS:M*/lib${LIB}.a is ""
133 LIB=c X_LIBS:M*/lib${LIB}.a:tu is ""
134 LIB=d X_LIBS:M${LIB${LIB:tu}} is "/tmp/libd.a"
135 LIB=d X_LIBS:M*/lib${LIB}.a is "/tmp/libd.a"
136 LIB=d X_LIBS:M*/lib${LIB}.a:tu is "/TMP/LIBD.A"
137 LIB=e X_LIBS:M${LIB${LIB:tu}} is "/tmp/libe.a"
138 LIB=e X_LIBS:M*/lib${LIB}.a is "/tmp/libe.a"
139 LIB=e X_LIBS:M*/lib${LIB}.a:tu is "/TMP/LIBE.A"
140 Mscanner=OK
141 path=':/bin:/tmp::/:.:/no/such/dir:.'
142 path='/bin:/tmp:/:/no/such/dir'
143 path='/bin:/tmp:/:/no/such/dir'
144 path='/bin':'/tmp':'/':'/no/such/dir'
145 path='/bin':'/tmp':'/':'/no/such/dir'
146 path_/usr/xbin=/opt/xbin/
147 paths=/bin /tmp / /no/such/dir /opt/xbin
148 PATHS=/BIN /TMP / /NO/SUCH/DIR /OPT/XBIN
149 The answer is 42
150 LIST = one two three four five six seven eight nine ten
151 LIST:O = eight five four nine one seven six ten three two
152 LIST:Ox = Ok
153 LIST:O:Ox = Ok
154 LISTX = Ok
155 LISTSX = Ok
156 make: Bad modifier `:OX' for LIST
157 BADMOD 1 = }
158 make: Bad modifier `:OxXX' for LIST
159 BADMOD 2 = XX}
160 LIST="one two three four five six"
161 LIST:ts,="one,two,three,four,five,six"
162 LIST:ts/:tu="ONE/TWO/THREE/FOUR/FIVE/SIX"
163 LIST:ts::tu="ONE:TWO:THREE:FOUR:FIVE:SIX"
164 LIST:ts:tu="ONETWOTHREEFOURFIVESIX"
165 LIST:tu:ts/="ONE/TWO/THREE/FOUR/FIVE/SIX"
166 LIST:ts:="one:two:three:four:five:six"
167 LIST:ts="onetwothreefourfivesix"
168 LIST:ts:S/two/2/="one2threefourfivesix"
169 LIST:S/two/2/:ts="one2threefourfivesix"
170 LIST:ts/:S/two/2/="one/2/three/four/five/six"
171 Pretend the '/' in '/n' etc. below are back-slashes.
172 LIST:ts/n="one
174 three
175 four
176 five
177 six"
178 LIST:ts/t="one two three four five six"
179 LIST:ts/012:tu="ONE
181 THREE
182 FOUR
183 FIVE
184 SIX"
185 make: Bad modifier `:tx' for LIST
186 LIST:tx="}"
187 make: Bad modifier `:ts\x' for LIST
188 LIST:ts/x:tu="\x:tu}"
189 FU_mod-ts="a/b/cool"
190 FU_mod-ts:ts:T="cool" == cool?
191 B.${AAA:ts}="Baaa" == Baaa?
192 make: Bad modifier `:[]' for LIST
193 LIST:[]="" is an error
194 LIST:[0]="one two three four five six"
195 LIST:[0x0]="one two three four five six"
196 LIST:[000]="one two three four five six"
197 LIST:[*]="one two three four five six"
198 LIST:[@]="one two three four five six"
199 LIST:[0]:C/ /,/="one,two three four five six"
200 LIST:[0]:C/ /,/g="one,two,three,four,five,six"
201 LIST:[0]:C/ /,/1g="one,two,three,four,five,six"
202 LIST:[*]:C/ /,/="one,two three four five six"
203 LIST:[*]:C/ /,/g="one,two,three,four,five,six"
204 LIST:[*]:C/ /,/1g="one,two,three,four,five,six"
205 LIST:[@]:C/ /,/="one two three four five six"
206 LIST:[@]:C/ /,/g="one two three four five six"
207 LIST:[@]:C/ /,/1g="one two three four five six"
208 LIST:[@]:[0]:C/ /,/="one,two three four five six"
209 LIST:[0]:[@]:C/ /,/="one two three four five six"
210 LIST:[@]:[*]:C/ /,/="one,two three four five six"
211 LIST:[*]:[@]:C/ /,/="one two three four five six"
212 EMPTY=""
213 EMPTY:[#]="1" == 1 ?
214 ESCAPEDSPACE="\ "
215 ESCAPEDSPACE:[#]="1" == 1 ?
216 REALLYSPACE=" "
217 REALLYSPACE:[#]="1" == 1 ?
218 LIST:[#]="6"
219 LIST:[0]:[#]="1" == 1 ?
220 LIST:[*]:[#]="1" == 1 ?
221 LIST:[@]:[#]="6"
222 LIST:[1]:[#]="1"
223 LIST:[1..3]:[#]="3"
224 EMPTY:[1]=""
225 ESCAPEDSPACE="\ "
226 ESCAPEDSPACE:[1]="\ "
227 REALLYSPACE=" "
228 REALLYSPACE:[1]="" == "" ?
229 REALLYSPACE:[*]:[1]=" " == " " ?
230 LIST:[1]="one"
231 make: Bad modifier `:[1.]' for LIST
232 LIST:[1.]="" is an error
233 make: Bad modifier `:[1].' for LIST
234 LIST:[1].="}" is an error
235 LIST:[2]="two"
236 LIST:[6]="six"
237 LIST:[7]=""
238 LIST:[999]=""
239 make: Bad modifier `:[-]' for LIST
240 LIST:[-]="" is an error
241 make: Bad modifier `:[--]' for LIST
242 LIST:[--]="" is an error
243 LIST:[-1]="six"
244 LIST:[-2]="five"
245 LIST:[-6]="one"
246 LIST:[-7]=""
247 LIST:[-999]=""
248 LONGLIST:[17]="17"
249 LONGLIST:[0x11]="17"
250 LONGLIST:[021]="17"
251 LIST:[0]:[1]="one two three four five six"
252 LIST:[*]:[1]="one two three four five six"
253 LIST:[@]:[1]="one"
254 LIST:[0]:[2]=""
255 LIST:[*]:[2]=""
256 LIST:[@]:[2]="two"
257 LIST:[*]:C/ /,/:[2]=""
258 LIST:[*]:C/ /,/:[*]:[2]=""
259 LIST:[*]:C/ /,/:[@]:[2]="three"
260 make: Bad modifier `:[1.]' for LIST
261 LIST:[1.]="" is an error
262 make: Bad modifier `:[1..]' for LIST
263 LIST:[1..]="" is an error
264 LIST:[1..1]="one"
265 make: Bad modifier `:[1..1.]' for LIST
266 LIST:[1..1.]="" is an error
267 LIST:[1..2]="one two"
268 LIST:[2..1]="two one"
269 LIST:[3..-2]="three four five"
270 LIST:[-4..4]="three four"
271 make: Bad modifier `:[0..1]' for LIST
272 LIST:[0..1]="" is an error
273 make: Bad modifier `:[-1..0]' for LIST
274 LIST:[-1..0]="" is an error
275 LIST:[-1..1]="six five four three two one"
276 LIST:[0..0]="one two three four five six"
277 LIST:[3..99]="three four five six"
278 LIST:[-3..-99]="four three two one"
279 LIST:[-99..-3]="one two three four"
280 HASH="#" == "#" ?
281 LIST:[${HASH}]="6"
282 LIST:[${ZERO}]="one two three four five six"
283 LIST:[${ZERO}x${ONE}]="one"
284 LIST:[${ONE}]="one"
285 LIST:[${MINUSONE}]="six"
286 LIST:[${STAR}]="one two three four five six"
287 LIST:[${AT}]="one two three four five six"
288 make: Bad modifier `:[${EMPTY' for LIST
289 LIST:[${EMPTY}]="" is an error
290 LIST:[${LONGLIST:[21]:S/2//}]="one"
291 LIST:[${LIST:[#]}]="six"
292 LIST:[${LIST:[${HASH}]}]="six"
293 LIST:S/ /,/="one two three four five six"
294 LIST:S/ /,/W="one,two three four five six"
295 LIST:S/ /,/gW="one,two,three,four,five,six"
296 EMPTY:S/^/,/=","
297 EMPTY:S/^/,/W=","
298 LIST:C/ /,/="one two three four five six"
299 LIST:C/ /,/W="one,two three four five six"
300 LIST:C/ /,/gW="one,two,three,four,five,six"
301 EMPTY:C/^/,/=","
302 EMPTY:C/^/,/W=","
303 LIST:tW="one two three four five six"
304 LIST:tw="one two three four five six"
305 LIST:tW:C/ /,/="one,two three four five six"
306 LIST:tW:C/ /,/g="one,two,three,four,five,six"
307 LIST:tW:C/ /,/1g="one,two,three,four,five,six"
308 LIST:tw:C/ /,/="one two three four five six"
309 LIST:tw:C/ /,/g="one two three four five six"
310 LIST:tw:C/ /,/1g="one two three four five six"
311 LIST:tw:tW:C/ /,/="one,two three four five six"
312 LIST:tW:tw:C/ /,/="one two three four five six"
313 .TARGET="phony" .PREFIX="phony" .IMPSRC=""
314 .TARGET="all" .PREFIX="all" .IMPSRC=""
315 .TARGET="ok" .PREFIX="ok" .IMPSRC=""
316 .TARGET="also.ok" .PREFIX="also.ok" .IMPSRC=""
317 .TARGET="bug" .PREFIX="bug" .IMPSRC=""
318 Posix says we should execute the command as if run by system(3)
319 Expect 'Hello,' and 'World!'
320 Hello,
321 World!
322 a command
323 a command prefixed by '+' executes even with -n
324 another command
325 make -n
326 echo a command
327 echo "a command prefixed by '+' executes even with -n"
328 a command prefixed by '+' executes even with -n
329 echo another command
330 make -n -j1
331 { echo a command
332 } || exit $?
333 echo "a command prefixed by '+' executes even with -n"
334 a command prefixed by '+' executes even with -n
335 { echo another command
336 } || exit $?
337 Now we expect an error...
338 *** Error code 1 (continuing)
339 `all' not remade because of errors.
340 V.i386 ?= OK
341 FOOBAR =
342 FOOBAR = foobar fubar
346 In the Sun
347 The answer is unknown
348 The answer is unknown
349 The answer is empty
350 The answer is known
351 The answer is
352 The answer is empty
353 The answer is known
354 The answer is 42
355 The answer is 42
356 UT_DOLLAR=This is $UT_FU
357 UT_FU=fubar
358 UT_TEST=unexport
359 UT_TEST=unexport-env
360 default FU=<v>fu</v> FOO=<v>foo</v> VAR=<v></v>
361 two FU=<v>bar</v> FOO=<v>goo</v> VAR=<v></v>
362 three FU=<v>bar</v> FOO=<v>goo</v> VAR=<v></v>
363 four FU=<v>bar</v> FOO=<v>goo</v> VAR=<v>Internal</v>
364 five FU=<v>bar</v> FOO=<v>goo</v> VAR=<v>Internal</v>
365 five v=is x k=is x
366 six v=is y k=is y
367 show-v v=override k=override
368 *** Error code 1 (ignored)
369 *** Error code 1 (ignored)