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