diff options
Diffstat (limited to 'test/Makefile.am')
-rw-r--r-- | test/Makefile.am | 108 |
1 files changed, 97 insertions, 11 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 24255b7e..457fd163 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -201,6 +201,8 @@ EXTRA_DIST = \ fieldwdth.awk \ fieldwdth.in \ fieldwdth.ok \ + filefuncs.awk \ + filefuncs.ok \ fldchg.awk \ fldchg.in \ fldchg.ok \ @@ -209,6 +211,7 @@ EXTRA_DIST = \ fldchgnf.ok \ fmtspcl.awk \ fmtspcl.tok \ + fmtspcl-mpfr.ok \ fmttest.awk \ fmttest.ok \ fnamedat.awk \ @@ -217,9 +220,11 @@ EXTRA_DIST = \ fnarray.awk \ fnarray.ok \ fnarray2.awk \ + fnarray2.in \ fnarray2.ok \ fnarydel.awk \ fnarydel.ok \ + fnarydel-mpfr.ok \ fnaryscl.awk \ fnaryscl.ok \ fnasgnm.awk \ @@ -229,6 +234,11 @@ EXTRA_DIST = \ fnmisc.ok \ fnparydl.awk \ fnparydl.ok \ + fnparydl-mpfr.ok \ + fork.awk \ + fork.ok \ + fork2.awk \ + fork2.ok \ fpat1.awk \ fpat1.in \ fpat1.ok \ @@ -524,6 +534,9 @@ EXTRA_DIST = \ opasnidx.ok \ opasnslf.awk \ opasnslf.ok \ + ordchr.awk \ + ordchr.ok \ + ordchr2.ok \ out1.ok \ out2.ok \ out3.ok \ @@ -594,6 +607,7 @@ EXTRA_DIST = \ pty1.ok \ rand.awk \ rand.ok \ + rand-mpfr.ok \ range1.awk \ range1.in \ range1.ok \ @@ -852,10 +866,14 @@ INET_TESTS = inetdayu inetdayt inetechu inetecht MACHINE_TESTS = double1 double2 fmtspcl intformat +MPFR_TESTS = mpfrnr mpfrrnd mpfrieee mpfrexprange mpfrsort mpfrbigint + LOCALE_CHARSET_TESTS = \ asort asorti fmttest fnarydel fnparydl jarebug lc_num1 mbfw1 \ mbprintf1 mbprintf2 mbprintf3 rebt8b2 rtlenmb sort1 sprintfc +SHLIB_TESTS = ordchr ordchr2 fork fork2 readfile filefuncs + # List of the tests which should be run with --lint option: NEED_LINT = \ defref fmtspcl lintwarn noeffect nofmtch shadow \ @@ -868,20 +886,29 @@ NEED_LINT_OLD = lintold FAIL_CODE1 = \ fnarray2 fnmisc gsubasgn mixed1 noparms paramdup synerr1 synerr2 unterm +# List of files which have .ok versions for MPFR +CHECK_MPFR = \ + rand fnarydel fnparydl + # List of the files that appear in manual tests or are for reserve testing: GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk CMP = cmp AWKPROG = ../gawk$(EXEEXT) -PGAWKPROG = ../pgawk$(EXEEXT) + +# Default for VALGRIND is empty unless overridden by a command-line argument. +# This protects against cruft in the environment. +VALGRIND = # This business forces the locale to be C for running the tests, # unless we override it to something else for testing. # # This can also be done in individual tests where we wish to # check things specifically not in the C locale. -AWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} $(AWKPROG) -PGAWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} $(PGAWKPROG) + +# +# And we set AWKLIBPATH to find the extension libraries we built. +AWK = LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} AWKLIBPATH=../extension/.libs $(VALGRIND) $(AWKPROG) # Message stuff is to make it a little easier to follow. # Make the pass-fail last and dependent on others to avoid @@ -892,7 +919,8 @@ check: msg \ unix-msg-start unix-tests unix-msg-end \ extend-msg-start gawk-extensions extend-msg-end \ machine-msg-start machine-tests machine-msg-end \ - charset-msg-start charset-tests charset-msg-end + charset-msg-start charset-tests charset-msg-end \ + shlib-msg-start shlib-tests shlib-msg-end @$(MAKE) pass-fail basic: $(BASIC_TESTS) @@ -909,6 +937,10 @@ inet: inetmesg $(INET_TESTS) machine-tests: $(MACHINE_TESTS) +mpfr-tests: $(MPFR_TESTS) + +shlib-tests: $(SHLIB_TESTS) + msg:: @echo '' @echo 'Any output from "cmp" is bad news, although some differences' @@ -949,6 +981,12 @@ charset-msg-start: charset-msg-end: @echo "======== Done with tests that can vary based on character set or locale support ========" +shlib-msg-start: + @echo "======== Starting shared library tests ========" + +shlib-msg-end: + @echo "======== Done with shared library tests ========" + lc_num1: @echo $@ @@ -1109,9 +1147,11 @@ fmtspcl.ok: fmtspcl.tok Makefile @$(AWK) -v "sd=$(srcdir)" 'BEGIN {pnan = sprintf("%g",sqrt(-1)); nnan = sprintf("%g",-sqrt(-1)); pinf = sprintf("%g",-log(0)); ninf = sprintf("%g",log(0))} {sub(/positive_nan/,pnan); sub(/negative_nan/,nnan); sub(/positive_infinity/,pinf); sub(/negative_infinity/,ninf); sub(/fmtspcl/,(sd"/fmtspcl")); print}' < $(srcdir)/fmtspcl.tok > $@ 2>/dev/null fmtspcl: fmtspcl.ok - @echo fmtspcl + @echo $@ @$(AWK) -f $(srcdir)/fmtspcl.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) $@.ok _$@ && rm -f _$@ + @-if test -z "$$AWKFLAGS" ; then $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ ; else \ + $(CMP) $(srcdir)/$@-mpfr.ok _$@ && rm -f _$@ ; \ + fi reint:: @echo $@ @@ -1417,19 +1457,19 @@ dumpvars:: profile1: @echo $@ - @$(AWK) --profile=ap-$@.out -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > _$@.out1 + @$(AWK) --pretty-print=ap-$@.out -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > _$@.out1 @$(AWK) -f ap-$@.out $(srcdir)/dtdgport.awk > _$@.out2 ; rm ap-$@.out @cmp _$@.out1 _$@.out2 && rm _$@.out[12] || echo EXIT CODE: $$? >>_$@ profile2: @echo $@ - @$(PGAWK) --profile=ap-$@.out -v sortcmd=sort -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null + @$(AWK) --profile=ap-$@.out -v sortcmd=sort -f $(srcdir)/xref.awk $(srcdir)/dtdgport.awk > /dev/null @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ profile3: @echo $@ - @$(PGAWK) --profile=ap-$@.out -f $(srcdir)/$@.awk > /dev/null + @$(AWK) --profile=ap-$@.out -f $(srcdir)/$@.awk > /dev/null @sed 1,2d < ap-$@.out > _$@; rm ap-$@.out @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ @@ -1454,6 +1494,43 @@ rri1:: AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +rand: + @echo $@ + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-if test -z "$$AWKFLAGS" ; then $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ ; else \ + ($(CMP) $(srcdir)/$@-mpfr.ok _$@ || $(CMP) $(srcdir)/$@-mpfr1.ok _$@) && rm -f _$@ ; \ + fi + +mpfrieee: + @echo $@ + @$(AWK) -M -vPREC=double -f $(srcdir)/$@.awk > _$@ 2>&1 + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +mpfrexprange: + @echo $@ + @$(AWK) -M -vPREC=53 -f $(srcdir)/$@.awk > _$@ 2>&1 + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +mpfrrnd: + @echo $@ + @$(AWK) -M -vPREC=53 -f $(srcdir)/$@.awk > _$@ 2>&1 + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +mpfrnr: + @echo $@ + @$(AWK) -M -vPREC=113 -f $(srcdir)/$@.awk $(srcdir)/$@.in > _$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +mpfrsort: + @echo $@ + @$(AWK) -M -vPREC=53 -f $(srcdir)/$@.awk > _$@ 2>&1 + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +mpfrbigint: + @echo $@ + @$(AWK) -M -f $(srcdir)/$@.awk > _$@ 2>&1 + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + jarebug:: @echo $@ @if locale -a | grep ja_JP.EUC-JP > /dev/null ; then \ @@ -1462,6 +1539,15 @@ jarebug:: -$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ ; \ fi +ordchr2:: + @echo $@ + @$(AWK) -l ordchr 'BEGIN {print chr(ord("z"))}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +readfile:: + @echo $@ + @$(AWK) -l readfile 'BEGIN {printf "%s", readfile("Makefile")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) Makefile _$@ && rm -f _$@ || cp -p Makefile $@.ok # Targets generated for other tests: include Maketests @@ -1502,8 +1588,8 @@ valgrind-scan: function show() {if (cmd) {printf "%s: %s\n",FILENAME,cmd; cmd = ""}; \ printf "\t%s\n",$$0}; \ {$$1 = ""}; \ - /Prog and args are:/ {incmd = 1; cmd = ""; next}; \ - incmd {if (NF == 1) incmd = 0; else {cmd = (cmd $$0); next}}; \ + $$2 == "Command:" {incmd = 1; $$2 = ""; cmd = $$0; next}; \ + incmd {if (/Parent PID:/) incmd = 0; else {cmd = (cmd $$0); next}}; \ /ERROR SUMMARY:/ && !/: 0 errors from 0 contexts/ {show()}; \ /definitely lost:/ && !/: 0 bytes in 0 blocks/ {show()}; \ /possibly lost:/ && !/: 0 bytes in 0 blocks/ {show()}; \ |