From 1316328fd5e4677a4096ee116ad411e6af10cc57 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 4 Aug 2020 09:12:13 +0300 Subject: Simplify test suite handling of -M and -mpfr.ok files. --- test/ChangeLog | 11 ++++++++++ test/Gentests | 33 ++++++++++++---------------- test/Makefile.am | 17 ++++++--------- test/Makefile.in | 65 ++++++++++++++++++++++++++------------------------------ test/Maketests | 48 ++++++++++++++++++++--------------------- 5 files changed, 85 insertions(+), 89 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 311614ed..a8b6e9a2 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,14 @@ +2020-08-04 Arnold D. Robbins + + Simplify handling of tests that have an -mpfr.ok file. + + * Gentests: Remove CHECK_MPFR handling. Instead, read the + EXTRA_DIST list of files and generate better checking tests + for tests that have an -mpfr.ok file. Use GAWK_TEST__ARGS + instead of AWKFLAGS. + * Makefile.am (CHECK_MPFR): Removed. + (arrdbg, testext): Checks updated. + 2020-07-20 Arnold D. Robbins * Makefile.am (EXPECTED_FAIL_ZOS): Add posix_compare to the list. diff --git a/test/Gentests b/test/Gentests index 392cbf2a..ada51819 100755 --- a/test/Gentests +++ b/test/Gentests @@ -22,6 +22,13 @@ BEGIN { # process the file Makefile.am: +/^EXTRA_DIST *=/,/[^\\]$/ { + gsub(/(^EXTRA_DIST *=|\\$)/,"") + for (i = 1; i <= NF; i++) + extra_dist[$i] + next +} + /^[[:upper:]_]*_TESTS *=/,/[^\\]$/ { gsub(/(^[[:upper:]_]*_TESTS *=|\\$)/,"") for (i = 1; i <= NF; i++) @@ -108,15 +115,6 @@ BEGIN { next } -/^CHECK_MPFR *=/,/[^\\]$/ { - gsub(/(^CHECK_MPFR *=|\\$)/,"") - for (i = 1; i <= NF; i++) - { - mpfr[$i] - } - next -} - # Tests needing a particular locale /^NEED_LOCALE_.* *=/,/[^\\]$/ { if (/^NEED/) @@ -255,16 +253,14 @@ function generate(x, s, i, locale_string) } } - if (x in mpfr) { - delete mpfr[x] - printf "%s", locale_string - printf "AWKPATH=\"$(srcdir)\" $(AWK) $(AWKFLAGS) -f $@.awk %s >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@\n", s - printf "\t@-if test -z \"$$AWKFLAGS\" ; then $(CMP) \"$(srcdir)\"/$@.ok _$@ && rm -f _$@ ; else \\\n" - printf "\t$(CMP) \"$(srcdir)\"/$@-mpfr.ok _$@ && rm -f _$@ ; \\\n" - printf "\tfi\n\n" + printf "%s", locale_string + printf "AWKPATH=\"$(srcdir)\" $(AWK) -f $@.awk %s >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@\n", s + + if ((x "-mpfr.ok") in extra_dist) { + printf "\t@-if echo \"$$GAWK_TEST_ARGS\" | egrep -q -e '-M|--bignum' > /dev/null ; \\\n" + printf "\tthen $(CMP) \"$(srcdir)\"/$@-mpfr.ok _$@ && rm -f _$@ ; \\\n" + printf "\telse $(CMP) \"$(srcdir)\"/$@.ok _$@ && rm -f _$@ ; fi\n\n" } else { - printf "%s", locale_string - printf "AWKPATH=\"$(srcdir)\" $(AWK) -f $@.awk %s >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@\n", s printf "\t@-$(CMP) \"$(srcdir)\"/$@.ok _$@ && rm -f _$@\n\n" } } @@ -297,7 +293,6 @@ END { for (x in nondec) if (!(x in targets)) printf "WARNING: --non-decimal-data target `%s' is missing.\n", x > "/dev/stderr" - for (x in re_interval) if (!(x in targets)) printf "WARNING: --re-interval target `%s' is missing.\n", x > "/dev/stderr" diff --git a/test/Makefile.am b/test/Makefile.am index 85342f05..e598dee9 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1507,10 +1507,6 @@ FAIL_CODE1 = \ 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 = \ - arraytype fnarydel fnparydl forcenum numrange rand - # Lists of tests that need particular locales NEED_LOCALE_C = \ clos1way gsubtst6 range2 @@ -2251,9 +2247,9 @@ testext:: @echo $@ @$(AWK) ' /^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk testexttmp.txt; else \ - $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; \ - fi + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum'; \ + then cmp "."/$@-mpfr.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; \ + else cmp "."/$@.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; fi getfile: @echo $@ @@ -2391,10 +2387,9 @@ ignrcas3:: arrdbg: @echo $@ @$(AWK) -v "okfile=./$@.ok" -v "mpfr_okfile=./$@-mpfr.ok" -f "$(srcdir)"/$@.awk | grep array_f >_$@ || echo EXIT CODE: $$? >> _$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) ./$@.ok _$@ && rm -f _$@ ./$@.ok ./$@-mpfr.ok ; else \ - $(CMP) ./$@-mpfr.ok _$@ && rm -f _$@ ./$@.ok ./$@-mpfr.ok ; \ - fi - + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum'; \ + then cmp "."/$@-mpfr.ok _$@ && rm -f _$@ $@.ok $@-mpfr.ok ; \ + else cmp "."/$@.ok _$@ && rm -f _$@ $@.ok $@-mpfr.ok ; fi sourcesplit: @echo $@ diff --git a/test/Makefile.in b/test/Makefile.in index b7abd5c8..324b3614 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1771,11 +1771,6 @@ FAIL_CODE1 = \ paramdup paramres parseme readbuf synerr1 synerr2 unterm -# List of files which have .ok versions for MPFR -CHECK_MPFR = \ - arraytype fnarydel fnparydl forcenum numrange rand - - # Lists of tests that need particular locales NEED_LOCALE_C = \ clos1way gsubtst6 range2 @@ -2704,9 +2699,9 @@ testext:: @echo $@ @$(AWK) ' /^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk @$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk testexttmp.txt; else \ - $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; \ - fi + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum'; \ + then cmp "."/$@-mpfr.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; \ + else cmp "."/$@.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; fi getfile: @echo $@ @@ -2842,9 +2837,9 @@ ignrcas3:: arrdbg: @echo $@ @$(AWK) -v "okfile=./$@.ok" -v "mpfr_okfile=./$@-mpfr.ok" -f "$(srcdir)"/$@.awk | grep array_f >_$@ || echo EXIT CODE: $$? >> _$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) ./$@.ok _$@ && rm -f _$@ ./$@.ok ./$@-mpfr.ok ; else \ - $(CMP) ./$@-mpfr.ok _$@ && rm -f _$@ ./$@.ok ./$@-mpfr.ok ; \ - fi + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum'; \ + then cmp "."/$@-mpfr.ok _$@ && rm -f _$@ $@.ok $@-mpfr.ok ; \ + else cmp "."/$@.ok _$@ && rm -f _$@ $@.ok $@-mpfr.ok ; fi sourcesplit: @echo $@ @@ -3575,10 +3570,10 @@ numindex: numrange: @echo $@ $(ZOS_FAIL) - @AWKPATH="$(srcdir)" $(AWK) $(AWKFLAGS) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; else \ - $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ - fi + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum' > /dev/null ; \ + then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ + else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi numstr1: @echo $@ @@ -3753,10 +3748,10 @@ prtoeval: rand: @echo $@ - @AWKPATH="$(srcdir)" $(AWK) $(AWKFLAGS) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; else \ - $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ - fi + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum' > /dev/null ; \ + then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ + else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi randtest: @echo $@ @@ -4210,10 +4205,10 @@ arraysort2: arraytype: @echo $@ - @AWKPATH="$(srcdir)" $(AWK) $(AWKFLAGS) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; else \ - $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ - fi + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum' > /dev/null ; \ + then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ + else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi backw: @echo $@ @@ -4298,10 +4293,10 @@ fieldwdth: forcenum: @echo $@ $(ZOS_FAIL) - @AWKPATH="$(srcdir)" $(AWK) $(AWKFLAGS) -f $@.awk --non-decimal-data >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; else \ - $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ - fi + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --non-decimal-data >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum' > /dev/null ; \ + then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ + else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi fpat1: @echo $@ @@ -5008,17 +5003,17 @@ fmttest: fnarydel: @echo $@ - @AWKPATH="$(srcdir)" $(AWK) $(AWKFLAGS) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; else \ - $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ - fi + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum' > /dev/null ; \ + then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ + else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi fnparydl: @echo $@ - @AWKPATH="$(srcdir)" $(AWK) $(AWKFLAGS) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; else \ - $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ - fi + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum' > /dev/null ; \ + then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ + else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi lc_num1: @echo $@ $(ZOS_FAIL) diff --git a/test/Maketests b/test/Maketests index 3433c651..ee2c8282 100644 --- a/test/Maketests +++ b/test/Maketests @@ -680,10 +680,10 @@ numindex: numrange: @echo $@ $(ZOS_FAIL) - @AWKPATH="$(srcdir)" $(AWK) $(AWKFLAGS) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; else \ - $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ - fi + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum' > /dev/null ; \ + then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ + else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi numstr1: @echo $@ @@ -858,10 +858,10 @@ prtoeval: rand: @echo $@ - @AWKPATH="$(srcdir)" $(AWK) $(AWKFLAGS) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; else \ - $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ - fi + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum' > /dev/null ; \ + then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ + else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi randtest: @echo $@ @@ -1315,10 +1315,10 @@ arraysort2: arraytype: @echo $@ - @AWKPATH="$(srcdir)" $(AWK) $(AWKFLAGS) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; else \ - $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ - fi + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum' > /dev/null ; \ + then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ + else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi backw: @echo $@ @@ -1403,10 +1403,10 @@ fieldwdth: forcenum: @echo $@ $(ZOS_FAIL) - @AWKPATH="$(srcdir)" $(AWK) $(AWKFLAGS) -f $@.awk --non-decimal-data >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; else \ - $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ - fi + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk --non-decimal-data >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum' > /dev/null ; \ + then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ + else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi fpat1: @echo $@ @@ -2113,17 +2113,17 @@ fmttest: fnarydel: @echo $@ - @AWKPATH="$(srcdir)" $(AWK) $(AWKFLAGS) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; else \ - $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ - fi + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum' > /dev/null ; \ + then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ + else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi fnparydl: @echo $@ - @AWKPATH="$(srcdir)" $(AWK) $(AWKFLAGS) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-if test -z "$$AWKFLAGS" ; then $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; else \ - $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ - fi + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum' > /dev/null ; \ + then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ + else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; fi lc_num1: @echo $@ $(ZOS_FAIL) -- cgit v1.2.3 From d389d4cd9e2d75159f69a23bfa6d038f74502b12 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 12 Aug 2020 18:15:18 +0300 Subject: Fix issues with function ordering in pretty printed output. Add doc. --- test/ChangeLog | 4 ++++ test/nsprof1.ok | 2 ++ test/nsprof2.ok | 3 +++ 3 files changed, 9 insertions(+) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index a8b6e9a2..73f77217 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2020-08-12 Arnold D. Robbins + + * nsprof1.ok, nsprof2.ok: Updated after code changes. + 2020-08-04 Arnold D. Robbins Simplify handling of tests that have an -mpfr.ok file. diff --git a/test/nsprof1.ok b/test/nsprof1.ok index eacc2707..cbd82cc5 100644 --- a/test/nsprof1.ok +++ b/test/nsprof1.ok @@ -1,3 +1,4 @@ + @namespace "foo" BEGIN { @@ -10,6 +11,7 @@ BEGIN { print "bar" } + @namespace "stuff" diff --git a/test/nsprof2.ok b/test/nsprof2.ok index 5c3e27ab..1fa220d7 100644 --- a/test/nsprof2.ok +++ b/test/nsprof2.ok @@ -5,10 +5,13 @@ # Revised October 2000 # Revised December 2010 # Revised July 2017 + @namespace "foo" # this is foo + @namespace "bar" # this is bar + @namespace "passwd" # move to passwd namespace BEGIN { -- cgit v1.2.3