Sync usage with man page.
[netbsd-mini2440.git] / usr.bin / make / unit-tests / test.exp
blobc242a040d6fb4cd4d077173301c298cfa5afd724
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 UT_DOLLAR=This is $UT_FU
28 UT_FOO=foobar is fubar
29 UT_FU=fubar
30 UT_TEST=export
31 UT_ZOO=hoopie
32 UT_ALL=even this gets exported
33 UT_DOLLAR=This is $UT_FU
34 UT_F=fine
35 UT_FOO=foobar is fubar
36 UT_FU=fubar
37 UT_NO=all
38 UT_OK=good
39 UT_TEST=export-all
40 UT_ZOO=hoopie
41 simple.1
42 simple.1
43 simple.2
44 simple.2
45 recursive.1.1.*
46 recursive.1.1.*
47 recursive.1.1.*
48 recursive.1.1.*
49 recursive.1.99
50 recursive.1.99
51 recursive.2.1.*
52 recursive.2.1.*
53 recursive.2.1.*
54 recursive.2.1.*
55 recursive.2.99
56 recursive.2.99
57 shared.0
58 shared.0
59 shared.1.99
60 shared.1.99
61 shared.2.1
62 shared.2.1
63 shared.2.99
64 shared.2.99
65 make: Graph cycles through `cycle.2.99'
66 make: Graph cycles through `cycle.2.98'
67 make: Graph cycles through `cycle.2.97'
68 cycle.1.99
69 cycle.1.99
70 .for with :S;... OK
71 Expect: Unknown modifier 'Z'
72 make: Unknown modifier 'Z'
73 VAR:Z=
74 Expect: Unknown modifier 'Z'
75 make: Unknown modifier 'Z'
76 VAR:Z=
77 Expect: Unclosed variable specification for VAR
78 make: Unclosed variable specification (expecting '}') for "VAR" (value "Thevariable") modifier S
79 VAR:S,V,v,=Thevariable
80 Expect: Unclosed variable specification for VAR
81 make: Unclosed variable specification after complex modifier (expecting '}') for VAR
82 VAR:S,V,v,=Thevariable
83 Expect: Unclosed substitution for VAR (, missing)
84 make: Unclosed substitution for VAR (, missing)
85 VAR:S,V,v=
86 LIB=a X_LIBS:M${LIB${LIB:tu}} is "/tmp/liba.a"
87 LIB=a X_LIBS:M*/lib${LIB}.a is "/tmp/liba.a"
88 LIB=a X_LIBS:M*/lib${LIB}.a:tu is "/TMP/LIBA.A"
89 LIB=b X_LIBS:M${LIB${LIB:tu}} is ""
90 LIB=b X_LIBS:M*/lib${LIB}.a is ""
91 LIB=b X_LIBS:M*/lib${LIB}.a:tu is ""
92 LIB=c X_LIBS:M${LIB${LIB:tu}} is ""
93 LIB=c X_LIBS:M*/lib${LIB}.a is ""
94 LIB=c X_LIBS:M*/lib${LIB}.a:tu is ""
95 LIB=d X_LIBS:M${LIB${LIB:tu}} is "/tmp/libd.a"
96 LIB=d X_LIBS:M*/lib${LIB}.a is "/tmp/libd.a"
97 LIB=d X_LIBS:M*/lib${LIB}.a:tu is "/TMP/LIBD.A"
98 LIB=e X_LIBS:M${LIB${LIB:tu}} is "/tmp/libe.a"
99 LIB=e X_LIBS:M*/lib${LIB}.a is "/tmp/libe.a"
100 LIB=e X_LIBS:M*/lib${LIB}.a:tu is "/TMP/LIBE.A"
101 Mscanner=OK
102 path=':/bin:/usr/bin::/sbin:/usr/sbin:.:/home/user/bin:.'
103 path='/bin:/usr/bin:/sbin:/usr/sbin:/home/user/bin'
104 path='/bin:/usr/bin:/sbin:/usr/sbin:/homes/user/bin'
105 path='/bin':'/usr/bin':'/sbin':'/usr/sbin':'/home/user/bin'
106 path='/bin':'/usr/bin':'/sbin':'/usr/sbin':'/homes/user/bin'
107 path_/usr/xbin=/opt/xbin/
108 paths=/bin /usr/bin /sbin /usr/sbin /homes/user/bin /opt/xbin
109 PATHS=/BIN /USR/BIN /SBIN /USR/SBIN /HOMES/USER/BIN /OPT/XBIN
110 LIST = one two three four five six seven eight nine ten
111 LIST:O = eight five four nine one seven six ten three two
112 LIST:Ox = Ok
113 LIST:O:Ox = Ok
114 LISTX = Ok
115 LISTSX = Ok
116 make: Bad modifier `:OX' for LIST
117 BADMOD 1 = }
118 make: Bad modifier `:OxXX' for LIST
119 BADMOD 2 = XX}
120 LIST="one two three four five six"
121 LIST:ts,="one,two,three,four,five,six"
122 LIST:ts/:tu="ONE/TWO/THREE/FOUR/FIVE/SIX"
123 LIST:ts::tu="ONE:TWO:THREE:FOUR:FIVE:SIX"
124 LIST:ts:tu="ONETWOTHREEFOURFIVESIX"
125 LIST:tu:ts/="ONE/TWO/THREE/FOUR/FIVE/SIX"
126 LIST:ts:="one:two:three:four:five:six"
127 LIST:ts="onetwothreefourfivesix"
128 LIST:ts:S/two/2/="one2threefourfivesix"
129 LIST:S/two/2/:ts="one2threefourfivesix"
130 LIST:ts/:S/two/2/="one/2/three/four/five/six"
131 Pretend the '/' in '/n' etc. below are back-slashes.
132 LIST:ts/n="one
134 three
135 four
136 five
137 six"
138 LIST:ts/t="one two three four five six"
139 LIST:ts/012:tu="ONE
141 THREE
142 FOUR
143 FIVE
144 SIX"
145 make: Bad modifier `:tx' for LIST
146 LIST:tx="}"
147 make: Bad modifier `:ts\x' for LIST
148 LIST:ts/x:tu="\x:tu}"
149 FU_mod-ts="a/b/cool"
150 FU_mod-ts:ts:T="cool" == cool?
151 B.${AAA:ts}="Baaa" == Baaa?
152 make: Bad modifier `:[]' for LIST
153 LIST:[]="" is an error
154 LIST:[0]="one two three four five six"
155 LIST:[0x0]="one two three four five six"
156 LIST:[000]="one two three four five six"
157 LIST:[*]="one two three four five six"
158 LIST:[@]="one two three four five six"
159 LIST:[0]:C/ /,/="one,two three four five six"
160 LIST:[0]:C/ /,/g="one,two,three,four,five,six"
161 LIST:[0]:C/ /,/1g="one,two,three,four,five,six"
162 LIST:[*]:C/ /,/="one,two three four five six"
163 LIST:[*]:C/ /,/g="one,two,three,four,five,six"
164 LIST:[*]:C/ /,/1g="one,two,three,four,five,six"
165 LIST:[@]:C/ /,/="one two three four five six"
166 LIST:[@]:C/ /,/g="one two three four five six"
167 LIST:[@]:C/ /,/1g="one two three four five six"
168 LIST:[@]:[0]:C/ /,/="one,two three four five six"
169 LIST:[0]:[@]:C/ /,/="one two three four five six"
170 LIST:[@]:[*]:C/ /,/="one,two three four five six"
171 LIST:[*]:[@]:C/ /,/="one two three four five six"
172 EMPTY=""
173 EMPTY:[#]="1" == 1 ?
174 ESCAPEDSPACE="\ "
175 ESCAPEDSPACE:[#]="1" == 1 ?
176 REALLYSPACE=" "
177 REALLYSPACE:[#]="1" == 1 ?
178 LIST:[#]="6"
179 LIST:[0]:[#]="1" == 1 ?
180 LIST:[*]:[#]="1" == 1 ?
181 LIST:[@]:[#]="6"
182 LIST:[1]:[#]="1"
183 LIST:[1..3]:[#]="3"
184 EMPTY:[1]=""
185 ESCAPEDSPACE="\ "
186 ESCAPEDSPACE:[1]="\ "
187 REALLYSPACE=" "
188 REALLYSPACE:[1]="" == "" ?
189 REALLYSPACE:[*]:[1]=" " == " " ?
190 LIST:[1]="one"
191 make: Bad modifier `:[1.]' for LIST
192 LIST:[1.]="" is an error
193 make: Bad modifier `:[1].' for LIST
194 LIST:[1].="}" is an error
195 LIST:[2]="two"
196 LIST:[6]="six"
197 LIST:[7]=""
198 LIST:[999]=""
199 make: Bad modifier `:[-]' for LIST
200 LIST:[-]="" is an error
201 make: Bad modifier `:[--]' for LIST
202 LIST:[--]="" is an error
203 LIST:[-1]="six"
204 LIST:[-2]="five"
205 LIST:[-6]="one"
206 LIST:[-7]=""
207 LIST:[-999]=""
208 LONGLIST:[17]="17"
209 LONGLIST:[0x11]="17"
210 LONGLIST:[021]="17"
211 LIST:[0]:[1]="one two three four five six"
212 LIST:[*]:[1]="one two three four five six"
213 LIST:[@]:[1]="one"
214 LIST:[0]:[2]=""
215 LIST:[*]:[2]=""
216 LIST:[@]:[2]="two"
217 LIST:[*]:C/ /,/:[2]=""
218 LIST:[*]:C/ /,/:[*]:[2]=""
219 LIST:[*]:C/ /,/:[@]:[2]="three"
220 make: Bad modifier `:[1.]' for LIST
221 LIST:[1.]="" is an error
222 make: Bad modifier `:[1..]' for LIST
223 LIST:[1..]="" is an error
224 LIST:[1..1]="one"
225 make: Bad modifier `:[1..1.]' for LIST
226 LIST:[1..1.]="" is an error
227 LIST:[1..2]="one two"
228 LIST:[2..1]="two one"
229 LIST:[3..-2]="three four five"
230 LIST:[-4..4]="three four"
231 make: Bad modifier `:[0..1]' for LIST
232 LIST:[0..1]="" is an error
233 make: Bad modifier `:[-1..0]' for LIST
234 LIST:[-1..0]="" is an error
235 LIST:[-1..1]="six five four three two one"
236 LIST:[0..0]="one two three four five six"
237 LIST:[3..99]="three four five six"
238 LIST:[-3..-99]="four three two one"
239 LIST:[-99..-3]="one two three four"
240 HASH="#" == "#" ?
241 LIST:[${HASH}]="6"
242 LIST:[${ZERO}]="one two three four five six"
243 LIST:[${ZERO}x${ONE}]="one"
244 LIST:[${ONE}]="one"
245 LIST:[${MINUSONE}]="six"
246 LIST:[${STAR}]="one two three four five six"
247 LIST:[${AT}]="one two three four five six"
248 make: Bad modifier `:[${EMPTY' for LIST
249 LIST:[${EMPTY}]="" is an error
250 LIST:[${LONGLIST:[21]:S/2//}]="one"
251 LIST:[${LIST:[#]}]="six"
252 LIST:[${LIST:[${HASH}]}]="six"
253 LIST:S/ /,/="one two three four five six"
254 LIST:S/ /,/W="one,two three four five six"
255 LIST:S/ /,/gW="one,two,three,four,five,six"
256 EMPTY:S/^/,/=","
257 EMPTY:S/^/,/W=","
258 LIST:C/ /,/="one two three four five six"
259 LIST:C/ /,/W="one,two three four five six"
260 LIST:C/ /,/gW="one,two,three,four,five,six"
261 EMPTY:C/^/,/=","
262 EMPTY:C/^/,/W=","
263 LIST:tW="one two three four five six"
264 LIST:tw="one two three four five six"
265 LIST:tW:C/ /,/="one,two three four five six"
266 LIST:tW:C/ /,/g="one,two,three,four,five,six"
267 LIST:tW:C/ /,/1g="one,two,three,four,five,six"
268 LIST:tw:C/ /,/="one two three four five six"
269 LIST:tw:C/ /,/g="one two three four five six"
270 LIST:tw:C/ /,/1g="one two three four five six"
271 LIST:tw:tW:C/ /,/="one,two three four five six"
272 LIST:tW:tw:C/ /,/="one two three four five six"
273 Posix says we should execute the command as if run by system(3)
274 Expect 'Hello,' and 'World!'
275 Hello,
276 World!
277 a command
278 a command prefixed by '+' executes even with -n
279 another command
280 make -n
281 echo a command
282 echo "a command prefixed by '+' executes even with -n"
283 a command prefixed by '+' executes even with -n
284 echo another command
285 make -n -j1
286 { echo a command
287 } || exit $?
288 echo "a command prefixed by '+' executes even with -n"
289 a command prefixed by '+' executes even with -n
290 { echo another command
291 } || exit $?
292 Now we expect an error...
293 *** Error code 1 (continuing)
294 `all' not remade because of errors.
295 V.i386 ?= OK
296 The answer is unknown
297 The answer is unknown
298 The answer is empty
299 The answer is known
300 The answer is
301 The answer is empty
302 The answer is known
303 The answer is 42
304 The answer is 42
305 UT_DOLLAR=This is $UT_FU
306 UT_FU=fubar
307 UT_TEST=unexport
308 UT_TEST=unexport-env
309 default FU=<v>fu</v> FOO=<v>foo</v> VAR=<v></v>
310 two FU=<v>bar</v> FOO=<v>goo</v> VAR=<v></v>
311 three FU=<v>bar</v> FOO=<v>goo</v> VAR=<v></v>
312 four FU=<v>bar</v> FOO=<v>goo</v> VAR=<v>Internal</v>
313 five FU=<v>bar</v> FOO=<v>goo</v> VAR=<v>Internal</v>
314 five v=is x k=is x
315 six v=is y k=is y
316 show-v v=override k=override