diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 30 | ||||
-rw-r--r-- | test/Makefile.am | 23 | ||||
-rw-r--r-- | test/Makefile.in | 33 | ||||
-rw-r--r-- | test/Maketests | 10 | ||||
-rw-r--r-- | test/id.ok | 1 | ||||
-rw-r--r-- | test/printfbad4.awk | 5 | ||||
-rw-r--r-- | test/printfbad4.ok | 2 | ||||
-rw-r--r-- | test/profile8.awk | 9 | ||||
-rw-r--r-- | test/profile8.ok | 14 | ||||
-rw-r--r-- | test/regexpbrack.awk | 2 | ||||
-rw-r--r-- | test/regexpbrack.in | 0 | ||||
-rw-r--r-- | test/regexpbrack.ok | 0 | ||||
-rw-r--r-- | test/testext.ok | 2 |
13 files changed, 120 insertions, 11 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 7522f7aa..c859a7bb 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,33 @@ +2015-01-19 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (profile8): Actually add the test and the files. + Thanks to Hermann Peifer for the report. + +2015-01-16 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (profile8): New test. + * profile8.awk, profile8.ok: New files. + +2015-01-14 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (dumpvars): Grep out ENVIRON and PROCINFO since + those can be different depending on who runs the test. + * dumpvars.ok, id.ok: Updated after code changes. + +2015-01-07 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (regexpbrack): New test. + * regexpbrack.awk, regexpbrack.in, regexpbrack.ok: New files. + + Unrelated: + + * Makefile.am (printfbad4): New test. + * printfbad4.awk, printfbad4.ok: New files. + + Unrelated: + + * testext.ok: Adjust for code changes. + 2015-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com> * Makefile.am (EXTRA_DIST): Add defvar.awk and defvar.ok. diff --git a/test/Makefile.am b/test/Makefile.am index 3d95f4cc..438efd93 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,7 +1,7 @@ # # test/Makefile.am --- automake input file for gawk # -# Copyright (C) 1988-2014 the Free Software Foundation, Inc. +# Copyright (C) 1988-2015 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -699,6 +699,8 @@ EXTRA_DIST = \ printfbad2.ok \ printfbad3.awk \ printfbad3.ok \ + printfbad4.awk \ + printfbad4.ok \ printfloat.awk \ printhuge.awk \ printhuge.ok \ @@ -720,6 +722,8 @@ EXTRA_DIST = \ profile6.ok \ profile7.awk \ profile7.ok \ + profile8.awk \ + profile8.ok \ prt1eval.awk \ prt1eval.ok \ prtoeval.awk \ @@ -751,6 +755,9 @@ EXTRA_DIST = \ regeq.awk \ regeq.in \ regeq.ok \ + regexpbrack.awk \ + regexpbrack.in \ + regexpbrack.ok \ regexprange.awk \ regexprange.ok \ reginttrad.awk \ @@ -1010,7 +1017,7 @@ BASIC_TESTS = \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \ prt1eval prtoeval \ - rand randtest range1 rebt8b1 redfilnm regeq regexprange regrange reindops \ + rand randtest range1 rebt8b1 redfilnm regeq regexpbrack regexprange regrange reindops \ reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \ @@ -1037,8 +1044,9 @@ GAWK_EXT_TESTS = \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ - patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ + patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ + 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 \ splitarg4 strftime \ @@ -1691,7 +1699,7 @@ beginfile2: dumpvars:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --dump-variables 1 < "$(srcdir)"/$@.in >/dev/null 2>&1 || echo EXIT CODE: $$? >>_$@ - @mv awkvars.out _$@ + @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ profile1: @@ -1737,6 +1745,11 @@ profile7: @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile8: + @echo $@ + @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + posix2008sub: @echo $@ @$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1 diff --git a/test/Makefile.in b/test/Makefile.in index d2492d32..e6abf971 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -17,7 +17,7 @@ # # test/Makefile.am --- automake input file for gawk # -# Copyright (C) 1988-2014 the Free Software Foundation, Inc. +# Copyright (C) 1988-2015 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -946,6 +946,8 @@ EXTRA_DIST = \ printfbad2.ok \ printfbad3.awk \ printfbad3.ok \ + printfbad4.awk \ + printfbad4.ok \ printfloat.awk \ printhuge.awk \ printhuge.ok \ @@ -967,6 +969,8 @@ EXTRA_DIST = \ profile6.ok \ profile7.awk \ profile7.ok \ + profile8.awk \ + profile8.ok \ prt1eval.awk \ prt1eval.ok \ prtoeval.awk \ @@ -998,6 +1002,9 @@ EXTRA_DIST = \ regeq.awk \ regeq.in \ regeq.ok \ + regexpbrack.awk \ + regexpbrack.in \ + regexpbrack.ok \ regexprange.awk \ regexprange.ok \ reginttrad.awk \ @@ -1256,7 +1263,7 @@ BASIC_TESTS = \ paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \ pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \ prt1eval prtoeval \ - rand randtest range1 rebt8b1 redfilnm regeq regexprange regrange reindops \ + rand randtest range1 rebt8b1 redfilnm regeq regexpbrack regexprange regrange reindops \ reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \ @@ -1283,8 +1290,9 @@ GAWK_EXT_TESTS = \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ - patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \ - profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ + patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \ + 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 \ splitarg4 strftime \ @@ -2117,7 +2125,7 @@ beginfile2: dumpvars:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --dump-variables 1 < "$(srcdir)"/$@.in >/dev/null 2>&1 || echo EXIT CODE: $$? >>_$@ - @mv awkvars.out _$@ + @grep -v ENVIRON < awkvars.out | grep -v PROCINFO > _$@; rm awkvars.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ profile1: @@ -2162,6 +2170,11 @@ profile7: @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +profile8: + @echo $@ + @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + posix2008sub: @echo $@ @$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1 @@ -3153,6 +3166,11 @@ regeq: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +regexpbrack: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + regexprange: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -3613,6 +3631,11 @@ printfbad3: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +printfbad4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + procinfs: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 97f2ed52..be10addd 100644 --- a/test/Maketests +++ b/test/Maketests @@ -697,6 +697,11 @@ regeq: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +regexpbrack: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + regexprange: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1157,6 +1162,11 @@ printfbad3: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +printfbad4: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + procinfs: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -71,3 +71,4 @@ lshift -> builtin SYMTAB -> array strtonum -> builtin toupper -> builtin +ENVIRON -> array diff --git a/test/printfbad4.awk b/test/printfbad4.awk new file mode 100644 index 00000000..dd9220ae --- /dev/null +++ b/test/printfbad4.awk @@ -0,0 +1,5 @@ +BEGIN { + for (i = 1; i <= 10; i++) { + printf "%03$*d %2$d \n", 4, 5, i + } +} diff --git a/test/printfbad4.ok b/test/printfbad4.ok new file mode 100644 index 00000000..71eed3d6 --- /dev/null +++ b/test/printfbad4.ok @@ -0,0 +1,2 @@ +gawk: printfbad4.awk:3: fatal: fatal: must use `count$' on all formats or none +EXIT CODE: 2 diff --git a/test/profile8.awk b/test/profile8.awk new file mode 100644 index 00000000..16252cea --- /dev/null +++ b/test/profile8.awk @@ -0,0 +1,9 @@ +# Some +# header +# comments + +# Add up +{ sum += $1 } + +# Print sum +END { print sum } diff --git a/test/profile8.ok b/test/profile8.ok new file mode 100644 index 00000000..34f7a96b --- /dev/null +++ b/test/profile8.ok @@ -0,0 +1,14 @@ +# Some +# header +# comments + +# Add up +{ + sum += $1 +} + +# Print sum +END { + print sum +} + diff --git a/test/regexpbrack.awk b/test/regexpbrack.awk new file mode 100644 index 00000000..136cd194 --- /dev/null +++ b/test/regexpbrack.awk @@ -0,0 +1,2 @@ +/[]+()0-9.,$%/'"-]*$/ +/^[]+()0-9.,$%/'"-]*$/ diff --git a/test/regexpbrack.in b/test/regexpbrack.in new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/regexpbrack.in diff --git a/test/regexpbrack.ok b/test/regexpbrack.ok new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/regexpbrack.ok diff --git a/test/testext.ok b/test/testext.ok index 5a78c159..9dae010f 100644 --- a/test/testext.ok +++ b/test/testext.ok @@ -15,7 +15,7 @@ try_modify_environ: set_array_element of ENVIRON failed try_modify_environ: marking element "testext" for deletion try_del_environ() could not delete element - pass try_del_environ() could not add an element - pass -var_test: sym_lookup of PROCINFO passed - did not get a value +var_test: sym_lookup of PROCINFO passed - got a value! var_test: sym_lookup of ARGC passed - got a value! var_test: sym_update of ARGC failed - correctly var_test: sym_update("testvar") succeeded |