diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 28 | ||||
-rw-r--r-- | test/Makefile.am | 27 | ||||
-rw-r--r-- | test/Makefile.in | 37 | ||||
-rw-r--r-- | test/Maketests | 10 | ||||
-rw-r--r-- | test/hex2.awk | 1 | ||||
-rw-r--r-- | test/hex2.in | 2 | ||||
-rw-r--r-- | test/hex2.ok | 2 | ||||
-rw-r--r-- | test/mixed1.ok | 4 | ||||
-rw-r--r-- | test/subback.awk | 16 | ||||
-rw-r--r-- | test/subback.in | 1 | ||||
-rw-r--r-- | test/subback.ok | 12 | ||||
-rw-r--r-- | test/symtab10.awk | 1 | ||||
-rw-r--r-- | test/symtab10.in | 4 | ||||
-rw-r--r-- | test/symtab10.ok | 11 |
14 files changed, 144 insertions, 12 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 2a8fb86c..e667de55 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,20 @@ +2016-06-14 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (subback): New test. + * subback.awk, subback.in, subback.ok: New files. + Thanks to Mike Brennan for the test. + + Unrelated: + + * Makefile.am (FAIL_CODE1): Update the list. + +2016-06-14 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (GAWK_EXT_TESTS): Add mixed1. Who knows + how long that's been broken... + * mixed1.ok: Adjust to match what the code produces. + Thanks to John E. Malmberg <wb8tyw@qsl.net> for the report. + 2016-06-13 Andrew J. Schorr <aschorr@telemetry-investments.com> * Makefile.am (forcenum, ignrcas3, intarray, lintexp, lintindex, @@ -10,6 +27,17 @@ mpgforcenum.ok, printfchar.awk, printfchar.ok, strtonum1.awk, strtonum1.ok: New files. +2016-06-08 Arnold D. Robbins <arnold@skeeve.com> + + * symtab10.awk, symtab10.in, symtab10.ok: New files. + * Makefile.am (symtab10): New test. + Thanks to Hermann Peifer for the report. + +2016-06-01 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (hex2): New test. + * hex2.awk, hex2.in, hex2.ok: New files. + 2016-05-30 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (fsnul1): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 050a1dd3..6c893cce 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -442,6 +442,9 @@ EXTRA_DIST = \ hello.awk \ hex.awk \ hex.ok \ + hex2.awk \ + hex2.in \ + hex2.ok \ hsprint.awk \ hsprint.ok \ icasefs.awk \ @@ -1006,6 +1009,9 @@ EXTRA_DIST = \ subamp.awk \ subamp.in \ subamp.ok \ + subback.awk \ + subback.in \ + subback.ok \ subi18n.awk \ subi18n.ok \ subsepnm.awk \ @@ -1041,6 +1047,9 @@ EXTRA_DIST = \ symtab8.ok \ symtab9.awk \ symtab9.ok \ + symtab10.awk \ + symtab10.in \ + symtab10.ok \ synerr1.awk \ synerr1.ok \ synerr2.awk \ @@ -1138,7 +1147,7 @@ BASIC_TESTS = \ getline getline2 getline3 getline4 getline5 getlnbuf getnr2tb getnr2tm \ gsubasgn gsubtest gsubtst2 gsubtst3 gsubtst4 gsubtst5 gsubtst6 \ gsubtst7 gsubtst8 \ - hex hsprint \ + hex hex2 hsprint \ inpref inputred intest intprec iobug1 \ leaddig leadnl litoct longsub longwrds \ manglprm math membug1 messages minusstr mmap8k mtchi18n \ @@ -1156,7 +1165,7 @@ BASIC_TESTS = \ reparse resplit rri1 rs rscompat rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin sigpipe1 sortempty sortglos splitargv splitarr splitdef \ - splitvar splitwht strcat1 strnum1 strtod subamp subi18n \ + splitvar splitwht strcat1 strnum1 strtod subamp subback subi18n \ subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \ uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \ wideidx wideidx2 widesub widesub2 widesub3 widesub4 wjposer1 \ @@ -1179,7 +1188,7 @@ GAWK_EXT_TESTS = \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ include include2 indirectbuiltin indirectcall indirectcall2 intarray \ lint lintexp lintindex lintint lintlength lintold lintset lintwarn \ - manyfiles match1 match2 match3 mbstr1 mbstr2 \ + mixed1 manyfiles match1 match2 match3 mbstr1 mbstr2 \ muldimposix \ nastyparm negtime next nondec nondec2 \ nonfatal1 nonfatal2 nonfatal3 \ @@ -1191,7 +1200,7 @@ GAWK_EXT_TESTS = \ sortfor sortu split_after_fpat \ splitarg4 strftime \ strtonum strtonum1 switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ - symtab7 symtab8 symtab9 \ + symtab7 symtab8 symtab9 symtab10 \ typedregex1 typedregex2 typedregex3 typeof1 typeof2 typeof3 typeof4 \ timeout \ watchpoint1 @@ -1224,7 +1233,10 @@ NEED_LINT_OLD = lintold # List of the tests which fail with EXIT CODE 1 FAIL_CODE1 = \ - fnarray2 fnmisc gsubasgn mixed1 noparms paramdup synerr1 synerr2 unterm + badassign1 badbuild callparam delfunc fcall_exit fcall_exit2 \ + fnamedat fnarray fnarray2 fnasgnm fnmisc funsmnam gsubasgn \ + incdupe2 lintwarn match2 mixed1 noparms paramasfunc1 paramasfunc2 \ + paramdup paramres parseme readbuf synerr1 synerr2 unterm # List of files which have .ok versions for MPFR CHECK_MPFR = \ @@ -2294,6 +2306,11 @@ rscompat: @AWKPATH="$(srcdir)" $(AWK) --traditional -f $@.awk "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +symtab10: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -D -f $@.awk < "$(srcdir)/$@.in" >_$@ 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 3fe7c9ee..11176f1f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -699,6 +699,9 @@ EXTRA_DIST = \ hello.awk \ hex.awk \ hex.ok \ + hex2.awk \ + hex2.in \ + hex2.ok \ hsprint.awk \ hsprint.ok \ icasefs.awk \ @@ -1263,6 +1266,9 @@ EXTRA_DIST = \ subamp.awk \ subamp.in \ subamp.ok \ + subback.awk \ + subback.in \ + subback.ok \ subi18n.awk \ subi18n.ok \ subsepnm.awk \ @@ -1298,6 +1304,9 @@ EXTRA_DIST = \ symtab8.ok \ symtab9.awk \ symtab9.ok \ + symtab10.awk \ + symtab10.in \ + symtab10.ok \ synerr1.awk \ synerr1.ok \ synerr2.awk \ @@ -1394,7 +1403,7 @@ BASIC_TESTS = \ getline getline2 getline3 getline4 getline5 getlnbuf getnr2tb getnr2tm \ gsubasgn gsubtest gsubtst2 gsubtst3 gsubtst4 gsubtst5 gsubtst6 \ gsubtst7 gsubtst8 \ - hex hsprint \ + hex hex2 hsprint \ inpref inputred intest intprec iobug1 \ leaddig leadnl litoct longsub longwrds \ manglprm math membug1 messages minusstr mmap8k mtchi18n \ @@ -1412,7 +1421,7 @@ BASIC_TESTS = \ reparse resplit rri1 rs rscompat rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin sigpipe1 sortempty sortglos splitargv splitarr splitdef \ - splitvar splitwht strcat1 strnum1 strtod subamp subi18n \ + splitvar splitwht strcat1 strnum1 strtod subamp subback subi18n \ subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \ uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \ wideidx wideidx2 widesub widesub2 widesub3 widesub4 wjposer1 \ @@ -1435,7 +1444,7 @@ GAWK_EXT_TESTS = \ incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \ include include2 indirectbuiltin indirectcall indirectcall2 intarray \ lint lintexp lintindex lintint lintlength lintold lintset lintwarn \ - manyfiles match1 match2 match3 mbstr1 mbstr2 \ + mixed1 manyfiles match1 match2 match3 mbstr1 mbstr2 \ muldimposix \ nastyparm negtime next nondec nondec2 \ nonfatal1 nonfatal2 nonfatal3 \ @@ -1447,7 +1456,7 @@ GAWK_EXT_TESTS = \ sortfor sortu split_after_fpat \ splitarg4 strftime \ strtonum strtonum1 switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ - symtab7 symtab8 symtab9 \ + symtab7 symtab8 symtab9 symtab10 \ typedregex1 typedregex2 typedregex3 typeof1 typeof2 typeof3 typeof4 \ timeout \ watchpoint1 @@ -1479,7 +1488,10 @@ NEED_LINT_OLD = lintold # List of the tests which fail with EXIT CODE 1 FAIL_CODE1 = \ - fnarray2 fnmisc gsubasgn mixed1 noparms paramdup synerr1 synerr2 unterm + badassign1 badbuild callparam delfunc fcall_exit fcall_exit2 \ + fnamedat fnarray fnarray2 fnasgnm fnmisc funsmnam gsubasgn \ + incdupe2 lintwarn match2 mixed1 noparms paramasfunc1 paramasfunc2 \ + paramdup paramres parseme readbuf synerr1 synerr2 unterm # List of files which have .ok versions for MPFR @@ -2731,6 +2743,11 @@ rscompat: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --traditional -f $@.awk "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +symtab10: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -D -f $@.awk < "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: @@ -3153,6 +3170,11 @@ hex: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +hex2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + hsprint: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -3630,6 +3652,11 @@ strtod: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +subback: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + subsepnm: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 641ee5a7..4ee6f384 100644 --- a/test/Maketests +++ b/test/Maketests @@ -420,6 +420,11 @@ hex: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +hex2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + hsprint: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -897,6 +902,11 @@ strtod: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +subback: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + subsepnm: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/hex2.awk b/test/hex2.awk new file mode 100644 index 00000000..49c6203d --- /dev/null +++ b/test/hex2.awk @@ -0,0 +1 @@ +{ print $1 + 7} diff --git a/test/hex2.in b/test/hex2.in new file mode 100644 index 00000000..60f06f0f --- /dev/null +++ b/test/hex2.in @@ -0,0 +1,2 @@ +0x4 +-0x4 diff --git a/test/hex2.ok b/test/hex2.ok new file mode 100644 index 00000000..49019db8 --- /dev/null +++ b/test/hex2.ok @@ -0,0 +1,2 @@ +7 +7 diff --git a/test/mixed1.ok b/test/mixed1.ok index 91608fa3..bd6f447d 100644 --- a/test/mixed1.ok +++ b/test/mixed1.ok @@ -1,3 +1,3 @@ -gawk: BEGIN {return junk} -gawk: ^ `return' used outside function context +gawk: cmd. line:1: BEGIN {return junk} +gawk: cmd. line:1: ^ `return' used outside function context EXIT CODE: 1 diff --git a/test/subback.awk b/test/subback.awk new file mode 100644 index 00000000..d91513c1 --- /dev/null +++ b/test/subback.awk @@ -0,0 +1,16 @@ +BEGIN { + A[0] = "&" + for(i=1;i<=11;i++) { + A[i] = "\\" A[i-1] + } +## A[] holds & \& \\& \\\& \\\\& ... +} + +{ + for(i=0; i <= 11 ; i++) { + x = $0 + sub(/B/, A[i], x) + y = gensub(/B/, A[i], "1", $0) + print i, x, y + } +} diff --git a/test/subback.in b/test/subback.in new file mode 100644 index 00000000..223b7836 --- /dev/null +++ b/test/subback.in @@ -0,0 +1 @@ +B diff --git a/test/subback.ok b/test/subback.ok new file mode 100644 index 00000000..9792c82b --- /dev/null +++ b/test/subback.ok @@ -0,0 +1,12 @@ +0 B B +1 & & +2 \B \B +3 \& \& +4 \\B \\B +5 \\& \\& +6 \\\B \\\B +7 \\\& \\\& +8 \\\\B \\\\B +9 \\\\& \\\\& +10 \\\\\B \\\\\B +11 \\\\\& \\\\\& diff --git a/test/symtab10.awk b/test/symtab10.awk new file mode 100644 index 00000000..6fbd3994 --- /dev/null +++ b/test/symtab10.awk @@ -0,0 +1 @@ +BEGIN { SYMTAB["x"] ; y=1 ; y++ } diff --git a/test/symtab10.in b/test/symtab10.in new file mode 100644 index 00000000..d9afcd66 --- /dev/null +++ b/test/symtab10.in @@ -0,0 +1,4 @@ +watch y +run +watch x +continue diff --git a/test/symtab10.ok b/test/symtab10.ok new file mode 100644 index 00000000..b0cabd7c --- /dev/null +++ b/test/symtab10.ok @@ -0,0 +1,11 @@ +Watchpoint 1: y +Starting program: +Stopping in BEGIN ... +Watchpoint 1: y + Old value: untyped variable + New value: 1 +main() at `symtab10.awk':1 +1 BEGIN { SYMTAB["x"] ; y=1 ; y++ } +no symbol `x' in current context +Program exited normally with exit value: 0 +EXIT CODE: 2 |