]> andersk Git - splint.git/blobdiff - test/Makefile
string literal initialization sizes
[splint.git] / test / Makefile
index b46bd6e5796a66b7e6897fe8ec4ecb79dd817a8e..94992c5d0891655562b354b9c3c2f31941dc0894 100644 (file)
@@ -8,22 +8,25 @@
 
 .PHONY: all fulltest quicktest funcpointer cast abstract
 .PHONY:        version help abstptr abstract alias alttypes ansireserved 
-.PHONY: argorder args blocks break cases cast charlit 
-.PHONY: clauses commentchar 
-.PHONY: compdestroy controldepth csyntax czechnames czechoslovaknames 
-.PHONY: decl enum exports external fields flags funcpointer glob globals 
+.PHONY: argorder args blocks branchstate break cases cast charlit 
+.PHONY: clauses commentchar arrayinit
+.PHONY: compdestroy constannot controldepth csyntax czechnames czechoslovaknames 
+.PHONY: deadparam decl enum exports external fields fileio flags forbody format funcpointer glob globals 
 .PHONY: impabstract init inparam internal iter keep libs lintcomments 
-.PHONY: list macros macrosef merge modifies modtest moduncon mongoincludes 
-.PHONY: null observer oldstyle outglob outparam preds prefixes printflike rc 
-.PHONY: refcounts release repexpose sharing slovaknames special
-.PHONY: specclauses stack staticarray
-.PHONY: strings structassign
-.PHONY: typequals ud ulstypes union unreachable unused 
+.PHONY: list longconstants macros macrosef merge mergestate modifies modtest moduncon mongoincludes 
+.PHONY: noeffect null observer oldstyle outglob outparam postnotnull preds prefixes printflike rc 
+.PHONY: refcounts release repexpose returned sharing slovaknames special
+.PHONY: specclauses stack staticarray 
+.PHONY: strings structassign nullret
+.PHONY: tainted typequals ud ulstypes union unreachable unused ullint unsignedcompare void
 .PHONY: db1 db2 db3 tests2.2 tests2.2a tests2.4 tests2.5
 .PHONY: all test fulltest expects quicktest
+.PHONY: warnuse metastate
+.PHONY: linked freearray
 .PHONY: sizeoftest
 .PHONY: bufferTest
 .PHONY: simplebufferConstraintTests
+.PHONY: moreBufferTests
 .PHONY: maxset
 .PHONY: globalbufferannotation
 .PHONY: strchr
 SHELL = /bin/csh -f
 
 # Command to run lclint
-LCLINT  = ${HOME}/lclint-dev/src/lclint
+# ${HOME}/LCLintDev/src/lclint
+LCLINT  = lclint
 LCLINTP = $(LCLINT)
 
 # Make sure .lclintrc files are not used so test results do not
 # depend on local settings.
 LCLINTRN = $(LCLINTP) -nof -hints -booltype "bool"
-LCLINTR = $(LCLINTRN) -exportlocal
+LCLINTR = $(LCLINTRN) -exportlocal   +debugfcnconstraint
+
+# removed for now: nullret nullassign warnuse
+
+#  fileio tainted mergestate metastate \
+
+UNITTESTS = \
+  help sizeoftest bufferTest simplebufferConstraintTests \
+  moreBufferTests globalbufferannotation maxset strchr for \
+  abstptr abstract alias alttypes ansireserved argorder args arrayinit blocks branchstate break cases cast \
+  charlit clauses commentchar compdestroy constannot controldepth csyntax czechnames czechoslovaknames deadparam \
+  decl enum exports external fields flags forbody format freearray funcpointer glob globals impabstract \
+  fileio tainted  metastate \
+  init inparam internal iter keep libs linked lintcomments list longconstants macros macrosef merge modifies \
+  modtest moduncon mongoincludes mystrncat noeffect null observer oldstyle \
+  outglob outparam postnotnull preds prefixes \
+  printflike rc refcounts release repexpose returned sharing slovaknames specclauses special stack \
+  staticarray strings structassign \
+  typequals ud ulstypes union unreachable unsignedcompare unused ullint void \
+  tests2.2 tests2.2a tests2.4 tests2.5 
 
-UNITTESTS = help sizeoftest bufferTest simplebufferConstraintTests globalbufferannotation maxset strchr for abstptr abstract alias alttypes ansireserved argorder args blocks break cases cast charlit clauses commentchar compdestroy controldepth csyntax czechnames czechoslovaknames decl enum exports external fields flags funcpointer glob globals impabstract init inparam internal iter keep libs lintcomments list macros macrosef merge modifies modtest moduncon mongoincludes null  observer oldstyle outglob outparam preds prefixes printflike rc refcounts release repexpose sharing slovaknames specclauses special stack staticarray strings structassign typequals ud ulstypes union unreachable unused tests2.2 tests2.2a tests2.4 tests2.5
+###
+### Attribute checking is not ready for the 3.0.0.9 alpha release:
+###
 
-#UNITTEST = bufferTest
+#drl removed the following tests
+#fileio tainted mergestate nullret nullassign warnuse metastate \
 
 UNITEXPECTS  = $(addsuffix .expect, $(UNITTESTS))
 
@@ -53,12 +79,19 @@ INTEGEXPECTS  = $(addsuffix .expect, $(INTEGTESTS))
 
 LCLINTTESTS = $(UNITTESTS) $(INTEGTESTS)
 
+QUICKTESTS = db3
+
 all: fulltest
 test: fulltest
 
 GREP = grep
 DIFF = diff
-CLEANOUTPUT = $(GREP) -v "LCLint 2." | $(GREP) -v "make -e" | $(GREP) -v "make\[" | $(GREP) -v "lclint -nof" | $(GREP) -v "make  -e"
+
+###
+### This is a kludgey way of processing the output to make it match exactly
+###
+
+CLEANOUTPUT = $(GREP) -v "LCLint 3." | $(GREP) -v "make -e" | $(GREP) -v "make\[" | $(GREP) -v "lclint -nof" | $(GREP) -v "make  -e" | $(GREP) -v $(HOME)
 
 ### not real .c
 
@@ -83,6 +116,13 @@ expects:
            $(MAKE) -e $(test) |& $(CLEANOUTPUT) > $(test).expect ; \
           cat $(test).expect ; ) 
 
+quicktest:
+       @$(foreach test, $(QUICKTESTS),  \
+          echo "Checking "$(test)"... " ; \
+           $(MAKE) -e $(test) |& $(CLEANOUTPUT) > $(test).out ; \
+          $(DIFF) $(test).expect $(test).out ; \
+          if ($$status) echo "*** FAIL ***" ; \
+          ) 
 fulltest:
        @echo ''
        @echo 'Testing '$(LCLINTP)
@@ -108,8 +148,6 @@ fulltest:
            $(MAKE) -e $(test) |& $(CLEANOUTPUT) > $(test).out ; \
           $(DIFF) $(test).expect $(test).out ; )
 
-quicktest: $(LCLINTTESTS)
-
 ###
 ### Unit Tests
 ###
@@ -145,10 +183,23 @@ alias:
 alttypes:
        $(LCLINTR) alttypes.c -expect 2
 
+###
+### evans 2001-06-07 - updated nameCheck.c to reflect C9X.
+### Reports one new errors for ansireserved.c - wctomb is bad even as a local variable.
+###    (could be a macro?)
+### Reports 3 additional errors for +checks; no longer suppresses name errors in the
+###    presense of other errors.
+###
+
 ansireserved:
-       $(LCLINTR) ansireserved.c +ansireserved -nolib -expect 8
+       $(LCLINTR) ansireserved.c +ansireserved -nolib -expect 9
        $(LCLINTR) ansireserved.c +ansireserved +ansireservedlocal -nolib -expect 11
-       $(LCLINTRN) ansireserved.c +checks -exportlocal -exportheadervar -exportheader -expect 9
+       $(LCLINTRN) ansireserved.c +checks -exportlocal -exportheadervar -exportheader -expect 12
+       $(LCLINTR) ansireserved2.c +ansireserved -expect 1
+
+arrayinit:
+       ${LCLINTR} arrayinit.c -expect 8
+       ${LCLINTR} arrayinit.c +stringliteralsmaller -expect 9
 
 argorder:
        $(LCLINTR) argorder.c -expect 4
@@ -169,6 +220,9 @@ blocks:
        $(LCLINTR) blocks.c +allempty -expect 6
        $(LCLINTRN) blocks.c +strict -exportlocal +partial -exportheader -expect 11
 
+branchstate:
+       $(LCLINTR) branchstate.c -nof -branchstate -expect 1
+
 break:
        $(LCLINTR) break.c -expect 4
        $(LCLINTR) break.c +deepbreak -expect 6
@@ -211,6 +265,9 @@ compdestroy:
        $(LCLINTRN) compdestroy.c +checks -exportlocal -exportheader +strictdestroy +strictusereleased -expect 3
        $(LCLINTRN) compdestroy.c +strict +partial -exportheader -expect 3
 
+constannot:
+       ${LCLINTRN} constannot.c +arraybounds  -exportlocal -expect 2
+
 csyntax:
        $(LCLINTR) +quiet -incondefs csyntax.c -expect 1 
        $(LCLINTR) +quiet csyntax2.c -expect 2
@@ -241,6 +298,13 @@ czechoslovaknames:
        $(LCLINTR) +hints +czechoslovak slovaknames.c -expect 1
        $(LCLINTR) +hints +czechoslovak +slovakvars slovaknames.c -expect 2
 
+###
+### deadparam added 2001-05-27
+###
+
+deadparam:
+       ${LCLINTR} deadparam.c -expect 3
+
 #
 # Was expect 3 before 2.4.  Earlier versions did not handle implicit
 # function pointers correctly.
@@ -276,6 +340,16 @@ flags:
        $(LCLINTR) flags.c -expect 8
        $(LCLINTR) +nocomments flags.c -expect 2
 
+### Added 2001-06-02
+
+forbody:
+       ${LCLINTR} forbody.c -expect 2
+
+### Added 2001-06-03
+format:
+       ${LCLINTR} format.c -expect 3
+       ${LCLINTR} format.c -formatconst 
+
 # two new errors (invalid lhs)
 
 funcpointer:
@@ -294,14 +368,15 @@ globals:
        $(LCLINTR) -modifies globals.c +globunspec -expect 6
        $(LCLINTR) -modifies globals.c +globunspec +allglobals -expect 8
 
-impabstract:
-       $(LCLINTR) -accessfile impabstract.c 
-       $(LCLINTR) -accessfile +hints +impabstract impabstract.c -expect 2
-       $(LCLINTR) -accessfile +hints +impabstract impabstract -expect 2
+# Was -accessfile
+impabstract: 
+       $(LCLINTR) -accessmodule impabstract.c 
+       $(LCLINTR) -accessmodule +hints +impabstract impabstract.c -expect 2
+       $(LCLINTR) -accessmodule +hints +impabstract impabstract -expect 4
 
 init:
-       $(LCLINTR) init.c -expect 12
-       $(LCLINTRN) init.c +checks -exportlocal -exportheadervar -expect 15
+       $(LCLINTR) init.c -expect 14
+       $(LCLINTRN) init.c +checks -exportlocal -exportheadervar -expect 17
 
 inparam:
        $(LCLINTR) inparam.c -expect 2
@@ -314,6 +389,11 @@ internal:
        $(LCLINTR) internal.c +internalnamecaseinsensitive -expect 3
        $(LCLINTR) internal.c +internalnamecaseinsensitive +internalnamelookalike -expect 11
 
+###
+### iter
+### 2001-06-06: Error message for iter.lcl:3,6 fixed to iter.lcl:3:6
+### 
+
 iter:
        $(LCLINTR) iter -expect 14 -lclexpect 1
        $(LCLINTR) iter2.c -expect 12
@@ -321,15 +401,15 @@ iter:
 keep:
        $(LCLINTR) keep.c +memchecks -expect 6
 
-#
-# 2 new errors found (fixed spec of signal)
-#
+### libs
+### 2001-05-22: 2 new errors found (fixed spec of signal)
+### 2001-05-30: 3 new errors found (formatconst)
 
 libs:
-       $(LCLINTR) libs.c +longunsignedunsignedintegral -expect 15
-       $(LCLINTR) libs.c -expect 19
-       $(LCLINTR) libs.c +globunspec +modunspec -expect 22
-       $(LCLINTR) libs.c +strictlib +globunspec +modunspec -expect 39
+       $(LCLINTR) libs.c +longunsignedunsignedintegral -expect 18
+       $(LCLINTR) libs.c -expect 22
+       $(LCLINTR) libs.c +globunspec +modunspec -expect 25
+       $(LCLINTR) libs.c +strictlib +globunspec +modunspec -expect 42
 
 lintcomments:
        $(LCLINTR) lintcomments.c -expect 4
@@ -339,6 +419,9 @@ lintcomments:
 list:
        $(LCLINTR) list.c -expect 3
 
+longconstants:
+       $(LCLINTR) longconstants.c -expect 1
+
 macros:
        $(LCLINTR) macros -expect 17 
        $(LCLINTR) macros.c +allmacros -expect 34
@@ -372,6 +455,12 @@ mongoincludes:
        $(LCLINTR) mongoincludes.c -includenest 4 -expect 1
        $(LCLINTR) mongoincludes.c -includenest 5 -expect 0
 
+mystrncat:
+       $(LCLINTR) mystrncat.c +arraybounds  +arrayboundsread -expect 4 
+
+noeffect:
+       ${LCLINT} -nof noeffect.c +allmacros +checks -expect 3
+
 null: 
        $(LCLINTR) null1.c -expect 14
        $(LCLINTR) null1.c -null -expect 4
@@ -384,6 +473,17 @@ null:
        $(LCLINTR) +quiet null6.lcl -dump null6
        $(LCLINTR) null6.c -load null6 -expect 4
 
+### Added for 3.0 (bugs reported by Kevin Broady)
+
+nullret:
+       $(LCLINTR) nullret.c -expect 2
+       $(LCLINTR) -nullret nullret.c -expect 1
+
+nullassign:
+       $(LCLINTR) nullassign.c -expect 2
+       $(LCLINTR) -nullassign nullassign.c -expect 1
+
+
 #
 # Before 2.4, expected one more because error was reported both as 
 # dependent and observer.
@@ -403,10 +503,18 @@ outglob:
 outparam:
        $(LCLINTR) outparam -expect 12
 
+### evans 2001-08-26: postnotnull new
+
+postnotnull:
+       ${LCLINTR} postnotnull.c -expect 1
+#
+# Four new +fcnuse errors for -strict (evans 2001-07-22)
+# 
+
 preds:
        $(LCLINTR) +hints preds.c -expect 6
        $(LCLINTRN) +hints preds.c -weak -expect 1
-       $(LCLINTRN) +hints preds.c -strict -exportlocal -exportheader -expect 8
+       $(LCLINTRN) +hints preds.c -strict -exportlocal -exportheader -expect 12
 
 prefixes:
        $(LCLINTR) prefixes.c +partial
@@ -448,6 +556,12 @@ repexpose:
        $(LCLINTR) repexpose +memchecks +retalias -expect 15
        $(LCLINTRN) repexpose +checks -exportlocal -expect 27
 
+### returned added 2001-05-27
+### (Bug discovered checking lclint sources.)
+
+returned:
+       ${LCLINTR} returned.c -expect 1
+
 sharing: 
        $(LCLINTR) sharing1.c -expect 21
        $(LCLINTR) sharing3.c -expect  3
@@ -510,32 +624,50 @@ unreachable:
        $(LCLINTR) -unreachable unreachable.c -expect 2
        $(LCLINTR) switch.c -expect 4
 
+unsignedcompare:
+       ${LCLINTR} +posixlib unsignedcompare.c -expect 4
+
+
+###
+### 2001-06-08 evans: 2 new errors after fixing ansireserved name checks
+###
+
 unused:
-       $(LCLINTRN) unused.c +checks -exportlocal -expect 3
-       $(LCLINTRN) unused.c +checks -exportlocal +topuse -expect 6
+       $(LCLINTRN) unused.c +checks -exportlocal -expect 5
+       $(LCLINTRN) unused.c +checks -exportlocal +topuse -expect 8
+
+###
+### 2001-06-10: Provided by Jim Zalenka
+###
+
+ullint:
+       ${LCLINTRN} ullint.c -expect 5
+       ${LCLINTRN} ullint.c +charint +charintliteral -expect 2
+
+void:
+       ${LCLINTRN} void.c -expect 2
+
+###
+### New since 2.5q:
+###
+
+linked:
+       ${LCLINTR} linked.c -expect 4
+       ${LCLINTR} linked2.c -expect 3
+       ${LCLINTR} linked3.c -expect 5
+       ${LCLINTR} linked4.c -expect 6
+       ${LCLINTR} linked5.c -expect 4
+       ${LCLINTR} linked6.c -expect 4
+
+freearray:
+       ${LCLINTR} freearray.c -expect 1
 
 ###
 ### Bugs fixed and new features since version 2.1b
 ###
 
 tests2.2:
-       @cd tests2.2 ; \
-       $(LCLINTR) boolops.c -expect 1 ; \
-        $(LCLINTR) bool.lcl booldef.c -expect 1 ; \
-       $(LCLINTR) boolenum.c -booltype BOOLEAN -expect 1 ; \
-        $(LCLINTR) break.c -expect 1 ; \
-        $(LCLINTR) bstring.c -expect 2 ; \
-        $(LCLINTR) decl.c -expect 1 ; \
-        $(LCLINTR) enumbool.c -expect 2 ; \
-        $(LCLINTR) enumbool.c -booltrue "true" -boolfalse "false" ; \
-       $(LCLINTR) extension.c ; \
-       $(LCLINTR) -gnuextensions extension.c ; \
-       $(LCLINTR) modarray.c ; \
-       $(LCLINTR) nestext.c -expect 1 ; \
-       $(LCLINTR) offsetof.c ; \
-       $(LCLINTR) sizeofarray.c -expect 3 ; \
-       $(LCLINTR) rex.c -expect 1 ; \
-       $(LCLINTR) struct.c -expect 1
+       setenv LCLINT '$(LCLINTRN)'; cd tests2.2 ; $(MAKE) -e
 
 tests2.2a:
        @cd tests2.2a ; \
@@ -558,70 +690,62 @@ tests2.2a:
        $(LCLINTR) popik.c -expect 11
 
 tests2.4:
-       @cd tests2.4 ; \
-       $(LCLINTR) emptycase.c ; \
-       $(LCLINTR) enumtest.c ; \
-       $(LCLINTR) duffs.c ; \
-       $(LCLINTR) bitfields.c ; \
-       $(LCLINTR) bug1.c ; \
-       $(LCLINTR) bug2.c -expect 5 ; \
-       $(LCLINTR) bug3.c ; \
-       $(LCLINTR) test0.c ; \
-       $(LCLINTR) test1.c ; \
-       $(LCLINTR) test2.c ; \
-       $(LCLINTR) hexconstants.c -expect 1 ; \
-       $(LCLINTR) +checks hexconstants.c -expect 4 ; \
-       $(LCLINTR) innercomment.c ; \
-       $(LCLINTR) nothing.c ; \
-       $(LCLINTR) offsetof.c -expect 2 ; \
-       $(LCLINTR) komazi.c ; \
-       $(LCLINTR) print.c ; \
-       $(LCLINTR) syslog.c -warnunixlib +unixlib ; \
-       $(LCLINTR) error.c -expect 1 ; \
-       $(LCLINTR) ulrich.c ; \
-       $(LCLINTR) cpptest.c '-D__P(x)=x' ; \
-       $(LCLINTR) longlong.c -expect 4; \
-       $(LCLINTR) subdir/main.c subdir/main.lcl ; \
-       $(LCLINTR) fink.c ; \
-       $(LCLINTR) driverstub.c ; \
-       $(LCLINTR) alignof.c -expect 2 ; \
-       $(LCLINTR) -D DBL_MANT_DIG=25 source.c
+       setenv LCLINT '$(LCLINTRN)'; cd tests2.4 ; $(MAKE) -e
 
 sizeoftest:
        @cd sizeoftest; \
-       $(LCLINTR) +functionconstraint sizeof.c
+       $(LCLINTR) +arraybounds  +arrayboundsread sizeof.c
 
 bufferTest:
        @cd bufferTest; \
-       $(LCLINTR) +functionconstraint test4.c test6.c
+       $(LCLINTR) +arraybounds  +arrayboundsread test4.c test6.c
 
 simplebufferConstraintTests:
        @cd simplebufferConstraintTests; \
-       $(LCLINTR) +functionconstraint m.c  sizeof.c  test3.c  test7.c
+       $(LCLINTR) +arraybounds  +arrayboundsread m.c  sizeof.c  test3.c  test7.c
+
+moreBufferTests:
+       @cd moreBufferTests; \
+       $(LCLINTR) +arraybounds  +arrayboundsread  unrecogCall.c strrchr.c initialization.c simplifyTest.c strncatNotReallyGood.c strncatReallyGood.c
 
 maxset:
        @cd maxset; \
-       $(LCLINTR) -f .lclintrc -booltype "lltX_bool" maxsetannotations.c; \
-       pwd; \
-       echo $(LCLINTR); \
-       $(LCLINTR) -f .lclintrc -booltype "lltX_bool"  maxsetnoannotations.c
+       $(LCLINTR) +arraybounds maxsetannotations.c; \
+       $(LCLINTR) +arraybounds maxsetnoannotations.c -expect 1
 
 globalbufferannotation:
        @cd globalbufferannotation; \
-       $(LCLINTR) +functionconstraint globalvariable.c
-
+       $(LCLINTR) +arraybounds  +arrayboundsread globalvariable.c
 
 strchr:
        @cd strchr; \
-       $(LCLINTR) -f .lclintrc -booltype "lltX_bool" strchr.c
+       $(LCLINTR) +arraybounds +arrayboundsread  strchr.c -expect 2
 
 for:
        @cd for; \
-       $(LCLINTR) -f .lclintrc -booltype "lltX_bool" for.c
+       $(LCLINTR)  +arraybounds  +arrayboundsread  for.c
 
 tests2.5:
        setenv LCLINT '$(LCLINTRN)'; cd tests2.5 ; $(MAKE) -e
 
+metastate:
+       setenv LCLINT '$(LCLINTRN)'; cd metastate ; $(MAKE) -e
+
+mergestate:
+       setenv LCLINT '$(LCLINTRN)'; cd mergestate ; $(MAKE) -e
+
+tainted:
+       setenv LCLINT '$(LCLINTRN)'; cd tainted ; $(MAKE) -e
+
+fileio:
+       setenv LCLINT '$(LCLINTRN)'; cd fileio ; $(MAKE) -e
+
+warnuse:
+       setenv LCLINT '$(LCLINTRN)'; cd warnuse ; $(MAKE) -e
+
+ensuresclauses:
+       setenv LCLINT '$(LCLINTRN)'; cd ensuresclauses ; $(MAKE) -e
+
 ###
 ### Integration Tests
 ###
@@ -629,6 +753,12 @@ tests2.5:
 db1:
        setenv LCLINT '$(LCLINTRN)'; cd db1; $(MAKE) -e test
 
+
+### evans 2000-12-22
+### 2 errors are no longer reported, since eref is immutable.
+### Need to clarify what it means for an object to be immutable;
+### there should be 2 types with different storage requirements.
+
 db2:
        setenv LCLINT '$(LCLINTRN)'; cd db2; $(MAKE) -e test
 
This page took 0.316241 seconds and 4 git commands to generate.