]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | ################################################## |
2 | ### ### | |
3 | ### Makefile for LCLint testing ### | |
4 | ### ### | |
5 | ### designed for use with GNU make ### | |
6 | ### ### | |
7 | ################################################## | |
8 | ||
9 | .PHONY: all fulltest quicktest funcpointer cast abstract | |
10 | .PHONY: version help abstptr abstract alias alttypes ansireserved | |
11 | .PHONY: argorder args blocks break cases cast charlit | |
12 | .PHONY: clauses commentchar | |
13 | .PHONY: compdestroy controldepth csyntax czechnames czechoslovaknames | |
60eced23 | 14 | .PHONY: deadparam decl enum exports external fields fileio flags forbody format funcpointer glob globals |
885824d3 | 15 | .PHONY: impabstract init inparam internal iter keep libs lintcomments |
16 | .PHONY: list macros macrosef merge modifies modtest moduncon mongoincludes | |
17 | .PHONY: null observer oldstyle outglob outparam preds prefixes printflike rc | |
80ee600a | 18 | .PHONY: refcounts release repexpose returned sharing slovaknames special |
19 | .PHONY: specclauses stack staticarray | |
20 | .PHONY: strings structassign nullret | |
990ec868 | 21 | .PHONY: tainted typequals ud ulstypes union unreachable unused ullint void |
cc78dedd | 22 | .PHONY: db1 db2 db3 tests2.2 tests2.2a tests2.4 tests2.5 |
885824d3 | 23 | .PHONY: all test fulltest expects quicktest |
80ee600a | 24 | .PHONY: metastate warnuse |
25 | .PHONY: linked freearray | |
e4c9f289 | 26 | .PHONY: sizeoftest |
01b933c3 | 27 | .PHONY: bufferTest |
28 | .PHONY: simplebufferConstraintTests | |
80ee600a | 29 | .PHONY: moreBufferTests |
754e4dbd | 30 | .PHONY: maxset |
31 | .PHONY: globalbufferannotation | |
32 | .PHONY: strchr | |
33 | .PHONY: for | |
885824d3 | 34 | |
35 | .SUFFIXES: .out .expect .c .lcl .h .lh .diff | |
36 | ||
37 | SHELL = /bin/csh -f | |
38 | ||
39 | # Command to run lclint | |
990ec868 | 40 | LCLINT = ${HOME}/LCLintDev/bin/lclint |
885824d3 | 41 | LCLINTP = $(LCLINT) |
42 | ||
43 | # Make sure .lclintrc files are not used so test results do not | |
44 | # depend on local settings. | |
45 | LCLINTRN = $(LCLINTP) -nof -hints -booltype "bool" | |
a4456a77 | 46 | LCLINTR = $(LCLINTRN) -exportlocal +debugfcnconstraint |
885824d3 | 47 | |
80ee600a | 48 | UNITTESTS = help sizeoftest bufferTest simplebufferConstraintTests moreBufferTests globalbufferannotation maxset strchr for abstptr abstract alias alttypes ansireserved argorder args blocks break cases cast \ |
49 | charlit clauses commentchar compdestroy controldepth csyntax czechnames czechoslovaknames deadparam \ | |
60eced23 | 50 | decl enum exports external fields fileio flags forbody format freearray funcpointer glob globals impabstract \ |
80ee600a | 51 | init inparam internal iter keep libs linked lintcomments list macros macrosef merge metastate modifies \ |
3120b462 | 52 | modtest moduncon mongoincludes mystrncat null nullret nullassign observer oldstyle \ |
53 | outglob outparam preds prefixes \ | |
80ee600a | 54 | printflike rc refcounts release repexpose returned sharing slovaknames specclauses special stack \ |
990ec868 | 55 | staticarray strings structassign tainted typequals ud ulstypes union unreachable unused ullint void warnuse \ |
80ee600a | 56 | tests2.2 tests2.2a tests2.4 tests2.5 |
885824d3 | 57 | |
58 | UNITEXPECTS = $(addsuffix .expect, $(UNITTESTS)) | |
59 | ||
60 | INTEGTESTS = db1 db2 db3 | |
61 | INTEGEXPECTS = $(addsuffix .expect, $(INTEGTESTS)) | |
62 | ||
63 | LCLINTTESTS = $(UNITTESTS) $(INTEGTESTS) | |
64 | ||
3120b462 | 65 | QUICKTESTS = db3 |
66 | ||
885824d3 | 67 | all: fulltest |
68 | test: fulltest | |
69 | ||
70 | GREP = grep | |
71 | DIFF = diff | |
7bc6a007 | 72 | CLEANOUTPUT = $(GREP) -v "LCLint 3." | $(GREP) -v "make -e" | $(GREP) -v "make\[" | $(GREP) -v "lclint -nof" | $(GREP) -v "make -e" |
885824d3 | 73 | |
74 | ### not real .c | |
75 | ||
76 | .c.expect: | |
77 | $(MAKE) -e $(*) |& $(CLEANOUTPUT) > $(*).expect ; \ | |
78 | cat $(*).expect | |
79 | ||
80 | .c.diff: | |
81 | $(MAKE) -e $(*) |& $(CLEANOUTPUT) > $(*).out ; \ | |
82 | diff $(*).expect $(*).out | |
83 | ||
84 | expects: | |
85 | echo "Saving old expects: " ; \ | |
86 | more *.expect | cat > expects-`date +"%y-%m-%d-%H"` | |
87 | @$(foreach test, $(UNITTESTS), \ | |
88 | echo "Making "$(test)".expect: " ; \ | |
89 | $(MAKE) -e $(test) |& $(CLEANOUTPUT) > $(test).expect ; \ | |
90 | cat $(test).expect ; ) | |
91 | @echo "Integration Tests" | |
92 | @$(foreach test, $(INTEGTESTS), \ | |
93 | echo "Making "$(test)".expect: "; \ | |
94 | $(MAKE) -e $(test) |& $(CLEANOUTPUT) > $(test).expect ; \ | |
95 | cat $(test).expect ; ) | |
96 | ||
3120b462 | 97 | quicktest: |
98 | @$(foreach test, $(QUICKTESTS), \ | |
99 | echo "Checking "$(test)"... " ; \ | |
100 | $(MAKE) -e $(test) |& $(CLEANOUTPUT) > $(test).out ; \ | |
101 | $(DIFF) $(test).expect $(test).out ; \ | |
102 | if ($$status) echo "*** FAIL ***" ; \ | |
103 | ) | |
885824d3 | 104 | fulltest: |
105 | @echo '' | |
106 | @echo 'Testing '$(LCLINTP) | |
107 | @echo '' | |
108 | @echo 'Version:' | |
109 | @echo '' | |
110 | @$(LCLINTP) -help version | |
111 | @$(LCLINTP) -help vars | |
112 | @echo '' | |
113 | @echo "Unit Tests:" | |
114 | @echo '' | |
115 | @$(foreach test, $(UNITTESTS), \ | |
116 | echo "Checking "$(test)"... " ; \ | |
117 | $(MAKE) -e $(test) |& $(CLEANOUTPUT) > $(test).out ; \ | |
118 | $(DIFF) $(test).expect $(test).out ; \ | |
119 | if ($$status) echo "*** FAIL ***" ; \ | |
120 | ) | |
121 | @echo '' | |
122 | @echo "Integration Tests" | |
123 | @echo '' | |
124 | @$(foreach test, $(INTEGTESTS), \ | |
125 | echo "Checking "$(test)"... "; \ | |
126 | $(MAKE) -e $(test) |& $(CLEANOUTPUT) > $(test).out ; \ | |
127 | $(DIFF) $(test).expect $(test).out ; ) | |
128 | ||
885824d3 | 129 | ### |
130 | ### Unit Tests | |
131 | ### | |
132 | ||
133 | version: | |
134 | -$(LCLINTP) -help version | |
135 | ||
136 | help: | |
137 | -@$(LCLINTP) | |
138 | -@setenv LARCH_PATH "/dev/null"; $(LCLINTP) empty.lcl | |
139 | -@$(LCLINTP) -help | |
140 | -@$(LCLINTP) -asdf | |
141 | -@$(LCLINTP) +boolint +boolint | |
142 | -@$(LCLINTP) -help flags alpha | |
143 | -@$(LCLINTP) -help flags all | |
144 | ||
145 | abstptr: | |
146 | $(LCLINTR) abstptr -expect 9 | |
147 | $(LCLINTR) abstptr +voidabstract -expect 6 | |
148 | ||
149 | abstract: | |
150 | $(LCLINTR) abst_t.lcl commentcmd.c -expect 15 | |
151 | ||
152 | alias: | |
153 | $(LCLINTR) +lh mut | |
154 | $(LCLINTR) mut alias +globalias -expect 19 | |
155 | $(LCLINTR) mut alias2 +globalias -expect 17 | |
156 | $(LCLINTR) +lh alias3 -expect 14 | |
157 | $(LCLINTR) +lh alias4 +boolint | |
158 | $(LCLINTR) alias4 -pred +retalias -expect 6 | |
159 | $(LCLINTR) +lh alias5 +memchecks -null -specundef -expect 5 | |
160 | ||
161 | alttypes: | |
162 | $(LCLINTR) alttypes.c -expect 2 | |
163 | ||
80ee600a | 164 | ### |
165 | ### evans 2001-06-07 - updated nameCheck.c to reflect C9X. | |
166 | ### Reports one new errors for ansireserved.c - wctomb is bad even as a local variable. | |
167 | ### (could be a macro?) | |
168 | ### Reports 3 additional errors for +checks; no longer suppresses name errors in the | |
169 | ### presense of other errors. | |
170 | ### | |
171 | ||
885824d3 | 172 | ansireserved: |
80ee600a | 173 | $(LCLINTR) ansireserved.c +ansireserved -nolib -expect 9 |
885824d3 | 174 | $(LCLINTR) ansireserved.c +ansireserved +ansireservedlocal -nolib -expect 11 |
80ee600a | 175 | $(LCLINTRN) ansireserved.c +checks -exportlocal -exportheadervar -exportheader -expect 12 |
176 | $(LCLINTR) ansireserved2.c +ansireserved -expect 1 | |
885824d3 | 177 | |
178 | argorder: | |
179 | $(LCLINTR) argorder.c -expect 4 | |
180 | $(LCLINTR) argorder2 -expect 5 | |
181 | $(LCLINTR) argorder3.c -expect 8 | |
182 | $(LCLINTR) argorder4 -expect 9 | |
183 | $(LCLINTR) argorder4 -evalorder -expect 1 | |
184 | $(LCLINTR) argorder5.c +evalorderuncon -expect 3 | |
185 | ||
186 | args: | |
187 | $(LCLINTR) args -noeffect -expect 12 | |
188 | ||
189 | blocks: | |
190 | $(LCLINTR) blocks.c -expect 4 | |
191 | $(LCLINTR) blocks.c +ifblock +elseifcomplete -expect 7 | |
192 | $(LCLINTR) blocks.c -ifempty +whileempty +whileblock -expect 3 | |
193 | $(LCLINTR) blocks.c -ifempty +forempty +forblock -expect 3 | |
194 | $(LCLINTR) blocks.c +allempty -expect 6 | |
195 | $(LCLINTRN) blocks.c +strict -exportlocal +partial -exportheader -expect 11 | |
196 | ||
197 | break: | |
198 | $(LCLINTR) break.c -expect 4 | |
199 | $(LCLINTR) break.c +deepbreak -expect 6 | |
200 | $(LCLINTR) break.c +deepbreak -looploopbreak -expect 5 | |
201 | ||
202 | cases: | |
203 | $(LCLINTR) cases.c -expect 5 | |
204 | $(LCLINTR) cases2.c -expect 2 | |
205 | $(LCLINTRN) cases2.c +checks -exportlocal -exportheader -expect 3 | |
206 | $(LCLINTRN) cases2.c +checks -exportlocal -exportheader -branchstate -expect 3 | |
207 | ||
208 | cast: | |
209 | $(LCLINTR) cast -accessmodule -expect 20 | |
210 | $(LCLINTRN) cast2.c +checks -exportlocal -exportheader -expect 3 | |
211 | ||
cc78dedd | 212 | ### Two addition errors detected with 2.5 with -numliteral. |
213 | ||
885824d3 | 214 | charlit: |
215 | $(LCLINTR) +hints charlit.c -expect 4 | |
cc78dedd | 216 | $(LCLINTR) +hints -numliteral charlit.c -expect 6 |
885824d3 | 217 | $(LCLINTR) +hints charlit.c +charintliteral +ignoresigns |
218 | ||
219 | clauses: | |
220 | $(LCLINTR) clauses.c +memchecks -expect 4 | |
221 | $(LCLINTR) clauses2.c +memchecks | |
222 | $(LCLINTR) clauses3.c +memchecks -expect 2 | |
223 | $(LCLINTR) clauses3.c +memchecks +unixlib -expect 3 | |
224 | ||
225 | commentchar: | |
226 | $(LCLINTR) commentchar.c -expect 4 | |
227 | $(LCLINTR) -commentchar '#' commentchar.c -expect 4 | |
228 | ||
229 | controldepth: | |
230 | $(LCLINTR) +hints -controlnestdepth 2 controldepth.c -expect 2 | |
231 | $(LCLINTR) +hints -controlnestdepth 1 controldepth.c -expect 2 | |
232 | ||
233 | compdestroy: | |
234 | $(LCLINTRN) compdestroy.c +checks -exportlocal -exportheader -expect 1 | |
235 | $(LCLINTRN) compdestroy.c +checks -exportlocal -exportheader +strictdestroy -expect 2 | |
236 | $(LCLINTRN) compdestroy.c +checks -exportlocal -exportheader +strictdestroy +strictusereleased -expect 3 | |
237 | $(LCLINTRN) compdestroy.c +strict +partial -exportheader -expect 3 | |
238 | ||
239 | csyntax: | |
cc78dedd | 240 | $(LCLINTR) +quiet -incondefs csyntax.c -expect 1 |
241 | $(LCLINTR) +quiet csyntax2.c -expect 2 | |
242 | $(LCLINTR) +quiet csyntax3.c -expect 1 | |
885824d3 | 243 | $(LCLINTR) +quiet -incondefs csyntax4.c |
244 | $(LCLINTR) +quiet csyntax5.c | |
245 | $(LCLINTR) +quiet csyntax6.c | |
246 | $(LCLINTR) +quiet csyntax7.c | |
247 | $(LCLINTR) +quiet csyntax8.c | |
248 | $(LCLINTR) +quiet csyntax9.c | |
249 | $(LCLINTR) +quiet csyntax10.c | |
250 | $(LCLINTR) +quiet csyntax11.c | |
251 | $(LCLINTR) +quiet csyntax12.c | |
cc78dedd | 252 | $(LCLINTR) +quiet csyntax13.c -expect 1 |
885824d3 | 253 | $(LCLINTR) +quiet csyntax14.c |
254 | $(LCLINTR) +quiet csyntax15.c | |
cc78dedd | 255 | $(LCLINTR) +quiet csyntax16.c -expect 2 |
256 | $(LCLINTR) +quiet csyntax17.c -expect 3 | |
885824d3 | 257 | |
258 | czechnames: | |
259 | $(LCLINTR) czechnames.c | |
260 | $(LCLINTR) +hints +czech czechnames.c -expect 2 | |
261 | $(LCLINTR) +hints +czech -czechvars czechnames.c -expect 1 | |
262 | $(LCLINTR) +hints +czech -accessczech czechnames.c -expect 6 | |
263 | ||
264 | czechoslovaknames: | |
265 | $(LCLINTR) +hints +czechoslovak czechnames.c -expect 1 | |
266 | $(LCLINTR) +hints +czechoslovak slovaknames.c -expect 1 | |
267 | $(LCLINTR) +hints +czechoslovak +slovakvars slovaknames.c -expect 2 | |
268 | ||
80ee600a | 269 | ### |
270 | ### deadparam added 2001-05-27 | |
271 | ### | |
272 | ||
273 | deadparam: | |
274 | ${LCLINTR} deadparam.c -expect 3 | |
275 | ||
885824d3 | 276 | # |
277 | # Was expect 3 before 2.4. Earlier versions did not handle implicit | |
278 | # function pointers correctly. | |
279 | # | |
280 | ||
281 | decl: | |
282 | $(LCLINTR) decl.c -expect 2 | |
283 | $(LCLINTRN) decl.c +strict -exportlocal -expect 5 | |
284 | $(LCLINTR) decl2 -expect 4 | |
285 | ||
286 | enum: | |
287 | $(LCLINTR) enum -expect 16 | |
288 | $(LCLINTR) enum -misscase -expect 14 | |
289 | ||
290 | exports: | |
291 | $(LCLINTR) exports.c +exporttype +exportvar +exportfcn +topuse +typeuse -expect 6 | |
292 | $(LCLINTR) exports.c +exportany -expect 3 | |
293 | $(LCLINTR) exports.c | |
294 | ||
295 | external: | |
296 | $(LCLINTR) external.c +partial | |
297 | $(LCLINTR) external.c +partial +distinctexternalnames -expect 2 | |
298 | $(LCLINTR) external.c -nolib +partial -externalnamelength 3 -expect 3 | |
299 | $(LCLINTR) external.c -nolib +partial -externalnamelength 3 +externalnamecaseinsensitive -expect 3 | |
300 | $(LCLINTR) external.c +partial -externalnamelength 3 -expect 4 | |
301 | ||
302 | fields: | |
303 | $(LCLINTR) fields.c +memchecks -expect 6 | |
304 | $(LCLINTR) fields2.c +memchecks -expect 5 | |
305 | $(LCLINTR) fields3.c +memchecks | |
306 | ||
307 | flags: | |
308 | $(LCLINTR) flags.c -expect 8 | |
309 | $(LCLINTR) +nocomments flags.c -expect 2 | |
310 | ||
80ee600a | 311 | ### Added 2001-06-02 |
312 | ||
313 | forbody: | |
314 | ${LCLINTR} forbody.c -expect 2 | |
315 | ||
316 | ### Added 2001-06-03 | |
317 | format: | |
318 | ${LCLINTR} format.c -expect 3 | |
319 | ${LCLINTR} format.c -formatconst | |
320 | ||
885824d3 | 321 | # two new errors (invalid lhs) |
322 | ||
323 | funcpointer: | |
324 | $(LCLINTR) +memchecks +noparams funcpointer.c -expect 18 | |
325 | ||
326 | glob: | |
327 | $(LCLINTR) glob -expect 4 | |
328 | $(LCLINTR) glob -globuse -expect 3 | |
329 | $(LCLINTR) glob +globunspec -expect 6 | |
330 | ||
331 | globals: | |
332 | $(LCLINTR) -modifies globals.c -expect 5 | |
333 | $(LCLINTR) -modifies globals.c +allglobals -expect 6 | |
334 | $(LCLINTR) -modifies globals.c +impcheckedglobals -expect 6 | |
335 | $(LCLINTR) -modifies globals.c -globals -checkstrictglobals -expect 2 | |
336 | $(LCLINTR) -modifies globals.c +globunspec -expect 6 | |
337 | $(LCLINTR) -modifies globals.c +globunspec +allglobals -expect 8 | |
338 | ||
80ee600a | 339 | # Was -accessfile |
340 | impabstract: | |
341 | $(LCLINTR) -accessmodule impabstract.c | |
342 | $(LCLINTR) -accessmodule +hints +impabstract impabstract.c -expect 2 | |
343 | $(LCLINTR) -accessmodule +hints +impabstract impabstract -expect 4 | |
885824d3 | 344 | |
345 | init: | |
346 | $(LCLINTR) init.c -expect 12 | |
347 | $(LCLINTRN) init.c +checks -exportlocal -exportheadervar -expect 15 | |
348 | ||
349 | inparam: | |
350 | $(LCLINTR) inparam.c -expect 2 | |
351 | $(LCLINTR) +impouts inparam.c -expect 1 | |
352 | ||
353 | internal: | |
354 | $(LCLINTR) internal.c -expect 1 | |
355 | $(LCLINTR) internal.c +distinctinternalnames -expect 2 | |
356 | $(LCLINTR) internal.c -internalnamelen 28 -expect 3 | |
357 | $(LCLINTR) internal.c +internalnamecaseinsensitive -expect 3 | |
358 | $(LCLINTR) internal.c +internalnamecaseinsensitive +internalnamelookalike -expect 11 | |
359 | ||
80ee600a | 360 | ### |
361 | ### iter | |
362 | ### 2001-06-06: Error message for iter.lcl:3,6 fixed to iter.lcl:3:6 | |
363 | ### | |
364 | ||
885824d3 | 365 | iter: |
366 | $(LCLINTR) iter -expect 14 -lclexpect 1 | |
367 | $(LCLINTR) iter2.c -expect 12 | |
368 | ||
369 | keep: | |
370 | $(LCLINTR) keep.c +memchecks -expect 6 | |
371 | ||
80ee600a | 372 | ### libs |
373 | ### 2001-05-22: 2 new errors found (fixed spec of signal) | |
374 | ### 2001-05-30: 3 new errors found (formatconst) | |
885824d3 | 375 | |
376 | libs: | |
80ee600a | 377 | $(LCLINTR) libs.c +longunsignedunsignedintegral -expect 18 |
378 | $(LCLINTR) libs.c -expect 22 | |
379 | $(LCLINTR) libs.c +globunspec +modunspec -expect 25 | |
380 | $(LCLINTR) libs.c +strictlib +globunspec +modunspec -expect 42 | |
885824d3 | 381 | |
382 | lintcomments: | |
383 | $(LCLINTR) lintcomments.c -expect 4 | |
384 | $(LCLINTR) lintcomments.c -warnlintcomments -expect 1 | |
385 | $(LCLINTR) lintcomments.c -lintcomments -expect 4 | |
386 | ||
387 | list: | |
388 | $(LCLINTR) list.c -expect 3 | |
389 | ||
390 | macros: | |
391 | $(LCLINTR) macros -expect 17 | |
392 | $(LCLINTR) macros.c +allmacros -expect 34 | |
393 | $(LCLINTR) macros.c +fcnmacros -expect 31 | |
394 | ||
395 | ||
396 | macrosef: | |
397 | $(LCLINTR) macrosef -expect 4 | |
398 | $(LCLINTR) macrosef.c +allmacros -expect 3 | |
399 | $(LCLINTR) macrosef.c +allmacros +sefuncon -expect 4 | |
400 | ||
401 | merge: | |
402 | $(LCLINTRN) merge.c +checks -exportlocal -exportheadervar -exportheader -expect 3 | |
403 | ||
404 | modifies: | |
405 | $(LCLINTR) modifies.c modclient.c +impcheckedstatics +mustmod -expect 7 | |
406 | ||
407 | modtest: | |
408 | $(LCLINTR) modtest -expect 10 | |
409 | $(LCLINTR) modtest +modunspec -expect 13 | |
410 | $(LCLINTR) modtest +mustmod -expect 14 | |
411 | ||
412 | moduncon: | |
413 | $(LCLINTR) moduncon.c +moduncon -memchecks -expect 4 | |
414 | $(LCLINTRN) moduncon.c +strict -exportlocal -expect 22 | |
415 | ||
416 | mongoincludes: | |
417 | $(LCLINTR) mongoincludes.c -includenest 1 -expect 19 | |
418 | $(LCLINTR) mongoincludes.c -includenest 2 -expect 10 | |
419 | $(LCLINTR) mongoincludes.c -includenest 3 -expect 4 | |
420 | $(LCLINTR) mongoincludes.c -includenest 4 -expect 1 | |
421 | $(LCLINTR) mongoincludes.c -includenest 5 -expect 0 | |
422 | ||
3120b462 | 423 | mystrncat: |
424 | $(LCLINTR) mystrncat.c +fcnconstraint -expect 4 | |
425 | ||
885824d3 | 426 | null: |
427 | $(LCLINTR) null1.c -expect 14 | |
428 | $(LCLINTR) null1.c -null -expect 4 | |
429 | $(LCLINTR) null2.c -expect 10 | |
430 | $(LCLINTR) null3.c -expect 15 | |
431 | $(LCLINTR) null3.c -warnunixlib +unixlib -expect 16 | |
432 | $(LCLINTR) null4.c -expect 1 | |
433 | $(LCLINTR) null5.c -expect 4 | |
434 | $(LCLINTR) null6 -expect 4 | |
435 | $(LCLINTR) +quiet null6.lcl -dump null6 | |
436 | $(LCLINTR) null6.c -load null6 -expect 4 | |
437 | ||
80ee600a | 438 | ### Added for 3.0 (bugs reported by Kevin Broady) |
439 | ||
440 | nullret: | |
441 | $(LCLINTR) nullret.c -expect 2 | |
442 | $(LCLINTR) -nullret nullret.c -expect 1 | |
443 | ||
444 | nullassign: | |
445 | $(LCLINTR) nullassign.c -expect 2 | |
446 | $(LCLINTR) -nullassign nullassign.c -expect 1 | |
447 | ||
448 | ||
885824d3 | 449 | # |
450 | # Before 2.4, expected one more because error was reported both as | |
451 | # dependent and observer. | |
452 | # | |
453 | ||
454 | observer: | |
455 | $(LCLINTRN) observer +checks -exportlocal -exportheader -expect 9 | |
456 | $(LCLINTRN) observer.c +checks -exportlocal -exportheader -expect 8 | |
457 | $(LCLINTR) observer.c -expect 7 | |
458 | ||
459 | oldstyle: | |
460 | $(LCLINTR) oldstyle -expect 3 | |
461 | ||
462 | outglob: | |
463 | $(LCLINTR) outglob -expect 10 | |
464 | ||
465 | outparam: | |
466 | $(LCLINTR) outparam -expect 12 | |
467 | ||
468 | preds: | |
469 | $(LCLINTR) +hints preds.c -expect 6 | |
470 | $(LCLINTRN) +hints preds.c -weak -expect 1 | |
471 | $(LCLINTRN) +hints preds.c -strict -exportlocal -exportheader -expect 8 | |
472 | ||
473 | prefixes: | |
474 | $(LCLINTR) prefixes.c +partial | |
475 | $(LCLINTRN) prefixes.c +allmacros +checks -exportlocal +partial -exportheader -exportheadervar -expect 4 | |
476 | $(LCLINTR) prefixes.c -typeprefix "T" -expect 2 | |
477 | $(LCLINTR) prefixes.c -typeprefix "^" -expect 1 | |
478 | $(LCLINTR) prefixes.c -typeprefix "^*" -expect 2 | |
479 | $(LCLINTR) prefixes.c -typeprefix "^%*" -expect 2 | |
480 | $(LCLINTR) prefixes.c -typeprefix "^~*" -expect 2 | |
481 | $(LCLINTR) prefixes.c -typeprefix "^" +typeprefixexclude -expect 7 | |
482 | $(LCLINTR) prefixes.c -filestaticprefix "^^" -expect 4 | |
483 | $(LCLINTR) prefixes.c -filestaticprefix "^#" -expect 5 | |
484 | $(LCLINTR) prefixes.c -filestaticprefix "^?&x" -expect 5 | |
485 | $(LCLINTR) prefixes.c -globalprefix "G" -expect 1 | |
486 | $(LCLINTR) prefixes.c -globalprefix "&G?_^" -expect 1 | |
487 | $(LCLINTR) prefixes.c -externalprefix "G" -expect 5 | |
488 | $(LCLINTR) prefixes.c -typeprefix "T" -externalprefix "G" -expect 4 | |
489 | $(LCLINTR) prefixes.c -localprefix "?*" +localprefixexclude -expect 13 | |
490 | ||
491 | printflike: | |
492 | $(LCLINTR) printflike.c -expect 6 | |
493 | $(LCLINTR) printflike.c -warnlintcomments -expect 5 | |
494 | ||
495 | rc: | |
cc78dedd | 496 | $(LCLINTR) -DMYSTERY='"a flag\"wicked cool"' rc.c -expect 1 |
497 | $(LCLINTR) -DMYSTERY=12 rc.c -expect 1 | |
498 | $(LCLINTR) -f rc1.lclintrc rc.c -expect 1 | |
499 | $(LCLINTR) -UMYSTERY -f rc1.lclintrc rc.c -expect 1 | |
500 | $(LCLINTR) -f rc3.lclintrc rc.c -expect 1 | |
885824d3 | 501 | |
502 | refcounts: | |
503 | $(LCLINTR) refcounts.c -expect 7 | |
504 | ||
505 | release: | |
506 | $(LCLINTR) release.c +memchecks -expect 1 | |
507 | ||
508 | repexpose: | |
509 | $(LCLINTR) +lh repexpose +memchecks -expect 12 | |
510 | $(LCLINTR) repexpose +memchecks +retalias -expect 15 | |
511 | $(LCLINTRN) repexpose +checks -exportlocal -expect 27 | |
512 | ||
80ee600a | 513 | ### returned added 2001-05-27 |
514 | ### (Bug discovered checking lclint sources.) | |
515 | ||
516 | returned: | |
517 | ${LCLINTR} returned.c -expect 1 | |
518 | ||
885824d3 | 519 | sharing: |
520 | $(LCLINTR) sharing1.c -expect 21 | |
521 | $(LCLINTR) sharing3.c -expect 3 | |
522 | $(LCLINTR) sharing4.c -expect 13 | |
523 | $(LCLINTR) sharing4.c -paramimptemp -expect 12 | |
524 | $(LCLINTR) sharing5.c -expect 6 | |
525 | ||
526 | slovaknames: | |
527 | $(LCLINTR) +hints slovaknames.c -expect 1 | |
528 | $(LCLINTR) +hints slovaknames.c +accessslovak | |
529 | $(LCLINTR) +hints +slovak slovaknames.c -expect 3 | |
530 | $(LCLINTR) +hints +slovak -slovakvars slovaknames.c -expect 2 | |
531 | $(LCLINTR) +hints +slovak -accessslovak slovaknames.c -expect 7 | |
532 | ||
533 | specclauses: | |
534 | $(LCLINTR) specclauses.c -expect 6 | |
535 | $(LCLINTR) specclauses2.c -expect 8 | |
536 | $(LCLINTR) specclauses3.c -expect 6 | |
537 | $(LCLINTR) specclauses4.c -expect 3 | |
538 | $(LCLINTR) specclauses5.c -expect 3 | |
539 | ||
540 | special: | |
541 | $(LCLINTR) special -expect 20 | |
542 | $(LCLINTR) special -relaxquals -expect 22 | |
543 | ||
544 | stack: | |
545 | $(LCLINTR) stack.c -expect 5 | |
546 | $(LCLINTR) stack.c -stackref | |
547 | ||
548 | staticarray: | |
549 | $(LCLINTR) staticarray.c -expect 3 | |
550 | ||
551 | strings: | |
552 | $(LCLINTR) strings.c -expect 3 | |
553 | $(LCLINTR) -readonlystrings -expect 1 strings.c | |
554 | $(LCLINTR) +modobserverstrict -maintype -expect 4 strings.c | |
555 | ||
556 | structassign: | |
557 | $(LCLINTR) structassign.c -expect 4 | |
558 | ||
559 | typequals: | |
560 | $(LCLINTR) typequals.c tq.lcl -expect 5 | |
561 | $(LCLINTR) typequals.c -expect 2 | |
562 | ||
563 | ud: | |
564 | $(LCLINTR) ud.c -expect 9 | |
565 | $(LCLINTR) ud2 -specundef -expect 3 | |
566 | ||
567 | ulstypes: | |
568 | $(LCLINTR) ulstypes.c -expect 8 | |
569 | $(LCLINTR) ulstypes.c +ignorequals | |
570 | $(LCLINTRN) ulstypes.c +strict -exportheader -exportheadervar -expect 28 | |
cc78dedd | 571 | # 3 more detected with version 2.5 (change in -numliteral setting) |
885824d3 | 572 | |
573 | union: | |
574 | $(LCLINTR) +memchecks union.c -expect 8 | |
575 | ||
576 | unreachable: | |
577 | $(LCLINTR) unreachable.c -expect 5 | |
578 | $(LCLINTR) -unreachable unreachable.c -expect 2 | |
579 | $(LCLINTR) switch.c -expect 4 | |
580 | ||
80ee600a | 581 | ### |
582 | ### 2001-06-08 evans: 2 new errors after fixing ansireserved name checks | |
583 | ### | |
584 | ||
885824d3 | 585 | unused: |
80ee600a | 586 | $(LCLINTRN) unused.c +checks -exportlocal -expect 5 |
587 | $(LCLINTRN) unused.c +checks -exportlocal +topuse -expect 8 | |
588 | ||
589 | ### | |
590 | ### 2001-06-10: Provided by Jim Zalenka | |
591 | ### | |
592 | ||
593 | ullint: | |
594 | ${LCLINTRN} ullint.c -expect 5 | |
595 | ${LCLINTRN} ullint.c +charint +charintliteral -expect 2 | |
596 | ||
597 | void: | |
598 | ${LCLINTRN} void.c -expect 2 | |
599 | ||
600 | ### | |
601 | ### New since 2.5q: | |
602 | ### | |
603 | ||
604 | linked: | |
605 | ${LCLINTR} linked.c -expect 4 | |
606 | ${LCLINTR} linked2.c -expect 3 | |
607 | ${LCLINTR} linked3.c -expect 5 | |
608 | ${LCLINTR} linked4.c -expect 6 | |
609 | ${LCLINTR} linked5.c -expect 4 | |
610 | ${LCLINTR} linked6.c -expect 4 | |
611 | ||
612 | freearray: | |
613 | ${LCLINTR} freearray.c -expect 1 | |
885824d3 | 614 | |
615 | ### | |
616 | ### Bugs fixed and new features since version 2.1b | |
617 | ### | |
618 | ||
619 | tests2.2: | |
80ee600a | 620 | setenv LCLINT '$(LCLINTRN)'; cd tests2.2 ; $(MAKE) -e |
885824d3 | 621 | |
622 | tests2.2a: | |
623 | @cd tests2.2a ; \ | |
624 | $(LCLINTR) erik.c -expect 1 ; \ | |
625 | $(LCLINTR) boolcomp.c -expect 5 ; \ | |
626 | $(LCLINTR) boolenum.c ; \ | |
627 | $(LCLINTR) addassign.c -expect 1; \ | |
628 | $(LCLINTR) toralf.c -expect 5 ; \ | |
629 | $(LCLINTR) fred.c -booltype Bool ; \ | |
630 | $(LCLINTR) sizeof.c ; \ | |
631 | $(LCLINTR) arrayparam.c -expect 5 ; \ | |
632 | $(LCLINTR) notreached.c ; \ | |
cc78dedd | 633 | $(LCLINTR) duff.c -casebreak -firstcase ; \ |
885824d3 | 634 | $(LCLINTR) obviousloop.c -expect 4 ; \ |
635 | $(LCLINTR) bitops.c +bitwisesigned -expect 11 ; \ | |
636 | $(LCLINTR) bitops.c -expect 5 ; \ | |
637 | $(LCLINTR) isalpha.c +strictlib -expect 1 ; \ | |
638 | $(LCLINTR) isalpha.c -expect 1 ; \ | |
639 | $(LCLINTR) dobb.c ; \ | |
640 | $(LCLINTR) popik.c -expect 11 | |
641 | ||
642 | tests2.4: | |
80ee600a | 643 | setenv LCLINT '$(LCLINTRN)'; cd tests2.4 ; $(MAKE) -e |
885824d3 | 644 | |
e4c9f289 | 645 | sizeoftest: |
646 | @cd sizeoftest; \ | |
647 | $(LCLINTR) +functionconstraint sizeof.c | |
1ac6313d | 648 | |
01b933c3 | 649 | bufferTest: |
650 | @cd bufferTest; \ | |
651 | $(LCLINTR) +functionconstraint test4.c test6.c | |
652 | ||
653 | simplebufferConstraintTests: | |
654 | @cd simplebufferConstraintTests; \ | |
655 | $(LCLINTR) +functionconstraint m.c sizeof.c test3.c test7.c | |
656 | ||
80ee600a | 657 | moreBufferTests: |
658 | @cd moreBufferTests; \ | |
6e5d6478 | 659 | $(LCLINTR) +functionconstraint +orconstraint unrecogCall.c strrchr.c initialization.c simplifyTest.c strncatNotReallyGood.c strncatReallyGood.c |
80ee600a | 660 | |
754e4dbd | 661 | maxset: |
662 | @cd maxset; \ | |
663 | $(LCLINTR) -f .lclintrc -booltype "lltX_bool" maxsetannotations.c; \ | |
754e4dbd | 664 | echo $(LCLINTR); \ |
665 | $(LCLINTR) -f .lclintrc -booltype "lltX_bool" maxsetnoannotations.c | |
666 | ||
667 | globalbufferannotation: | |
668 | @cd globalbufferannotation; \ | |
669 | $(LCLINTR) +functionconstraint globalvariable.c | |
670 | ||
671 | ||
672 | strchr: | |
673 | @cd strchr; \ | |
674 | $(LCLINTR) -f .lclintrc -booltype "lltX_bool" strchr.c | |
675 | ||
676 | for: | |
677 | @cd for; \ | |
678 | $(LCLINTR) -f .lclintrc -booltype "lltX_bool" for.c | |
679 | ||
cc78dedd | 680 | tests2.5: |
681 | setenv LCLINT '$(LCLINTRN)'; cd tests2.5 ; $(MAKE) -e | |
682 | ||
80ee600a | 683 | metastate: |
684 | setenv LCLINT '$(LCLINTRN)'; cd metastate ; $(MAKE) -e | |
685 | ||
990ec868 | 686 | tainted: |
687 | setenv LCLINT '$(LCLINTRN)'; cd tainted ; $(MAKE) -e | |
688 | ||
60eced23 | 689 | fileio: |
690 | setenv LCLINT '$(LCLINTRN)'; cd fileio ; $(MAKE) -e | |
691 | ||
80ee600a | 692 | warnuse: |
693 | setenv LCLINT '$(LCLINTRN)'; cd warnuse ; $(MAKE) -e | |
694 | ||
d9a28762 | 695 | ensuresclauses: |
696 | setenv LCLINT '$(LCLINTRN)'; cd ensuresclauses ; $(MAKE) -e | |
697 | ||
885824d3 | 698 | ### |
699 | ### Integration Tests | |
700 | ### | |
701 | ||
702 | db1: | |
703 | setenv LCLINT '$(LCLINTRN)'; cd db1; $(MAKE) -e test | |
704 | ||
80ee600a | 705 | |
706 | ### evans 2000-12-22 | |
707 | ### 2 errors are no longer reported, since eref is immutable. | |
708 | ### Need to clarify what it means for an object to be immutable; | |
709 | ### there should be 2 types with different storage requirements. | |
710 | ||
885824d3 | 711 | db2: |
712 | setenv LCLINT '$(LCLINTRN)'; cd db2; $(MAKE) -e test | |
713 | ||
714 | db3: | |
715 | setenv LCLINT '$(LCLINTRN)'; cd db3; $(MAKE) -e test | |
716 | ||
885824d3 | 717 | clean: |
718 | -rm -f *~ #*# *.o *.lcs a.out | |
719 | -cd db1 ; $(MAKE) clean | |
720 | -cd db2 ; $(MAKE) clean | |
721 | -cd db3 ; $(MAKE) clean | |
722 | ||
723 | ||
724 | ||
cc78dedd | 725 |