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