From 4b6c3509f6eb3a947606d220b3e33dd995a934c4 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Thu, 14 Sep 2017 08:18:09 -0400 Subject: Fix nonfatal1 test by ignoring the platform-specific portion of the error message. --- test/ChangeLog | 7 +++++++ test/Makefile.am | 5 +++++ test/Makefile.in | 10 +++++----- test/Maketests | 5 ----- test/nonfatal1.ok | 2 +- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/test/ChangeLog b/test/ChangeLog index 29b4181a..16708f48 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,10 @@ +2017-09-14 Andrew J. Schorr + + * Makefile.am (nonfatal1): New rule with postprocessing to remove + the platform-specific portion of the error message. + * nonfatal1.ok: Remove the platform-specific portion of the error + message. + 2017-09-12 Arnold D. Robbins * Makefile.am (readdir): Add to message that test can fail on diff --git a/test/Makefile.am b/test/Makefile.am index 7976fcda..1ef33b13 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -2424,6 +2424,11 @@ sourcesplit: @AWKPATH="$(srcdir)" $(AWK) --source='BEGIN { a = 5;' --source='print a }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +nonfatal1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk 2>&1 | $(AWK) '{print gensub(/invalid:.*$$/, "invalid", 1, $$0)}' >_$@ || 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 abb3b341..bf91f16b 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -2861,6 +2861,11 @@ sourcesplit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --source='BEGIN { a = 5;' --source='print a }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nonfatal1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk 2>&1 | $(AWK) '{print gensub(/invalid:.*$$/, "invalid", 1, $$0)}' >_$@ || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: @@ -4245,11 +4250,6 @@ 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: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index e6a2f300..8ae3f973 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1382,11 +1382,6 @@ 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: $$? >>_$@ diff --git a/test/nonfatal1.ok b/test/nonfatal1.ok index 4c9ab576..51583f2c 100644 --- a/test/nonfatal1.ok +++ b/test/nonfatal1.ok @@ -1,2 +1,2 @@ -gawk: nonfatal1.awk:4: warning: remote host and port information (local:host, 25) invalid: Name or service not known +gawk: nonfatal1.awk:4: warning: remote host and port information (local:host, 25) invalid 1 -- cgit v1.2.3