diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-12-24 20:28:14 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-12-24 20:28:14 +0200 |
commit | 969ee3cbf2255a508eca008c0b25d8a1f09bdeb3 (patch) | |
tree | 0b84e4b61613a2f07bc11b243120d2e57a66bd84 /test | |
parent | 0585c4e6f3d68846d56fe766675099b539e2cba9 (diff) | |
download | egawk-969ee3cbf2255a508eca008c0b25d8a1f09bdeb3.tar.gz egawk-969ee3cbf2255a508eca008c0b25d8a1f09bdeb3.tar.bz2 egawk-969ee3cbf2255a508eca008c0b25d8a1f09bdeb3.zip |
New test for bad builds (with non-bison).
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 9 | ||||
-rw-r--r-- | test/Makefile.am | 5 | ||||
-rw-r--r-- | test/Makefile.in | 10 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/badbuild.awk | 6 | ||||
-rw-r--r-- | test/badbuild.in | 1 | ||||
-rw-r--r-- | test/badbuild.ok | 3 |
7 files changed, 35 insertions, 4 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 10fc9490..e51148d8 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,8 +1,13 @@ 2014-12-24 Andrew J. Schorr <aschorr@telemetry-investments.com> * Makefile.am (check): If tests don't pass, run 'make diffout' - and exit 1. Should help distros that notice when they - have built gawk incorrectly. (Can you say "Fedora", boys and girls?) + and exit 1. Should help distros to notice when they have built + gawk incorrectly. (Can you say "Fedora", boys and girls?) + + Not quite unrelated: + + * Makefile.am (badbuild): New test. + * badbuild.awk, badbuild.in, badbuild.ok: New files. 2014-11-26 Arnold D. Robbins <arnold@skeeve.com> diff --git a/test/Makefile.am b/test/Makefile.am index b9a404ed..b93f851f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -123,6 +123,9 @@ EXTRA_DIST = \ badargs.ok \ badassign1.awk \ badassign1.ok \ + badbuild.awk \ + badbuild.in \ + badbuild.ok \ beginfile1.awk \ beginfile1.ok \ beginfile2.in \ @@ -974,7 +977,7 @@ BASIC_TESTS = \ arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 arysubnm asgext awkpath \ - back89 backgsub badassign1 \ + back89 backgsub badassign1 badbuild \ childin clobber closebad clsflnam compare compare2 concat1 concat2 \ concat3 concat4 convfmt \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ diff --git a/test/Makefile.in b/test/Makefile.in index f342de9d..7a281eca 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -370,6 +370,9 @@ EXTRA_DIST = \ badargs.ok \ badassign1.awk \ badassign1.ok \ + badbuild.awk \ + badbuild.in \ + badbuild.ok \ beginfile1.awk \ beginfile1.ok \ beginfile2.in \ @@ -1220,7 +1223,7 @@ BASIC_TESTS = \ arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 arysubnm asgext awkpath \ - back89 backgsub badassign1 \ + back89 backgsub badassign1 badbuild \ childin clobber closebad clsflnam compare compare2 concat1 concat2 \ concat3 concat4 convfmt \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ @@ -2547,6 +2550,11 @@ badassign1: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +badbuild: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + childin: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 85c13d5d..e1b92bf9 100644 --- a/test/Maketests +++ b/test/Maketests @@ -125,6 +125,11 @@ badassign1: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +badbuild: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + childin: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/badbuild.awk b/test/badbuild.awk new file mode 100644 index 00000000..12a6caeb --- /dev/null +++ b/test/badbuild.awk @@ -0,0 +1,6 @@ +$1 == $2 == $3 { + print "Gawk was built incorrectly." + print "Use bison, not byacc or something else!" + print "(Really, why aren't you using the awkgram.c in the distribution?)" + exit 42 +} diff --git a/test/badbuild.in b/test/badbuild.in new file mode 100644 index 00000000..560711d4 --- /dev/null +++ b/test/badbuild.in @@ -0,0 +1 @@ +a a 1 diff --git a/test/badbuild.ok b/test/badbuild.ok new file mode 100644 index 00000000..6d60f5a9 --- /dev/null +++ b/test/badbuild.ok @@ -0,0 +1,3 @@ +gawk: badbuild.awk:1: $1 == $2 == $3 { +gawk: badbuild.awk:1: ^ syntax error +EXIT CODE: 1 |