aboutsummaryrefslogtreecommitdiffstats
path: root/test/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'test/Makefile.am')
-rw-r--r--test/Makefile.am222
1 files changed, 208 insertions, 14 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index bb61bcaf..962ab6b2 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -102,6 +102,8 @@ EXTRA_DIST = \
asort.ok \
asorti.awk \
asorti.ok \
+ assignconst.awk \
+ assignconst.ok \
awkpath.ok \
back89.awk \
back89.in \
@@ -204,6 +206,8 @@ EXTRA_DIST = \
fieldwdth.awk \
fieldwdth.in \
fieldwdth.ok \
+ filefuncs.awk \
+ filefuncs.ok \
fldchg.awk \
fldchg.in \
fldchg.ok \
@@ -212,6 +216,7 @@ EXTRA_DIST = \
fldchgnf.ok \
fmtspcl.awk \
fmtspcl.tok \
+ fmtspcl-mpfr.ok \
fmttest.awk \
fmttest.ok \
fnamedat.awk \
@@ -220,18 +225,27 @@ 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 \
fnasgnm.in \
fnasgnm.ok \
+ fnmatch.awk \
+ fnmatch.ok \
fnmisc.awk \
fnmisc.ok \
fnparydl.awk \
fnparydl.ok \
+ fnparydl-mpfr.ok \
+ fork.awk \
+ fork.ok \
+ fork2.awk \
+ fork2.ok \
fpat1.awk \
fpat1.in \
fpat1.ok \
@@ -264,6 +278,7 @@ EXTRA_DIST = \
fstabplus.awk \
fstabplus.in \
fstabplus.ok \
+ fts.awk \
funlen.awk \
funlen.in \
funlen.ok \
@@ -342,6 +357,7 @@ EXTRA_DIST = \
gsubtst8.in \
gsubtst8.ok \
gtlnbufv.awk \
+ hello.awk \
hex.awk \
hex.ok \
hsprint.awk \
@@ -362,6 +378,18 @@ EXTRA_DIST = \
ignrcase.ok \
ignrcas2.awk \
ignrcas2.ok \
+ inclib.awk \
+ include.awk \
+ include.ok \
+ include2.ok \
+ incdupe.ok \
+ incdupe2.ok \
+ incdupe3.ok \
+ inchello.awk \
+ incdupe4.ok \
+ incdupe5.ok \
+ incdupe6.ok \
+ incdupe7.ok \
indirectcall.awk \
indirectcall.in \
indirectcall.ok \
@@ -380,6 +408,7 @@ EXTRA_DIST = \
jarebug.awk \
jarebug.in \
jarebug.ok \
+ jarebug.sh \
lc_num1.awk \
lc_num1.ok \
leaddig.awk \
@@ -532,6 +561,9 @@ EXTRA_DIST = \
opasnidx.ok \
opasnslf.awk \
opasnslf.ok \
+ ordchr.awk \
+ ordchr.ok \
+ ordchr2.ok \
out1.ok \
out2.ok \
out3.ok \
@@ -602,9 +634,12 @@ EXTRA_DIST = \
pty1.ok \
rand.awk \
rand.ok \
+ rand-mpfr.ok \
range1.awk \
range1.in \
range1.ok \
+ readdir0.awk \
+ readdir.awk \
rebt8b1.awk \
rebt8b1.ok \
rebt8b2.awk \
@@ -640,6 +675,10 @@ EXTRA_DIST = \
resplit.awk \
resplit.in \
resplit.ok \
+ revout.awk \
+ revout.ok \
+ revtwoway.awk \
+ revtwoway.ok \
rri1.awk \
rri1.in \
rri1.ok \
@@ -677,6 +716,9 @@ EXTRA_DIST = \
rtlen.sh \
rtlen01.ok \
rtlen01.sh \
+ rwarray.awk \
+ rwarray.in \
+ rwarray.ok \
scalar.awk \
scalar.ok \
sclforin.awk \
@@ -745,6 +787,9 @@ EXTRA_DIST = \
synerr1.ok \
synerr2.awk \
synerr2.ok \
+ testext.ok \
+ time.awk \
+ time.ok \
tradanch.awk \
tradanch.in \
tradanch.ok \
@@ -855,7 +900,9 @@ GAWK_EXT_TESTS = \
profile1 profile2 profile3 pty1 \
rebuf regx8bit reint reint2 rsstart1 \
rsstart2 rsstart3 rstest6 shadow sortfor sortu splitarg4 strftime \
- strtonum switch2
+ strtonum switch2 \
+ include include2 incdupe incdupe2 incdupe3 \
+ incdupe4 incdupe5 incdupe6 incdupe7
EXTRA_TESTS = inftest regtest
@@ -863,10 +910,16 @@ 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 = \
+ assignconst fnmatch filefuncs fork fork2 fts ordchr ordchr2 \
+ readdir readfile revout revtwoway rwarray testext time
+
# List of the tests which should be run with --lint option:
NEED_LINT = \
defref fmtspcl lintwarn noeffect nofmtch shadow \
@@ -879,20 +932,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
+GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk inclib.awk hello.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
@@ -903,7 +965,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)
@@ -920,6 +983,16 @@ inet: inetmesg $(INET_TESTS)
machine-tests: $(MACHINE_TESTS)
+mpfr-tests: $(MPFR_TESTS)
+
+shlib-tests:
+ @if grep 'DYNAMIC 1' $(top_srcdir)/config.h > /dev/null ; then \
+ $(MAKE) shlib-real-tests ; \
+ else echo shlib tests not supported on this system ; \
+ fi
+
+shlib-real-tests: $(SHLIB_TESTS)
+
msg::
@echo ''
@echo 'Any output from "cmp" is bad news, although some differences'
@@ -960,6 +1033,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 $@
@@ -1120,9 +1199,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) $@.ok _$@ && rm -f _$@ ; else \
+ $(CMP) $(srcdir)/$@-mpfr.ok _$@ && rm -f _$@ ; \
+ fi
reint::
@echo $@
@@ -1428,19 +1509,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 _$@
@@ -1465,11 +1546,124 @@ 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 $@
@$(srcdir)/$@.sh "$(AWKPROG)" "$(srcdir)/$@.awk" "$(srcdir)/$@.in" "_$@"
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ordchr2::
+ @echo $@
+ @$(AWK) -l ordchr 'BEGIN {print chr(ord("z"))}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+# N.B. If the test fails, create readfile.ok so that "make diffout" will work
+readfile::
+ @echo $@
+ @$(AWK) -l readfile 'BEGIN {printf "%s", readfile("Makefile")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) Makefile _$@ && rm -f _$@ || cp -p Makefile $@.ok
+
+include2::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) -i inclib 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -i inclib -i inclib.awk 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe2::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -f inclib -f inclib.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe3::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -f hello -f hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe4::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -f hello -i hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe5::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -i hello -f hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe6::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -i inchello -f hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+incdupe7::
+ @echo $@
+ @AWKPATH=$(srcdir) $(AWK) --lint -f hello -i inchello >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+testext::
+ @echo $@
+ @$(AWK) '/^(@load|BEGIN)/,/^}/' $(top_srcdir)/extension/testext.c > testext.awk
+ @$(AWK) -f testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ testext.awk
+
+assignconst:
+ @echo $@
+ @for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14; \
+ do AWKPATH=$(srcdir) $(AWK) -f $@.awk $$i ; \
+ done 2>&1 | grep -v at_exit > _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+readdir:
+ @echo $@
+ @touch $@.ok _$@ # create directory entries first
+ @ls -fli | sed 1d | $(AWK) -f $(srcdir)/readdir0.awk > $@.ok
+ @$(AWK) -f $(srcdir)/readdir.awk . > _$@
+ @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@
+
+fts:
+ @echo $@
+ @$(AWK) -f $(srcdir)/fts.awk
+ @-$(CMP) $@.out1 $@.out2 && rm -f $@.out[12]
+
charasbytes:
@echo $@
@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
@@ -1485,7 +1679,7 @@ $(srcdir)/Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
$(AWK) -f $(srcdir)/Gentests "$(srcdir)/Makefile.am" $$files > $(srcdir)/Maketests
clean:
- rm -fr _* core core.* fmtspcl.ok junk out1 out2 out3 strftime.ok test1 test2 seq *~
+ rm -fr _* core core.* fmtspcl.ok junk out1 out2 out3 strftime.ok test1 test2 seq *~ readfile.ok fork.tmp.* testext.awk fts.out1 fts.out2 readdir.ok
# An attempt to print something that can be grepped for in build logs
pass-fail:
@@ -1516,8 +1710,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()}; \