vm: change NO_MEM to a more impossible value
[minix.git] / usr.bin / make / unit-tests / test.exp
blobcbb2912a081e3370b13910b04381154a57aa9ed9
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 .for with :S;... OK
84 b2af338b
85 3360ac65
86 7747f046
87 9ca87054
88 880fe816
89 208fcbd3
90 d5d376eb
91 de41416c
92 Expect: Unknown modifier 'Z'
93 make: Unknown modifier 'Z'
94 VAR:Z=
95 Expect: Unknown modifier 'Z'
96 make: Unknown modifier 'Z'
97 VAR:Z=
98 Expect: Unclosed variable specification for VAR
99 make: Unclosed variable specification (expecting '}') for "VAR" (value "Thevariable") modifier S
100 VAR:S,V,v,=Thevariable
101 Expect: Unclosed variable specification for VAR
102 make: Unclosed variable specification after complex modifier (expecting '}') for VAR
103 VAR:S,V,v,=Thevariable
104 Expect: Unclosed substitution for VAR (, missing)
105 make: Unclosed substitution for VAR (, missing)
106 VAR:S,V,v=
107 LIB=a X_LIBS:M${LIB${LIB:tu}} is "/tmp/liba.a"
108 LIB=a X_LIBS:M*/lib${LIB}.a is "/tmp/liba.a"
109 LIB=a X_LIBS:M*/lib${LIB}.a:tu is "/TMP/LIBA.A"
110 LIB=b X_LIBS:M${LIB${LIB:tu}} is ""
111 LIB=b X_LIBS:M*/lib${LIB}.a is ""
112 LIB=b X_LIBS:M*/lib${LIB}.a:tu is ""
113 LIB=c X_LIBS:M${LIB${LIB:tu}} is ""
114 LIB=c X_LIBS:M*/lib${LIB}.a is ""
115 LIB=c X_LIBS:M*/lib${LIB}.a:tu is ""
116 LIB=d X_LIBS:M${LIB${LIB:tu}} is "/tmp/libd.a"
117 LIB=d X_LIBS:M*/lib${LIB}.a is "/tmp/libd.a"
118 LIB=d X_LIBS:M*/lib${LIB}.a:tu is "/TMP/LIBD.A"
119 LIB=e X_LIBS:M${LIB${LIB:tu}} is "/tmp/libe.a"
120 LIB=e X_LIBS:M*/lib${LIB}.a is "/tmp/libe.a"
121 LIB=e X_LIBS:M*/lib${LIB}.a:tu is "/TMP/LIBE.A"
122 Mscanner=OK
123 path=':/bin:/tmp::/:.:/no/such/dir:.'
124 path='/bin:/tmp:/:/no/such/dir'
125 path='/bin:/tmp:/:/no/such/dir'
126 path='/bin':'/tmp':'/':'/no/such/dir'
127 path='/bin':'/tmp':'/':'/no/such/dir'
128 path_/usr/xbin=/opt/xbin/
129 paths=/bin /tmp / /no/such/dir /opt/xbin
130 PATHS=/BIN /TMP / /NO/SUCH/DIR /OPT/XBIN
131 The answer is 42
132 LIST = one two three four five six seven eight nine ten
133 LIST:O = eight five four nine one seven six ten three two
134 LIST:Ox = Ok
135 LIST:O:Ox = Ok
136 LISTX = Ok
137 LISTSX = Ok
138 make: Bad modifier `:OX' for LIST
139 BADMOD 1 = }
140 make: Bad modifier `:OxXX' for LIST
141 BADMOD 2 = XX}
142 LIST="one two three four five six"
143 LIST:ts,="one,two,three,four,five,six"
144 LIST:ts/:tu="ONE/TWO/THREE/FOUR/FIVE/SIX"
145 LIST:ts::tu="ONE:TWO:THREE:FOUR:FIVE:SIX"
146 LIST:ts:tu="ONETWOTHREEFOURFIVESIX"
147 LIST:tu:ts/="ONE/TWO/THREE/FOUR/FIVE/SIX"
148 LIST:ts:="one:two:three:four:five:six"
149 LIST:ts="onetwothreefourfivesix"
150 LIST:ts:S/two/2/="one2threefourfivesix"
151 LIST:S/two/2/:ts="one2threefourfivesix"
152 LIST:ts/:S/two/2/="one/2/three/four/five/six"
153 Pretend the '/' in '/n' etc. below are back-slashes.
154 LIST:ts/n="one
156 three
157 four
158 five
159 six"
160 LIST:ts/t="one two three four five six"
161 LIST:ts/012:tu="ONE
163 THREE
164 FOUR
165 FIVE
166 SIX"
167 make: Bad modifier `:tx' for LIST
168 LIST:tx="}"
169 make: Bad modifier `:ts\x' for LIST
170 LIST:ts/x:tu="\x:tu}"
171 FU_mod-ts="a/b/cool"
172 FU_mod-ts:ts:T="cool" == cool?
173 B.${AAA:ts}="Baaa" == Baaa?
174 make: Bad modifier `:[]' for LIST
175 LIST:[]="" is an error
176 LIST:[0]="one two three four five six"
177 LIST:[0x0]="one two three four five six"
178 LIST:[000]="one two three four five six"
179 LIST:[*]="one two three four five six"
180 LIST:[@]="one two three four five six"
181 LIST:[0]:C/ /,/="one,two three four five six"
182 LIST:[0]:C/ /,/g="one,two,three,four,five,six"
183 LIST:[0]:C/ /,/1g="one,two,three,four,five,six"
184 LIST:[*]:C/ /,/="one,two three four five six"
185 LIST:[*]:C/ /,/g="one,two,three,four,five,six"
186 LIST:[*]:C/ /,/1g="one,two,three,four,five,six"
187 LIST:[@]:C/ /,/="one two three four five six"
188 LIST:[@]:C/ /,/g="one two three four five six"
189 LIST:[@]:C/ /,/1g="one two three four five six"
190 LIST:[@]:[0]:C/ /,/="one,two three four five six"
191 LIST:[0]:[@]:C/ /,/="one two three four five six"
192 LIST:[@]:[*]:C/ /,/="one,two three four five six"
193 LIST:[*]:[@]:C/ /,/="one two three four five six"
194 EMPTY=""
195 EMPTY:[#]="1" == 1 ?
196 ESCAPEDSPACE="\ "
197 ESCAPEDSPACE:[#]="1" == 1 ?
198 REALLYSPACE=" "
199 REALLYSPACE:[#]="1" == 1 ?
200 LIST:[#]="6"
201 LIST:[0]:[#]="1" == 1 ?
202 LIST:[*]:[#]="1" == 1 ?
203 LIST:[@]:[#]="6"
204 LIST:[1]:[#]="1"
205 LIST:[1..3]:[#]="3"
206 EMPTY:[1]=""
207 ESCAPEDSPACE="\ "
208 ESCAPEDSPACE:[1]="\ "
209 REALLYSPACE=" "
210 REALLYSPACE:[1]="" == "" ?
211 REALLYSPACE:[*]:[1]=" " == " " ?
212 LIST:[1]="one"
213 make: Bad modifier `:[1.]' for LIST
214 LIST:[1.]="" is an error
215 make: Bad modifier `:[1].' for LIST
216 LIST:[1].="}" is an error
217 LIST:[2]="two"
218 LIST:[6]="six"
219 LIST:[7]=""
220 LIST:[999]=""
221 make: Bad modifier `:[-]' for LIST
222 LIST:[-]="" is an error
223 make: Bad modifier `:[--]' for LIST
224 LIST:[--]="" is an error
225 LIST:[-1]="six"
226 LIST:[-2]="five"
227 LIST:[-6]="one"
228 LIST:[-7]=""
229 LIST:[-999]=""
230 LONGLIST:[17]="17"
231 LONGLIST:[0x11]="17"
232 LONGLIST:[021]="17"
233 LIST:[0]:[1]="one two three four five six"
234 LIST:[*]:[1]="one two three four five six"
235 LIST:[@]:[1]="one"
236 LIST:[0]:[2]=""
237 LIST:[*]:[2]=""
238 LIST:[@]:[2]="two"
239 LIST:[*]:C/ /,/:[2]=""
240 LIST:[*]:C/ /,/:[*]:[2]=""
241 LIST:[*]:C/ /,/:[@]:[2]="three"
242 make: Bad modifier `:[1.]' for LIST
243 LIST:[1.]="" is an error
244 make: Bad modifier `:[1..]' for LIST
245 LIST:[1..]="" is an error
246 LIST:[1..1]="one"
247 make: Bad modifier `:[1..1.]' for LIST
248 LIST:[1..1.]="" is an error
249 LIST:[1..2]="one two"
250 LIST:[2..1]="two one"
251 LIST:[3..-2]="three four five"
252 LIST:[-4..4]="three four"
253 make: Bad modifier `:[0..1]' for LIST
254 LIST:[0..1]="" is an error
255 make: Bad modifier `:[-1..0]' for LIST
256 LIST:[-1..0]="" is an error
257 LIST:[-1..1]="six five four three two one"
258 LIST:[0..0]="one two three four five six"
259 LIST:[3..99]="three four five six"
260 LIST:[-3..-99]="four three two one"
261 LIST:[-99..-3]="one two three four"
262 HASH="#" == "#" ?
263 LIST:[${HASH}]="6"
264 LIST:[${ZERO}]="one two three four five six"
265 LIST:[${ZERO}x${ONE}]="one"
266 LIST:[${ONE}]="one"
267 LIST:[${MINUSONE}]="six"
268 LIST:[${STAR}]="one two three four five six"
269 LIST:[${AT}]="one two three four five six"
270 make: Bad modifier `:[${EMPTY' for LIST
271 LIST:[${EMPTY}]="" is an error
272 LIST:[${LONGLIST:[21]:S/2//}]="one"
273 LIST:[${LIST:[#]}]="six"
274 LIST:[${LIST:[${HASH}]}]="six"
275 LIST:S/ /,/="one two three four five six"
276 LIST:S/ /,/W="one,two three four five six"
277 LIST:S/ /,/gW="one,two,three,four,five,six"
278 EMPTY:S/^/,/=","
279 EMPTY:S/^/,/W=","
280 LIST:C/ /,/="one two three four five six"
281 LIST:C/ /,/W="one,two three four five six"
282 LIST:C/ /,/gW="one,two,three,four,five,six"
283 EMPTY:C/^/,/=","
284 EMPTY:C/^/,/W=","
285 LIST:tW="one two three four five six"
286 LIST:tw="one two three four five six"
287 LIST:tW:C/ /,/="one,two three four five six"
288 LIST:tW:C/ /,/g="one,two,three,four,five,six"
289 LIST:tW:C/ /,/1g="one,two,three,four,five,six"
290 LIST:tw:C/ /,/="one two three four five six"
291 LIST:tw:C/ /,/g="one two three four five six"
292 LIST:tw:C/ /,/1g="one two three four five six"
293 LIST:tw:tW:C/ /,/="one,two three four five six"
294 LIST:tW:tw:C/ /,/="one two three four five six"
295 .TARGET="phony" .PREFIX="phony" .IMPSRC=""
296 .TARGET="all" .PREFIX="all" .IMPSRC=""
297 .TARGET="ok" .PREFIX="ok" .IMPSRC=""
298 .TARGET="also.ok" .PREFIX="also.ok" .IMPSRC=""
299 .TARGET="bug" .PREFIX="bug" .IMPSRC=""
300 Posix says we should execute the command as if run by system(3)
301 Expect 'Hello,' and 'World!'
302 Hello,
303 World!
304 a command
305 a command prefixed by '+' executes even with -n
306 another command
307 make -n
308 echo a command
309 echo "a command prefixed by '+' executes even with -n"
310 a command prefixed by '+' executes even with -n
311 echo another command
312 make -n -j1
313 { echo a command
314 } || exit $?
315 echo "a command prefixed by '+' executes even with -n"
316 a command prefixed by '+' executes even with -n
317 { echo another command
318 } || exit $?
319 Now we expect an error...
320 *** Error code 1 (continuing)
321 `all' not remade because of errors.
322 V.i386 ?= OK
323 FOOBAR =
324 FOOBAR = foobar fubar
328 In the Sun
329 The answer is unknown
330 The answer is unknown
331 The answer is empty
332 The answer is known
333 The answer is
334 The answer is empty
335 The answer is known
336 The answer is 42
337 The answer is 42
338 UT_DOLLAR=This is $UT_FU
339 UT_FU=fubar
340 UT_TEST=unexport
341 UT_TEST=unexport-env
342 default FU=<v>fu</v> FOO=<v>foo</v> VAR=<v></v>
343 two FU=<v>bar</v> FOO=<v>goo</v> VAR=<v></v>
344 three FU=<v>bar</v> FOO=<v>goo</v> VAR=<v></v>
345 four FU=<v>bar</v> FOO=<v>goo</v> VAR=<v>Internal</v>
346 five FU=<v>bar</v> FOO=<v>goo</v> VAR=<v>Internal</v>
347 five v=is x k=is x
348 six v=is y k=is y
349 show-v v=override k=override
350 *** Error code 1 (ignored)
351 *** Error code 1 (ignored)