diff options
| author | Arnold D. Robbins <arnold@skeeve.com> | 2015-03-17 22:59:28 +0200 |
|---|---|---|
| committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-03-17 22:59:28 +0200 |
| commit | a1b68a54a8fdd7a61ab9aaf19a5ada599cfb08e7 (patch) | |
| tree | 639d0ffbb2c36b982c42b144087e57e857bafe64 /test | |
| parent | 17e974bac1ab2b101cc3ba5fcef61725b7469c7b (diff) | |
| parent | cd2ff61aaf4938092517880ad7655828d99a3cb9 (diff) | |
| download | gawk-memory-work.tar.gz | |
Merge branch 'master' into memory-workmemory-work
Diffstat (limited to 'test')
| -rw-r--r-- | test/ChangeLog | 79 | ||||
| -rw-r--r-- | test/Makefile.am | 55 | ||||
| -rw-r--r-- | test/Makefile.in | 112 | ||||
| -rw-r--r-- | test/Maketests | 30 | ||||
| -rw-r--r-- | test/callparam.awk | 6 | ||||
| -rw-r--r-- | test/callparam.ok | 2 | ||||
| -rw-r--r--[-rwxr-xr-x] | test/charasbytes.awk | 0 | ||||
| -rw-r--r-- | test/crlf.awk | 11 | ||||
| -rw-r--r-- | test/crlf.ok | 3 | ||||
| -rwxr-xr-x | test/exit.sh | 2 | ||||
| -rw-r--r-- | test/fpat4.awk | 105 | ||||
| -rw-r--r-- | test/fpat4.ok | 65 | ||||
| -rw-r--r-- | test/mpfrmemok1.awk | 7 | ||||
| -rw-r--r-- | test/mpfrmemok1.ok | 7 | ||||
| -rw-r--r-- | test/nonfatal1.awk | 6 | ||||
| -rw-r--r-- | test/nonfatal1.ok | 2 | ||||
| -rw-r--r-- | test/nonfatal2.awk | 5 | ||||
| -rw-r--r-- | test/nonfatal2.ok | 1 | ||||
| -rw-r--r-- | test/nonfatal3.awk | 6 | ||||
| -rw-r--r-- | test/nonfatal3.ok | 1 | ||||
| -rw-r--r--[-rwxr-xr-x] | test/ofs1.awk | 0 | ||||
| -rw-r--r-- | test/paramasfunc1.awk | 9 | ||||
| -rw-r--r-- | test/paramasfunc1.ok | 3 | ||||
| -rw-r--r-- | test/paramasfunc2.awk | 10 | ||||
| -rw-r--r-- | test/paramasfunc2.ok | 3 | ||||
| -rw-r--r-- | test/profile0.awk | 1 | ||||
| -rw-r--r-- | test/profile0.in | 2 | ||||
| -rw-r--r-- | test/profile0.ok | 6 | ||||
| -rw-r--r--[-rwxr-xr-x] | test/range1.awk | 0 | ||||
| -rw-r--r--[-rwxr-xr-x] | test/sortglos.awk | 0 | ||||
| -rw-r--r--[-rwxr-xr-x] | test/sortglos.in | 0 |
31 files changed, 519 insertions, 20 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 19105027..e9848c4b 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,82 @@ +2015-03-17 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (mpfrmemok1): New test. + * mpfrmemok1.awk, mpfrmemok1.ok: New files. + +2015-03-10 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (fpat4): New test. + * fpat4.awk, fpat4.ok: New files. + +2015-03-08 Arnold D. Robbins <arnold@skeeve.com> + + * nonfatal3.awk, nonfatal3.ok: Adjust for portability. + Thanks to Hermann Peifer for the report. + +2015-03-06 Arnold D. Robbins <arnold@skeeve.com> + + * charasbytes.awk, ofs1.awk, range1.awk, sortglos.awk, + sortglos.in: Remove execute permission. + +2015-03-02 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * nonfatal1.awk: Do not print ERRNO, since the value appears to be + platform-dependent. Instead, print (ERRNO != ""). + * nonfatal1.ok: Update. + +2015-02-28 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * Makefile.am (EXTRA_DIST): Add nonfatal3.{awk,ok}. + (GAWK_EXT_TESTS): Add nonfatal3. + * nonfatal1.awk: Replace "ti10/357" with "local:host/25", since + "local:host" should be a universally bad hostname due to the + invalid ":" character. + * nonfatal1.ok: Update. + * nonfatal3.{awk,ok}: New test for connecting to a TCP port where + nobody is listening. + +2015-02-27 Arnold D. Robbins <arnold@skeeve.com> + + * nonfatal1.ok: Update after code changes. + +2015-02-26 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (EXTRA_DIST): Add profile0.in which got forgotten + earlier. Ooops. + +2015-02-24 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (crlf): New test. + * crlf.awk, crlf.ok: New files. + +2015-02-10 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (profile0): New test. + * profile0.awk, profile0.in, profile0.ok: New files. + +2015-02-08 Arnold D. Robbins <arnold@skeeve.com> + + * nonfatal1.awk, nonfatal2.awk: String is now "NONFATAL". + +2015-02-06 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (nonfatal1, nonfatal2): New tests. + * nonfatal1.awk, nonfatal1.ok: New files. + * nonfatal2.awk, nonfatal2.ok: New files. + +2015-02-01 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (paramasfunc1, paramasfunc2): Now need --posix. + * indirectcall.awk: Restore after code change. + +2015-01-30 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (callparam, paramasfunc1, paramasfunc2): New tests. + * callparam.awk, callparam.ok: New files. + * paramasfunc1.awk, paramasfunc1.ok: New files. + * paramasfunc2.awk, paramasfunc2.ok: New files. + * exit.sh, indirectcall.awk: Update after code change. + 2015-01-19 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (profile8): Actually add the test and the files. diff --git a/test/Makefile.am b/test/Makefile.am index 8f501b56..d2cd0ddd 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -132,6 +132,8 @@ EXTRA_DIST = \ beginfile2.ok \ beginfile2.sh \ binmode1.ok \ + callparam.awk \ + callparam.ok \ charasbytes.awk \ charasbytes.in \ charasbytes.ok \ @@ -167,6 +169,8 @@ EXTRA_DIST = \ concat4.ok \ convfmt.awk \ convfmt.ok \ + crlf.awk \ + crlf.ok \ datanonl.awk \ datanonl.in \ datanonl.ok \ @@ -281,6 +285,8 @@ EXTRA_DIST = \ fpat3.awk \ fpat3.in \ fpat3.ok \ + fpat4.awk \ + fpat4.ok \ fpatnull.awk \ fpatnull.in \ fpatnull.ok \ @@ -531,6 +537,8 @@ EXTRA_DIST = \ mpfrexprange.ok \ mpfrieee.awk \ mpfrieee.ok \ + mpfrmemok1.awk \ + mpfrmemok1.ok \ mpfrnegzero.awk \ mpfrnegzero.ok \ mpfrnr.awk \ @@ -595,6 +603,12 @@ EXTRA_DIST = \ nondec.ok \ nondec2.awk \ nondec2.ok \ + nonfatal1.awk \ + nonfatal1.ok \ + nonfatal2.awk \ + nonfatal2.ok \ + nonfatal3.awk \ + nonfatal3.ok \ nonl.awk \ nonl.ok \ noparms.awk \ @@ -642,6 +656,10 @@ EXTRA_DIST = \ out1.ok \ out2.ok \ out3.ok \ + paramasfunc1.awk \ + paramasfunc1.ok \ + paramasfunc2.awk \ + paramasfunc2.ok \ paramdup.awk \ paramdup.ok \ paramres.awk \ @@ -704,6 +722,9 @@ EXTRA_DIST = \ prmreuse.ok \ procinfs.awk \ procinfs.ok \ + profile0.awk \ + profile0.in \ + profile0.ok \ profile2.ok \ profile3.awk \ profile3.ok \ @@ -987,7 +1008,7 @@ BASIC_TESTS = \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 arysubnm asgext awkpath \ back89 backgsub badassign1 badbuild \ - childin clobber closebad clsflnam compare compare2 concat1 concat2 \ + callparam childin clobber closebad clsflnam compare compare2 concat1 concat2 \ concat3 concat4 convfmt \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ eofsplit exit2 exitval1 exitval2 \ @@ -1005,6 +1026,7 @@ BASIC_TESTS = \ nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \ noparms nors nulrsend numindex numsubstr \ octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofs1 onlynl opasnidx opasnslf \ + paramasfunc1 paramasfunc2 \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \ prt1eval prtoeval \ @@ -1025,8 +1047,8 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ - fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ + colonwarn clos1way crlf dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ + fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ icasefs icasers id igncdym igncfs ignrcas2 ignrcase \ @@ -1035,8 +1057,9 @@ GAWK_EXT_TESTS = \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ + nonfatal1 nonfatal2 nonfatal3 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 profile7 \ + profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 \ profile8 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ @@ -1050,8 +1073,8 @@ INET_TESTS = inetdayu inetdayt inetechu inetecht MACHINE_TESTS = double1 double2 fmtspcl intformat -MPFR_TESTS = mpfrnr mpfrnegzero mpfrrem mpfrrnd mpfrieee mpfrexprange \ - mpfrsort mpfrsqrt mpfrbigint +MPFR_TESTS = mpfrnr mpfrnegzero mpfrmemok1 mpfrrem mpfrrnd mpfrieee \ + mpfrexprange mpfrsort mpfrsqrt mpfrbigint LOCALE_CHARSET_TESTS = \ asort asorti backbigs1 backsmalls1 backsmalls2 \ @@ -1687,6 +1710,12 @@ dumpvars:: @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile0: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + profile1: @echo $@ @$(AWK) -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1 @@ -1801,6 +1830,11 @@ mpfrrem: @$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1 @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +mpfrmemok1: + @echo $@ + @$(AWK) -p/dev/stdout -M -f "$(srcdir)"/$@.awk 2>&1 | sed 1d > _$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + jarebug:: @echo $@ @"$(srcdir)"/$@.sh "$(AWKPROG)" "$(srcdir)"/$@.awk "$(srcdir)"/$@.in "_$@" @@ -2019,6 +2053,15 @@ genpot: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --gen-pot >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +paramasfunc1:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +paramasfunc2:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ # Targets generated for other tests: include Maketests diff --git a/test/Makefile.in b/test/Makefile.in index d4097f3d..cf8093b8 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -37,7 +37,17 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -100,9 +110,6 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(srcdir)/Maketests $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(top_srcdir)/mkinstalldirs ChangeLog \ - README subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \ @@ -118,6 +125,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -142,6 +150,8 @@ am__can_run_installinfo = \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Maketests \ + $(top_srcdir)/mkinstalldirs ChangeLog README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -379,6 +389,8 @@ EXTRA_DIST = \ beginfile2.ok \ beginfile2.sh \ binmode1.ok \ + callparam.awk \ + callparam.ok \ charasbytes.awk \ charasbytes.in \ charasbytes.ok \ @@ -414,6 +426,8 @@ EXTRA_DIST = \ concat4.ok \ convfmt.awk \ convfmt.ok \ + crlf.awk \ + crlf.ok \ datanonl.awk \ datanonl.in \ datanonl.ok \ @@ -528,6 +542,8 @@ EXTRA_DIST = \ fpat3.awk \ fpat3.in \ fpat3.ok \ + fpat4.awk \ + fpat4.ok \ fpatnull.awk \ fpatnull.in \ fpatnull.ok \ @@ -778,6 +794,8 @@ EXTRA_DIST = \ mpfrexprange.ok \ mpfrieee.awk \ mpfrieee.ok \ + mpfrmemok1.awk \ + mpfrmemok1.ok \ mpfrnegzero.awk \ mpfrnegzero.ok \ mpfrnr.awk \ @@ -842,6 +860,12 @@ EXTRA_DIST = \ nondec.ok \ nondec2.awk \ nondec2.ok \ + nonfatal1.awk \ + nonfatal1.ok \ + nonfatal2.awk \ + nonfatal2.ok \ + nonfatal3.awk \ + nonfatal3.ok \ nonl.awk \ nonl.ok \ noparms.awk \ @@ -889,6 +913,10 @@ EXTRA_DIST = \ out1.ok \ out2.ok \ out3.ok \ + paramasfunc1.awk \ + paramasfunc1.ok \ + paramasfunc2.awk \ + paramasfunc2.ok \ paramdup.awk \ paramdup.ok \ paramres.awk \ @@ -951,6 +979,9 @@ EXTRA_DIST = \ prmreuse.ok \ procinfs.awk \ procinfs.ok \ + profile0.awk \ + profile0.in \ + profile0.ok \ profile2.ok \ profile3.awk \ profile3.ok \ @@ -1233,7 +1264,7 @@ BASIC_TESTS = \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 arysubnm asgext awkpath \ back89 backgsub badassign1 badbuild \ - childin clobber closebad clsflnam compare compare2 concat1 concat2 \ + callparam childin clobber closebad clsflnam compare compare2 concat1 concat2 \ concat3 concat4 convfmt \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ eofsplit exit2 exitval1 exitval2 \ @@ -1251,6 +1282,7 @@ BASIC_TESTS = \ nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \ noparms nors nulrsend numindex numsubstr \ octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofs1 onlynl opasnidx opasnslf \ + paramasfunc1 paramasfunc2 \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \ prt1eval prtoeval \ @@ -1271,8 +1303,8 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ - fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ + colonwarn clos1way crlf dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ + fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ icasefs icasers id igncdym igncfs ignrcas2 ignrcase \ @@ -1281,8 +1313,9 @@ GAWK_EXT_TESTS = \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ + nonfatal1 nonfatal2 nonfatal3 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 profile7 \ + profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 \ profile8 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ @@ -1293,8 +1326,8 @@ GAWK_EXT_TESTS = \ EXTRA_TESTS = inftest regtest INET_TESTS = inetdayu inetdayt inetechu inetecht MACHINE_TESTS = double1 double2 fmtspcl intformat -MPFR_TESTS = mpfrnr mpfrnegzero mpfrrem mpfrrnd mpfrieee mpfrexprange \ - mpfrsort mpfrsqrt mpfrbigint +MPFR_TESTS = mpfrnr mpfrnegzero mpfrmemok1 mpfrrem mpfrrnd mpfrieee \ + mpfrexprange mpfrsort mpfrsqrt mpfrbigint LOCALE_CHARSET_TESTS = \ asort asorti backbigs1 backsmalls1 backsmalls2 \ @@ -1361,7 +1394,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/Maketests $(am__configur echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -1370,6 +1402,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; +$(srcdir)/Maketests $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -1528,6 +1561,8 @@ uninstall-am: maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am +.PRECIOUS: Makefile + # Message stuff is to make it a little easier to follow. # Make the pass-fail last and dependent on others to avoid @@ -2113,6 +2148,12 @@ dumpvars:: @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile0: + @echo $@ + @$(AWK) --profile=ap-$@.out -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in > /dev/null + @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + profile1: @echo $@ @$(AWK) -f "$(srcdir)"/xref.awk "$(srcdir)"/dtdgport.awk > _$@.out1 @@ -2226,6 +2267,11 @@ mpfrrem: @$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1 @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +mpfrmemok1: + @echo $@ + @$(AWK) -p/dev/stdout -M -f "$(srcdir)"/$@.awk 2>&1 | sed 1d > _$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + jarebug:: @echo $@ @"$(srcdir)"/$@.sh "$(AWKPROG)" "$(srcdir)"/$@.awk "$(srcdir)"/$@.in "_$@" @@ -2442,6 +2488,16 @@ genpot: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --gen-pot >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +paramasfunc1:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +paramasfunc2:: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --posix >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: @@ -2574,6 +2630,11 @@ badbuild: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +callparam: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + childin: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -3401,6 +3462,11 @@ backw: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +crlf: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + delsub: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -3426,6 +3492,11 @@ fpat3: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +fpat4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fpatnull: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -3586,6 +3657,21 @@ nondec: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +nonfatal1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nonfatal2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nonfatal3: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + patsplit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 5c4c40f9..5011fb1f 100644 --- a/test/Maketests +++ b/test/Maketests @@ -130,6 +130,11 @@ badbuild: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +callparam: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + childin: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -957,6 +962,11 @@ backw: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +crlf: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + delsub: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -982,6 +992,11 @@ fpat3: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +fpat4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fpatnull: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1142,6 +1157,21 @@ nondec: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +nonfatal1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nonfatal2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nonfatal3: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + patsplit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/callparam.awk b/test/callparam.awk new file mode 100644 index 00000000..b925db01 --- /dev/null +++ b/test/callparam.awk @@ -0,0 +1,6 @@ +BEGIN { f() } + +function f( a, b) +{ + a = b() +} diff --git a/test/callparam.ok b/test/callparam.ok new file mode 100644 index 00000000..00a027e8 --- /dev/null +++ b/test/callparam.ok @@ -0,0 +1,2 @@ +gawk: callparam.awk:5: error: attempt to use non-function `b' in function call +EXIT CODE: 1 diff --git a/test/charasbytes.awk b/test/charasbytes.awk index feb195c8..feb195c8 100755..100644 --- a/test/charasbytes.awk +++ b/test/charasbytes.awk diff --git a/test/crlf.awk b/test/crlf.awk new file mode 100644 index 00000000..79be9eb6 --- /dev/null +++ b/test/crlf.awk @@ -0,0 +1,11 @@ +BEGIN {
+ print \
+ "hi there"
+ print "hello \
+world"
+ if ("foo" ~ /fo\
+o/)
+ print "matches"
+ else
+ print "does not match!"
+}
diff --git a/test/crlf.ok b/test/crlf.ok new file mode 100644 index 00000000..0ba071b5 --- /dev/null +++ b/test/crlf.ok @@ -0,0 +1,3 @@ +hi there +hello world +matches diff --git a/test/exit.sh b/test/exit.sh index 9510dcdc..3922f83c 100755 --- a/test/exit.sh +++ b/test/exit.sh @@ -30,7 +30,7 @@ x='function f(){ exit}; BEGINFILE {f()}; NR>1{ f()}; END{print NR}' $AWK 'BEGIN { print "a\nb" }' | $AWK "$x" echo "-- 5" -y='function strip(f) { sub(/.*\//, "", f); return f };' +y='function strip(val) { sub(/.*\//, "", val); return val };' x='BEGINFILE{if(++i==1) exit;}; END{print i, strip(FILENAME)}' $AWK "$y$x" /dev/null $0 diff --git a/test/fpat4.awk b/test/fpat4.awk new file mode 100644 index 00000000..79cd6a7f --- /dev/null +++ b/test/fpat4.awk @@ -0,0 +1,105 @@ +BEGIN { + false = 0 + true = 1 + + fpat[1] = "([^,]*)|(\"[^\"]+\")" + fpat[2] = fpat[1] + fpat[3] = fpat[1] + fpat[4] = "aa+" + fpat[5] = fpat[4] + fpat[6] = "[a-z]" + + data[1] = "Robbins,,Arnold," + data[2] = "Smith,,\"1234 A Pretty Place, NE\",Sometown,NY,12345-6789,USA" + data[3] = "Robbins,Arnold,\"1234 A Pretty Place, NE\",Sometown,NY,12345-6789,USA" + data[4] = "bbbaaacccdddaaaaaqqqq" + data[5] = "bbbaaacccdddaaaaaqqqqa" # should get trailing qqqa + data[6] = "aAbBcC" + + for (i = 1; i in data; i++) { + printf("Splitting: <%s>\n", data[i]) + n = mypatsplit(data[i], fields, fpat[i], seps) + m = patsplit(data[i], fields2, fpat[i], seps2) + print "n =", n, "m =", m + if (n != m) { + printf("ERROR: counts wrong!\n") > "/dev/stderr" + exit 1 + } + for (j = 1; j <= n; j++) { + printf("fields[%d] = <%s>\tfields2[%d] = <%s>\n", j, fields[j], j, fields2[j]) + if (fields[j] != fields2[j]) { + printf("ERROR: data %d, field %d mismatch!\n", i, j) > "/dev/stderr" + exit 1 + } + } + for (j = 0; j in seps; j++) { + printf("seps[%d] = <%s>\tseps2[%d] = <%s>\n", j, seps[j], j, seps2[j]) + if (seps[j] != seps2[j]) { + printf("ERROR: data %d, separator %d mismatch!\n", i, j) > "/dev/stderr" + exit 1 + } + } + } +} + +function mypatsplit(string, array, pattern, seps, + eosflag, non_empty, nf) # locals +{ + delete array + delete seps + if (length(string) == 0) + return 0 + + eosflag = non_empty = false + nf = 0 + while (match(string, pattern)) { + if (RLENGTH > 0) { # easy case + non_empty = true + if (! (nf in seps)) { + if (RSTART == 1) # match at front of string + seps[nf] = "" + else + seps[nf] = substr(string, 1, RSTART - 1) + } + array[++nf] = substr(string, RSTART, RLENGTH) + string = substr(string, RSTART+RLENGTH) + if (length(string) == 0) + break + } else if (non_empty) { + # last match was non-empty, and at the + # current character we get a zero length match, + # which we don't want, so skip over it + non_empty = false + seps[nf] = substr(string, 1, 1) + string = substr(string, 2) + } else { + # 0 length match + if (! (nf in seps)) { + if (RSTART == 1) + seps[nf] = "" + else + seps[nf] = substr(string, 1, RSTART - 1) + } + array[++nf] = "" + if (! non_empty && ! eosflag) { # prev was empty + seps[nf] = substr(string, 1, 1) + } + if (RSTART == 1) { + string = substr(string, 2) + } else { + string = substr(string, RSTART + 1) + } + non_empty = false + } + if (length(string) == 0) { + if (eosflag) + break + else + eosflag = true + } + } + if (length(string) > 0) + seps[nf] = string + + return length(array) +} diff --git a/test/fpat4.ok b/test/fpat4.ok new file mode 100644 index 00000000..b4430aba --- /dev/null +++ b/test/fpat4.ok @@ -0,0 +1,65 @@ +Splitting: <Robbins,,Arnold,> +n = 4 m = 4 +fields[1] = <Robbins> fields2[1] = <Robbins> +fields[2] = <> fields2[2] = <> +fields[3] = <Arnold> fields2[3] = <Arnold> +fields[4] = <> fields2[4] = <> +seps[0] = <> seps2[0] = <> +seps[1] = <,> seps2[1] = <,> +seps[2] = <,> seps2[2] = <,> +seps[3] = <,> seps2[3] = <,> +Splitting: <Smith,,"1234 A Pretty Place, NE",Sometown,NY,12345-6789,USA> +n = 7 m = 7 +fields[1] = <Smith> fields2[1] = <Smith> +fields[2] = <> fields2[2] = <> +fields[3] = <"1234 A Pretty Place, NE"> fields2[3] = <"1234 A Pretty Place, NE"> +fields[4] = <Sometown> fields2[4] = <Sometown> +fields[5] = <NY> fields2[5] = <NY> +fields[6] = <12345-6789> fields2[6] = <12345-6789> +fields[7] = <USA> fields2[7] = <USA> +seps[0] = <> seps2[0] = <> +seps[1] = <,> seps2[1] = <,> +seps[2] = <,> seps2[2] = <,> +seps[3] = <,> seps2[3] = <,> +seps[4] = <,> seps2[4] = <,> +seps[5] = <,> seps2[5] = <,> +seps[6] = <,> seps2[6] = <,> +Splitting: <Robbins,Arnold,"1234 A Pretty Place, NE",Sometown,NY,12345-6789,USA> +n = 7 m = 7 +fields[1] = <Robbins> fields2[1] = <Robbins> +fields[2] = <Arnold> fields2[2] = <Arnold> +fields[3] = <"1234 A Pretty Place, NE"> fields2[3] = <"1234 A Pretty Place, NE"> +fields[4] = <Sometown> fields2[4] = <Sometown> +fields[5] = <NY> fields2[5] = <NY> +fields[6] = <12345-6789> fields2[6] = <12345-6789> +fields[7] = <USA> fields2[7] = <USA> +seps[0] = <> seps2[0] = <> +seps[1] = <,> seps2[1] = <,> +seps[2] = <,> seps2[2] = <,> +seps[3] = <,> seps2[3] = <,> +seps[4] = <,> seps2[4] = <,> +seps[5] = <,> seps2[5] = <,> +seps[6] = <,> seps2[6] = <,> +Splitting: <bbbaaacccdddaaaaaqqqq> +n = 2 m = 2 +fields[1] = <aaa> fields2[1] = <aaa> +fields[2] = <aaaaa> fields2[2] = <aaaaa> +seps[0] = <bbb> seps2[0] = <bbb> +seps[1] = <cccddd> seps2[1] = <cccddd> +seps[2] = <qqqq> seps2[2] = <qqqq> +Splitting: <bbbaaacccdddaaaaaqqqqa> +n = 2 m = 2 +fields[1] = <aaa> fields2[1] = <aaa> +fields[2] = <aaaaa> fields2[2] = <aaaaa> +seps[0] = <bbb> seps2[0] = <bbb> +seps[1] = <cccddd> seps2[1] = <cccddd> +seps[2] = <qqqqa> seps2[2] = <qqqqa> +Splitting: <aAbBcC> +n = 3 m = 3 +fields[1] = <a> fields2[1] = <a> +fields[2] = <b> fields2[2] = <b> +fields[3] = <c> fields2[3] = <c> +seps[0] = <> seps2[0] = <> +seps[1] = <A> seps2[1] = <A> +seps[2] = <B> seps2[2] = <B> +seps[3] = <C> seps2[3] = <C> diff --git a/test/mpfrmemok1.awk b/test/mpfrmemok1.awk new file mode 100644 index 00000000..9331a34d --- /dev/null +++ b/test/mpfrmemok1.awk @@ -0,0 +1,7 @@ +# This program tests that -M works with profiling. +# It does not do anything real, but there should not be glibc memory +# errors and it should be valgrind-clean too. + +BEGIN { + v = 0x0100000000000000000000000000000000 +} diff --git a/test/mpfrmemok1.ok b/test/mpfrmemok1.ok new file mode 100644 index 00000000..2389a2d5 --- /dev/null +++ b/test/mpfrmemok1.ok @@ -0,0 +1,7 @@ + + # BEGIN rule(s) + + BEGIN { + 1 v = 340282366920938463463374607431768211456 + } + diff --git a/test/nonfatal1.awk b/test/nonfatal1.awk new file mode 100644 index 00000000..a9228f3a --- /dev/null +++ b/test/nonfatal1.awk @@ -0,0 +1,6 @@ +BEGIN { + PROCINFO["NONFATAL"] + # note that ":" is not a valid hostname character + print |& "/inet/tcp/0/local:host/25" + print (ERRNO != "") +} diff --git a/test/nonfatal1.ok b/test/nonfatal1.ok new file mode 100644 index 00000000..51583f2c --- /dev/null +++ b/test/nonfatal1.ok @@ -0,0 +1,2 @@ +gawk: nonfatal1.awk:4: warning: remote host and port information (local:host, 25) invalid +1 diff --git a/test/nonfatal2.awk b/test/nonfatal2.awk new file mode 100644 index 00000000..fedbba43 --- /dev/null +++ b/test/nonfatal2.awk @@ -0,0 +1,5 @@ +BEGIN { + PROCINFO["NONFATAL"] = 1 + print > "/dev/no/such/file" + print ERRNO +} diff --git a/test/nonfatal2.ok b/test/nonfatal2.ok new file mode 100644 index 00000000..ddc88691 --- /dev/null +++ b/test/nonfatal2.ok @@ -0,0 +1 @@ +No such file or directory diff --git a/test/nonfatal3.awk b/test/nonfatal3.awk new file mode 100644 index 00000000..b2a4ec9e --- /dev/null +++ b/test/nonfatal3.awk @@ -0,0 +1,6 @@ +BEGIN { + PROCINFO["NONFATAL"] + # valid host but bogus port + print |& "/inet/tcp/0/localhost/0" + print ERRNO != "" +} diff --git a/test/nonfatal3.ok b/test/nonfatal3.ok new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/test/nonfatal3.ok @@ -0,0 +1 @@ +1 diff --git a/test/ofs1.awk b/test/ofs1.awk index 83b3c2a5..83b3c2a5 100755..100644 --- a/test/ofs1.awk +++ b/test/ofs1.awk diff --git a/test/paramasfunc1.awk b/test/paramasfunc1.awk new file mode 100644 index 00000000..b0d06849 --- /dev/null +++ b/test/paramasfunc1.awk @@ -0,0 +1,9 @@ +BEGIN{ X() } + +function X( abc) +{ + abc = "stamp out " + print abc abc() +} + +function abc() { return "dark corners" } diff --git a/test/paramasfunc1.ok b/test/paramasfunc1.ok new file mode 100644 index 00000000..9ee95116 --- /dev/null +++ b/test/paramasfunc1.ok @@ -0,0 +1,3 @@ +gawk: paramasfunc1.awk:6: error: attempt to use non-function `abc' in function call +gawk: error: function `X': can't use function `abc' as a parameter name +EXIT CODE: 1 diff --git a/test/paramasfunc2.awk b/test/paramasfunc2.awk new file mode 100644 index 00000000..849b3d1b --- /dev/null +++ b/test/paramasfunc2.awk @@ -0,0 +1,10 @@ +BEGIN{ X() } + +function abc() { return "dark corners" } + +function X( abc) +{ + abc = "stamp out " + print abc abc() +} + diff --git a/test/paramasfunc2.ok b/test/paramasfunc2.ok new file mode 100644 index 00000000..2cdf4f66 --- /dev/null +++ b/test/paramasfunc2.ok @@ -0,0 +1,3 @@ +gawk: paramasfunc2.awk:8: error: attempt to use non-function `abc' in function call +gawk: error: function `X': can't use function `abc' as a parameter name +EXIT CODE: 1 diff --git a/test/profile0.awk b/test/profile0.awk new file mode 100644 index 00000000..a42e94df --- /dev/null +++ b/test/profile0.awk @@ -0,0 +1 @@ +NR == 1 diff --git a/test/profile0.in b/test/profile0.in new file mode 100644 index 00000000..7bba8c8e --- /dev/null +++ b/test/profile0.in @@ -0,0 +1,2 @@ +line 1 +line 2 diff --git a/test/profile0.ok b/test/profile0.ok new file mode 100644 index 00000000..2e3c5728 --- /dev/null +++ b/test/profile0.ok @@ -0,0 +1,6 @@ + # Rule(s) + + 2 NR == 1 { # 1 + 1 print $0 + } + diff --git a/test/range1.awk b/test/range1.awk index aca5db50..aca5db50 100755..100644 --- a/test/range1.awk +++ b/test/range1.awk diff --git a/test/sortglos.awk b/test/sortglos.awk index e4f910d7..e4f910d7 100755..100644 --- a/test/sortglos.awk +++ b/test/sortglos.awk diff --git a/test/sortglos.in b/test/sortglos.in index b24373de..b24373de 100755..100644 --- a/test/sortglos.in +++ b/test/sortglos.in |
