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