diff options
Diffstat (limited to 'test/Makefile.am')
-rw-r--r-- | test/Makefile.am | 1005 |
1 files changed, 1005 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 0000000..ada5d39 --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,1005 @@ +# +# test/Makefile.am --- automake input file for gawk +# +# Copyright (C) 1988-2005 the Free Software Foundation, Inc. +# +# This file is part of GAWK, the GNU implementation of the +# AWK Programming Language. +# +# GAWK is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# GAWK is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +# + +## process this file with automake to produce Makefile.in + +EXTRA_DIST = \ + reg \ + lib \ + Gentests \ + Maketests \ + README \ + addcomma.awk \ + addcomma.in \ + addcomma.ok \ + anchgsub.awk \ + anchgsub.in \ + anchgsub.ok \ + argarray.awk \ + argarray.in \ + argarray.ok \ + argtest.awk \ + argtest.ok \ + arrayparm.awk \ + arrayparm.ok \ + arrayprm2.awk \ + arrayprm2.ok \ + arrayprm3.awk \ + arrayprm3.ok \ + arrayref.awk \ + arrayref.ok \ + arrymem1.awk \ + arrymem1.ok \ + arryref2.awk \ + arryref2.ok \ + arryref3.awk \ + arryref3.ok \ + arryref4.awk \ + arryref4.ok \ + arryref5.awk \ + arryref5.ok \ + arynasty.awk \ + arynasty.ok \ + arynocls.awk \ + arynocls.in \ + arynocls.ok \ + aryprm1.awk \ + aryprm1.ok \ + aryprm2.awk \ + aryprm2.ok \ + aryprm3.awk \ + aryprm3.ok \ + aryprm4.awk \ + aryprm4.ok \ + aryprm5.awk \ + aryprm5.ok \ + aryprm6.awk \ + aryprm6.ok \ + aryprm7.awk \ + aryprm7.ok \ + aryprm8.awk \ + aryprm8.ok \ + arysubnm.awk \ + arysubnm.ok \ + asgext.awk \ + asgext.in \ + asgext.ok \ + asort.awk \ + asort.ok \ + asorti.awk \ + asorti.ok \ + awkpath.ok \ + back89.awk \ + back89.in \ + back89.ok \ + backgsub.awk \ + backgsub.in \ + backgsub.ok \ + backw.awk \ + backw.in \ + backw.ok \ + badargs.ok \ + childin.awk \ + childin.in \ + childin.ok \ + clobber.awk \ + clobber.ok \ + clos1way.awk \ + clos1way.ok \ + clsflnam.awk \ + clsflnam.in \ + clsflnam.ok \ + compare.awk \ + compare.in \ + compare.ok \ + compare2.awk \ + compare2.ok \ + concat1.awk \ + concat1.in \ + concat1.ok \ + concat2.awk \ + concat2.ok \ + concat3.awk \ + concat3.ok \ + convfmt.awk \ + convfmt.ok \ + datanonl.awk \ + datanonl.in \ + datanonl.ok \ + defref.awk \ + defref.ok \ + delarprm.awk \ + delarprm.ok \ + delarpm2.awk \ + delarpm2.ok \ + delfunc.awk \ + delfunc.ok \ + dynlj.awk \ + dynlj.ok \ + eofsplit.awk \ + eofsplit.ok \ + exitval1.awk \ + exitval1.ok \ + exitval2.awk \ + exitval2.ok \ + fflush.ok \ + fflush.sh \ + fieldwdth.awk \ + fieldwdth.in \ + fieldwdth.ok \ + fldchg.awk \ + fldchg.in \ + fldchg.ok \ + fldchgnf.awk \ + fldchgnf.in \ + fldchgnf.ok \ + fmttest.awk \ + fmttest.ok \ + fnamedat.awk \ + fnamedat.in \ + fnamedat.ok \ + fnarray.awk \ + fnarray.ok \ + fnarray2.awk \ + fnarray2.ok \ + fnarydel.awk \ + fnarydel.ok \ + fnaryscl.awk \ + fnaryscl.ok \ + fnasgnm.awk \ + fnasgnm.in \ + fnasgnm.ok \ + fnmisc.awk \ + fnmisc.ok \ + fnparydl.awk \ + fnparydl.ok \ + fordel.awk \ + fordel.ok \ + forsimp.awk \ + forsimp.ok \ + fsbs.awk \ + fsbs.in \ + fsbs.ok \ + fsfwfs.awk \ + fsfwfs.in \ + fsfwfs.ok \ + fsrs.awk \ + fsrs.in \ + fsrs.ok \ + fsspcoln.awk \ + fsspcoln.in \ + fsspcoln.ok \ + fstabplus.awk \ + fstabplus.in \ + fstabplus.ok \ + funsemnl.awk \ + funsemnl.ok \ + funsmnam.awk \ + funsmnam.ok \ + funstack.awk \ + funstack.in \ + funstack.ok \ + gensub.awk \ + gensub.in \ + gensub.ok \ + gensub2.awk \ + gensub2.ok \ + getline.awk \ + getline.in \ + getline.ok \ + getline2.awk \ + getline2.ok \ + getline3.awk \ + getline3.ok \ + getlnbuf.awk \ + getlnbuf.in \ + getlnbuf.ok \ + getlnhd.awk \ + getlnhd.ok \ + getnr2tb.awk \ + getnr2tb.in \ + getnr2tb.ok \ + getnr2tm.awk \ + getnr2tm.in \ + getnr2tm.ok \ + gnuops2.awk \ + gnuops2.ok \ + gnuops3.awk \ + gnuops3.ok \ + gnureops.awk \ + gnureops.ok \ + gsubasgn.awk \ + gsubasgn.ok \ + gsubtest.awk \ + gsubtest.ok \ + gsubtst2.awk \ + gsubtst2.ok \ + gsubtst3.awk \ + gsubtst3.in \ + gsubtst3.ok \ + gsubtst4.awk \ + gsubtst4.ok \ + gsubtst5.awk \ + gsubtst5.in \ + gsubtst5.ok \ + gtlnbufv.awk \ + hex.awk \ + hex.ok \ + hsprint.awk \ + hsprint.ok \ + icasefs.awk \ + icasefs.ok \ + icasers.awk \ + icasers.in \ + icasers.ok \ + igncdym.awk \ + igncdym.in \ + igncdym.ok \ + igncfs.awk \ + igncfs.in \ + igncfs.ok \ + ignrcase.awk \ + ignrcase.in \ + ignrcase.ok \ + ignrcas2.awk \ + ignrcas2.ok \ + inftest.awk \ + inftest.ok \ + inputred.awk \ + inputred.ok \ + intest.awk \ + intest.ok \ + intprec.awk \ + intprec.ok \ + iobug1.awk \ + iobug1.ok \ + leaddig.awk \ + leaddig.ok \ + leadnl.awk \ + leadnl.in \ + leadnl.ok \ + lint.awk \ + lint.ok \ + litoct.awk \ + litoct.ok \ + longdbl.awk \ + longdbl.in \ + longdbl.ok \ + longsub.awk \ + longsub.in \ + longsub.ok \ + longwrds.awk \ + longwrds.ok \ + longwrds.in \ + manglprm.awk \ + manglprm.in \ + manglprm.ok \ + manyfiles.awk \ + manyfiles.ok \ + match1.awk \ + match1.ok \ + match2.awk \ + match2.ok \ + math.awk \ + math.ok \ + membug1.awk \ + membug1.in \ + membug1.ok \ + messages.awk \ + minusstr.awk \ + minusstr.ok \ + mmap8k.in \ + nasty.awk \ + nasty.ok \ + nasty2.awk \ + nasty2.ok \ + negexp.awk \ + negexp.ok \ + nested.awk \ + nested.in \ + nested.ok \ + nfldstr.awk \ + nfldstr.in \ + nfldstr.ok \ + nfneg.awk \ + nfneg.ok \ + nfset.awk \ + nfset.in \ + nfset.ok \ + nlfldsep.awk \ + nlfldsep.in \ + nlfldsep.ok \ + nlinstr.awk \ + nlinstr.in \ + nlinstr.ok \ + nlstrina.awk \ + nlstrina.ok \ + noeffect.awk \ + noeffect.ok \ + nofmtch.awk \ + nofmtch.ok \ + noloop1.awk \ + noloop1.in \ + noloop1.ok \ + noloop2.awk \ + noloop2.in \ + noloop2.ok \ + nondec.awk \ + nondec.ok \ + nondec2.awk \ + nondec2.ok \ + nonl.awk \ + nonl.ok \ + noparms.awk \ + noparms.ok \ + nors.in \ + nors.ok \ + nulrsend.awk \ + nulrsend.in \ + nulrsend.ok \ + numindex.awk \ + numindex.in \ + numindex.ok \ + numsubstr.awk \ + numsubstr.in \ + numsubstr.ok \ + octsub.awk \ + octsub.ok \ + ofmt.awk \ + ofmt.in \ + ofmt.ok \ + ofmtbig.awk \ + ofmtbig.in \ + ofmtbig.ok \ + ofmtfidl.awk \ + ofmtfidl.in \ + ofmtfidl.ok \ + ofmts.awk \ + ofmts.in \ + ofmts.ok \ + onlynl.awk \ + onlynl.in \ + onlynl.ok \ + opasnidx.awk \ + opasnidx.ok \ + opasnslf.awk \ + opasnslf.ok \ + out1.ok \ + out2.ok \ + out3.ok \ + paramdup.awk \ + paramdup.ok \ + paramtyp.awk \ + paramtyp.ok \ + parseme.awk \ + parseme.ok \ + pcntplus.awk \ + pcntplus.ok \ + pid.awk \ + pid.ok \ + pid.sh \ + pipeio1.awk \ + pipeio1.ok \ + pipeio2.awk \ + pipeio2.in \ + pipeio2.ok \ + posix.awk \ + posix.in \ + posix.ok \ + poundbang.awk \ + prdupval.awk \ + prdupval.in \ + prdupval.ok \ + prec.awk \ + prec.ok \ + printf0.awk \ + printf0.ok \ + printf1.awk \ + printf1.ok \ + printfbad1.awk \ + printfbad1.ok \ + printfloat.awk \ + printlang.awk \ + prmarscl.awk \ + prmarscl.ok \ + prmreuse.awk \ + prmreuse.ok \ + procinfs.awk \ + procinfs.ok \ + prt1eval.awk \ + prt1eval.ok \ + prtoeval.awk \ + prtoeval.ok \ + psx96sub.awk \ + psx96sub.ok \ + rand.awk \ + rand.ok \ + rebt8b1.awk \ + rebt8b1.ok \ + rebt8b2.awk \ + rebt8b2.ok \ + redfilnm.awk \ + redfilnm.in \ + redfilnm.ok \ + regeq.awk \ + regeq.in \ + regeq.ok \ + regtest.sh \ + regx8bit.awk \ + regx8bit.ok \ + rebuf.awk \ + rebuf.in \ + rebuf.ok \ + reindops.awk \ + reindops.in \ + reindops.ok \ + reint.awk \ + reint.in \ + reint.ok \ + reparse.awk \ + reparse.in \ + reparse.ok \ + resplit.awk \ + resplit.in \ + resplit.ok \ + rs.awk \ + rs.in \ + rs.ok \ + rsnul1nl.awk \ + rsnul1nl.in \ + rsnul1nl.ok \ + rsnulbig.ok \ + rsnulbig2.ok \ + rsstart1.awk \ + rsstart1.in \ + rsstart1.ok \ + rsstart2.awk \ + rsstart2.ok \ + rsstart3.ok \ + rstest1.awk \ + rstest1.ok \ + rstest2.awk \ + rstest2.ok \ + rstest3.awk \ + rstest3.ok \ + rstest4.awk \ + rstest4.ok \ + rstest5.awk \ + rstest5.ok \ + rstest6.awk \ + rstest6.in \ + rstest6.ok \ + rswhite.awk \ + rswhite.in \ + rswhite.ok \ + scalar.awk \ + scalar.ok \ + sclforin.awk \ + sclforin.ok \ + sclifin.awk \ + sclifin.ok \ + shadow.awk \ + shadow.ok \ + sort1.awk \ + sort1.ok \ + sortempty.awk \ + sortempty.ok \ + space.ok \ + splitargv.awk \ + splitargv.in \ + splitargv.ok \ + splitarr.awk \ + splitarr.ok \ + splitdef.awk \ + splitdef.ok \ + splitvar.awk \ + splitvar.in \ + splitvar.ok \ + splitwht.awk \ + splitwht.ok \ + sprintfc.awk \ + sprintfc.in \ + sprintfc.ok \ + strcat1.awk \ + strcat1.ok \ + strtod.awk \ + strtod.in \ + strtod.ok \ + strtonum.awk \ + strtonum.ok \ + strftime.awk \ + strftlng.awk \ + strftlng.ok \ + subamp.awk \ + subamp.in \ + subamp.ok \ + subsepnm.awk \ + subsepnm.ok \ + subslash.awk \ + subslash.ok \ + substr.awk \ + substr.ok \ + swaplns.awk \ + swaplns.in \ + swaplns.ok \ + switch2.awk \ + synerr1.awk \ + synerr1.ok \ + tradanch.awk \ + tradanch.in \ + tradanch.ok \ + tweakfld.awk \ + tweakfld.in \ + tweakfld.ok \ + uninit2.awk \ + uninit2.ok \ + uninit3.awk \ + uninit3.ok \ + uninit4.awk \ + uninit4.ok \ + uninitialized.awk \ + uninitialized.ok \ + unterm.awk \ + unterm.ok \ + whiny.awk \ + whiny.in \ + whiny.ok \ + wjposer1.awk \ + wjposer1.in \ + wjposer1.ok \ + zeroe0.awk \ + zeroe0.ok \ + zeroflag.awk \ + zeroflag.ok + +TESTS_WE_ARE_NOT_DOING_YET_FIXME_ONE_DAY = longdbl + +# Get rid of core files when cleaning +CLEANFILES = core core.* + +# try to keep these sorted +BASIC_TESTS = addcomma anchgsub argarray arrayparm arrayref arrymem1 \ + arrayprm2 arrayprm3 arryref2 arryref3 arryref4 arryref5 arynasty \ + arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ + aryprm8 arysubnm asgext awkpath back89 backgsub childin clobber \ + clsflnam compare compare2 concat1 concat2 concat3 convfmt datanonl defref \ + delarprm delarpm2 delfunc dynlj eofsplit exitval1 exitval2 fldchg fldchgnf fmttest fnamedat \ + fnarray fnarray2 fnarydel fnaryscl fnasgnm fnmisc fnparydl \ + fordel forsimp fsbs fsspcoln fsrs fstabplus funsemnl funsmnam funstack getline \ + getline2 getline3 getlnbuf getnr2tb getnr2tm gsubasgn gsubtest \ + gsubtst2 gsubtst3 gsubtst4 gsubtst5 hex hsprint inputred intest \ + intprec iobug1 leaddig leadnl litoct longsub longwrds manglprm math membug1 \ + messages minusstr mmap8k nasty nasty2 negexp nested nfldstr \ + nfneg nfset nlfldsep nlinstr nlstrina noeffect nofmtch noloop1 \ + noloop2 nonl noparms nors nulrsend numindex numsubstr octsub ofmt \ + ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf paramdup paramtyp \ + parseme pcntplus prdupval prec printf0 printf1 prmarscl prmreuse \ + prt1eval prtoeval psx96sub rand rebt8b1 rebt8b2 redfilnm regeq \ + reindops reparse resplit rs rsnul1nl rsnulbig rsnulbig2 rstest1 \ + rstest2 rstest3 rstest4 rstest5 rswhite scalar sclforin sclifin \ + sortempty splitargv splitarr splitdef splitvar splitwht sprintfc \ + strcat1 strtod subamp subsepnm subslash substr swaplns synerr1 tradanch \ + tweakfld uninit2 uninit3 uninit4 uninitialized unterm wjposer1 \ + zeroe0 zeroflag + +UNIX_TESTS = fflush getlnhd pid pipeio1 pipeio2 poundbang space strftlng + +GAWK_EXT_TESTS = argtest asort asorti backw badargs clos1way fieldwdth fsfwfs \ + gensub gensub2 gnuops2 gnuops3 gnureops icasefs icasers igncdym igncfs ignrcase \ + ignrcas2 lint match1 match2 manyfiles nondec nondec2 posix procinfs \ + printfbad1 regx8bit rebuf reint rsstart1 rsstart2 rsstart3 \ + rstest6 shadow sort1 strtonum strftime whiny + +EXTRA_TESTS = regtest inftest + +INET_TESTS = inetechu inetecht inetdayu inetdayt + +# List of the tests which should be run with --lint option: +NEED_LINT = defref noeffect nofmtch shadow uninit2 uninit3 uninit4 uninitialized + +# List of the files that appear in manual tests or are for reserve testing: +GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk switch2.awk + +CMP = cmp +AWKPROG = ../gawk$(EXEEXT) + +# This business forces the locale to be C for running the tests, +# unless we override it to something else for testing. +# +# This can also be done in individual tests where we wish to +# check things specifically not in the C locale. +AWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} $(AWKPROG) + +# Message stuff is to make it a little easier to follow. +# Make the pass-fail last and dependent on others to avoid +# spurious errors if `make -j' in effect. +check: msg \ + printlang \ + basic-msg-start basic basic-msg-end \ + unix-msg-start unix-tests unix-msg-end \ + extend-msg-start gawk-extensions extend-msg-end + @$(MAKE) pass-fail + +basic: $(BASIC_TESTS) + +unix-tests: $(UNIX_TESTS) + +gawk-extensions: $(GAWK_EXT_TESTS) + +extra: $(EXTRA_TESTS) inet + +inet: inetmesg $(INET_TESTS) + +msg:: + @echo '' + @echo 'Any output from "cmp" is bad news, although some differences' + @echo 'in floating point values are probably benign -- in particular,' + @echo 'some systems may omit a leading zero and the floating point' + @echo 'precision may lead to slightly different output in a few cases.' + +printlang:: + @$(AWK) -f $(srcdir)/printlang.awk + +basic-msg-start: + @echo "======== Starting basic tests ========" + +basic-msg-end: + @echo "======== Done with basic tests ========" + +unix-msg-start: + @echo "======== Starting Unix tests ========" + +unix-msg-end: + @echo "======== Done with Unix tests ========" + +extend-msg-start: + @echo "======== Starting gawk extension tests ========" + +extend-msg-end: + @echo "======== Done with gawk extension tests ========" + + +# This test is a PITA because increasingly, /tmp is getting +# mounted noexec. So, we'll test it locally. Sigh. +# +# More PITA; some systems have medium short limits on #! paths, +# so this can still fail +poundbang:: + @echo $@ + @sed "s;/tmp/gawk;`pwd`/$(AWKPROG);" < $(srcdir)/poundbang.awk > ./_pbd.awk + @chmod +x ./_pbd.awk + @if ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@` ; \ + then : ; \ + else \ + sed "s;/tmp/gawk;../$(AWKPROG);" < $(srcdir)/poundbang.awk > ./_pbd.awk ; \ + chmod +x ./_pbd.awk ; \ + LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@`; \ + fi + @-$(CMP) $(srcdir)/poundbang.awk _`basename $@` && rm -f _`basename $@` _pbd.awk + +messages:: + @echo $@ + @$(AWK) -f $(srcdir)/messages.awk >out2 2>out3 + @-$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3 + +argarray:: + @echo $@ + @case $(srcdir) in \ + .) : ;; \ + *) cp $(srcdir)/argarray.in . ;; \ + esac + @TEST=test echo just a test | $(AWK) -f $(srcdir)/argarray.awk ./argarray.in - >_$@ + @case $(srcdir) in \ + .) : ;; \ + *) rm -f ./argarray.in ;; \ + esac + @-$(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@ + +regtest:: + @echo 'Some of the output from regtest is very system specific, do not' + @echo 'be distressed if your output differs from that distributed.' + @echo 'Manual inspection is called for.' + AWK=`pwd`/$(AWK) $(srcdir)/regtest.sh + +manyfiles:: + @echo manyfiles + @rm -rf junk + @mkdir junk + @$(AWK) 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >_$@ + @$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@ + @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l | sed "s/ *//g" > _$@ + @rm -rf junk ; $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +compare:: + @echo $@ + @$(AWK) -f $(srcdir)/compare.awk 0 1 $(srcdir)/compare.in >_$@ + @-$(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@ + +inftest:: + @echo $@ + @echo This test is very machine specific... + @$(AWK) -f $(srcdir)/inftest.awk | sed "s/inf/Inf/g" >_$@ + @-$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@ + +getline2:: + @echo $@ + @$(AWK) -f $(srcdir)/getline2.awk $(srcdir)/getline2.awk $(srcdir)/getline2.awk >_$@ + @-$(CMP) $(srcdir)/getline2.ok _$@ && rm -f _$@ + +awkpath:: + @echo $@ + @AWKPATH="$(srcdir)$(PATH_SEPARATOR)$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@ + @-$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@ + +argtest:: + @echo $@ + @$(AWK) -f $(srcdir)/argtest.awk -x -y abc >_$@ + @-$(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@ + +badargs:: + @echo $@ + @-$(AWK) -f 2>&1 | grep -v patchlevel >_$@ + @-$(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@ + +nonl:: + @echo $@ + @-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1 + @-$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@ + +strftime:: + @echo This test could fail on slow machines or on a minute boundary, + @echo so if it does, double check the actual results: + @echo $@ + @GAWKLOCALE=C; export GAWKLOCALE; \ + TZ=GMT0; export TZ; \ + (LC_ALL=C date) | $(AWK) -v OUTPUT=_$@ -f $(srcdir)/strftime.awk + @-$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0 + +litoct:: + @echo $@ + @echo ab | $(AWK) --traditional -f $(srcdir)/litoct.awk >_$@ + @-$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@ + +fflush:: + @echo $@ + @$(srcdir)/fflush.sh >_$@ + @-$(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@ + +tweakfld:: + @echo $@ + @$(AWK) -f $(srcdir)/tweakfld.awk $(srcdir)/tweakfld.in >_$@ + @rm -f errors.cleanup + @-$(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@ + +mmap8k:: + @echo $@ + @$(AWK) '{ print }' $(srcdir)/mmap8k.in >_$@ + @-$(CMP) $(srcdir)/mmap8k.in _$@ && rm -f _$@ + +tradanch:: + @echo $@ + @$(AWK) --traditional -f $(srcdir)/tradanch.awk $(srcdir)/tradanch.in >_$@ + @-$(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@ + +# AIX /bin/sh exec's the last command in a list, therefore issue a ":" +# command so that pid.sh is fork'ed as a child before being exec'ed. +pid:: + @echo pid + @AWKPATH=$(srcdir) AWK=$(AWKPROG) $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; : + @-$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in + +strftlng:: + @echo $@ + @TZ=UTC; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ + @if $(CMP) $(srcdir)/strftlng.ok _$@ >/dev/null 2>&1 ; then : ; else \ + TZ=UTC0; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \ + fi + @-$(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@ + +nors:: + @echo $@ + @echo A B C D E | tr -d '\12\15' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@ + @-$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@ + +reint:: + @echo $@ + @$(AWK) --re-interval -f $(srcdir)/reint.awk $(srcdir)/reint.in >_$@ + @-$(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@ + +pipeio1:: + @echo $@ + @$(AWK) -f $(srcdir)/pipeio1.awk >_$@ + @rm -f test1 test2 + @-$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@ + +pipeio2:: + @echo $@ + @$(AWK) -v SRCDIR=$(srcdir) -f $(srcdir)/pipeio2.awk >_$@ + @-$(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@ + +clobber:: + @echo $@ + @$(AWK) -f $(srcdir)/clobber.awk >_$@ + @-$(CMP) $(srcdir)/clobber.ok seq && $(CMP) $(srcdir)/clobber.ok _$@ && rm -f _$@ + @rm -f seq + +arynocls:: + @echo $@ + @-AWKPATH=$(srcdir) $(AWK) -v INPUT=$(srcdir)/arynocls.in -f arynocls.awk >_$@ + @-$(CMP) $(srcdir)/arynocls.ok _$@ && rm -f _$@ + +getlnbuf:: + @echo $@ + @-AWKPATH=$(srcdir) $(AWK) -f getlnbuf.awk $(srcdir)/getlnbuf.in > _$@ + @-AWKPATH=$(srcdir) $(AWK) -f gtlnbufv.awk $(srcdir)/getlnbuf.in > _2$@ + @-$(CMP) $(srcdir)/getlnbuf.ok _$@ && $(CMP) $(srcdir)/getlnbuf.ok _2$@ && rm -f _$@ _2$@ + +inetmesg:: + @echo These tests only work if your system supports the services + @echo "'discard'" at port 9 and "'daytimed'" at port 13. Check your + @echo file /etc/services and do "'netstat -a'". + +inetechu:: + @echo This test is for establishing UDP connections + @$(AWK) 'BEGIN {print "" |& "/inet/udp/0/127.0.0.1/9"}' + +inetecht:: + @echo This test is for establishing TCP connections + @$(AWK) 'BEGIN {print "" |& "/inet/tcp/0/127.0.0.1/9"}' + +inetdayu:: + @echo This test is for bidirectional UDP transmission + @$(AWK) 'BEGIN { print "" |& "/inet/udp/0/127.0.0.1/13"; \ + "/inet/udp/0/127.0.0.1/13" |& getline; print $0}' + +inetdayt:: + @echo This test is for bidirectional TCP transmission + @$(AWK) 'BEGIN { print "" |& "/inet/tcp/0/127.0.0.1/13"; \ + "/inet/tcp/0/127.0.0.1/13" |& getline; print $0}' + +redfilnm:: + @echo $@ + @$(AWK) -f $(srcdir)/redfilnm.awk srcdir=$(srcdir) $(srcdir)/redfilnm.in >_$@ + @-$(CMP) $(srcdir)/redfilnm.ok _$@ && rm -f _$@ + +leaddig:: + @echo $@ + @$(AWK) -v x=2E -f $(srcdir)/leaddig.awk >_$@ + @-$(CMP) $(srcdir)/leaddig.ok _$@ && rm -f _$@ + +gsubtst3:: + @echo $@ + @$(AWK) --re-interval -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +space:: + @echo $@ + @$(AWK) -f ' ' $(srcdir)/space.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +printf0:: + @echo $@ + @$(AWK) --posix -f $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +rsnulbig:: + @echo $@ + @ : Suppose that block size for pipe is at most 128kB: + @$(AWK) 'BEGIN { for (i = 1; i <= 128*64+1; i++) print "abcdefgh123456\n" }' 2>&1 | \ + $(AWK) 'BEGIN { RS = ""; ORS = "\n\n" }; { print }' 2>&1 | \ + $(AWK) '/^[^a]/; END{ print NR }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +rsnulbig2:: + @echo $@ + @$(AWK) 'BEGIN { ORS = ""; n = "\n"; for (i = 1; i <= 10; i++) n = (n n); \ + for (i = 1; i <= 128; i++) print n; print "abc\n" }' 2>&1 | \ + $(AWK) 'BEGIN { RS = ""; ORS = "\n\n" };{ print }' 2>&1 | \ + $(AWK) '/^[^a]/; END { print NR }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +whiny:: + @echo $@ + @WHINY_USERS=1 $(AWK) -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +ignrcas2:: + @echo $@ + @GAWKLOCALE=en_US ; export GAWKLOCALE ; \ + $(AWK) -f $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +subamp:: + @echo $@ + @GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \ + $(AWK) -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +# This test makes sure gawk exits with a zero code. +# Thus, unconditionally generate the exit code. +exitval1:: + @echo $@ + @$(AWK) -f $(srcdir)/exitval1.awk >_$@ 2>&1; echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +fsspcoln:: + @echo $@ + @$(AWK) -f $(srcdir)/$@.awk 'FS=[ :]+' $(srcdir)/$@.in >_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +rsstart1:: + @echo $@ + @$(AWK) -f $(srcdir)/$@.awk $(srcdir)/rsstart1.in >_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +rsstart2:: + @echo $@ + @$(AWK) -f $(srcdir)/$@.awk $(srcdir)/rsstart1.in >_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +rsstart3:: + @echo $@ + @head $(srcdir)/rsstart1.in | $(AWK) -f $(srcdir)/rsstart2.awk >_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +nondec2:: + @echo $@ + @$(AWK) --non-decimal-data -v a=0x1 -f $(srcdir)/$@.awk >_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +# Targets generated for other tests: +include Maketests + +$(srcdir)/Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests + $(AWK) -f $(srcdir)/Gentests "$(srcdir)/Makefile.am" *.awk *.in > $(srcdir)/Maketests + +clean: + rm -fr _* core core.* junk out1 out2 out3 strftime.ok test1 test2 seq *~ + +# An attempt to print something that can be grepped for in build logs +pass-fail: + @COUNT=`ls _* 2>/dev/null | wc -l` ; \ + if test $$COUNT = 0 ; \ + then echo ALL TESTS PASSED ; \ + else echo $$COUNT TESTS FAILED ; \ + fi + +# This target for my convenience to look at all the results +diffout: + for i in _* ; \ + do \ + echo ============== $$i ============= ; \ + diff -c $(srcdir)/$${i#_}.ok $$i ; \ + done | more + +# This target is for testing with electric fence. +efence: + for i in $$(ls _* | sed 's;_\(.*\);\1;') ; \ + do \ + bad=$$(wc -l < _$$i) \ + ok=$$(wc -l < $$i.ok) ; \ + if (( $$bad == $$ok + 2 )) ; \ + then \ + rm _$$i ; \ + fi ; \ + done |