[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, feature/improve-tests, updated. gawk-4.1
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, feature/improve-tests, updated. gawk-4.1.0-3061-ga346e8b |
Date: |
Mon, 9 Apr 2018 13:08:55 -0400 (EDT) |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, feature/improve-tests has been updated
via a346e8bf2579b4b774cb414961d6d14c663d6e15 (commit)
from 1ae0301ef275e898d3f79868a6dc781bc4a73e5b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=a346e8bf2579b4b774cb414961d6d14c663d6e15
commit a346e8bf2579b4b774cb414961d6d14c663d6e15
Author: Arnold D. Robbins <address@hidden>
Date: Mon Apr 9 20:08:35 2018 +0300
Add generation of tests using a .sh file.
diff --git a/test/ChangeLog b/test/ChangeLog
index de223e7..9d53898 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,9 @@
+2018-04-09 Arnold D. Robbins <address@hidden>
+
+ * Makefile.am (RUN_SHELL): List of tests that run a .sh file.
+ * Gentests: Add support for such tests.
+ * randtest.sh: Use $AWK, not $GAWK so it can be generated.
+
2018-04-08 Arnold D. Robbins <address@hidden>
* Makefile.am (manyfiles, pid): Use echo $@ to echo test name.
diff --git a/test/Gentests b/test/Gentests
index 3e51a7f..84bddf2 100755
--- a/test/Gentests
+++ b/test/Gentests
@@ -119,8 +119,29 @@ END {
print "# end of file Maketests"
}
+function generate_shell(x, s)
+{
+ delete files[x".sh"]
+
+ s = ""
+ if (x".in" in files) {
+ s = "\"$(srcdir)\"/address@hidden"
+ delete files[x".in"]
+ }
+
+ print x ":"
+ printf "address@hidden address@hidden"
+
+ printf "address@hidden(LOCALES) AWK=\"$(AWKPROG)\"
\"$(srcdir)\"/address@hidden %s > _$@ 2>&1 || echo EXIT CODE: $$?
>>address@hidden", s
+ printf "address@hidden(CMP) \"$(srcdir)\"/address@hidden _$@ && rm -f
address@hidden"
+
+}
+
function generate(x, s)
{
+ if (x".sh" in files)
+ return generate_shell(x)
+
if (!(x".awk" in files))
printf "WARNING: file `%s.awk' not found.\n", x > "/dev/stderr"
else
@@ -207,9 +228,10 @@ 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 files)
if (!(x in unused) && \
- !(gensub(/\.(awk|in)$/,"",1,x) in targets))
+ !(gensub(/\.(awk|in|sh)$/,"",1,x) in targets))
printf "WARNING: unused file `%s'.\n", x > "/dev/stderr"
}
diff --git a/test/Makefile.am b/test/Makefile.am
index d75c0de..5616d06 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1351,6 +1351,9 @@ NEED_PRETTY = profile4 profile5 profile8 profile9
profile10
# List of tests that need --traditional
NEED_TRADITIONAL = litoct tradanch rscompat
+# Lists of tests that run a shell script
+RUN_SHELL = exit fflush localenl next randtest rtlen rtlen01
+
# List of the tests which fail with EXIT CODE 1
FAIL_CODE1 = \
badassign1 badbuild callparam delfunc fcall_exit fcall_exit2 \
@@ -1612,11 +1615,6 @@ errno:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-fflush::
- @echo $@
- @"$(srcdir)"/fflush.sh >_$@
- @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
tweakfld::
@echo $@
@$(AWK) -f "$(srcdir)"/tweakfld.awk "$(srcdir)"/tweakfld.in >_$@
@@ -1820,16 +1818,6 @@ rsstart3::
@head "$(srcdir)"/rsstart1.in | $(AWK) -f "$(srcdir)"/rsstart2.awk >_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-rtlen::
- @echo $@
- @"$(srcdir)"/address@hidden >_$@ || echo EXIT CODE: $$? >>_$@
- @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
-rtlen01::
- @echo $@
- @"$(srcdir)"/address@hidden >_$@ || echo EXIT CODE: $$? >>_$@
- @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
rtlenmb::
@echo $@
@GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \
@@ -1884,11 +1872,6 @@ reint2::
AWKPATH="$(srcdir)" $(AWK) --re-interval -f address@hidden
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-localenl::
- @echo $@
- @"$(srcdir)"/address@hidden >_$@ 2>/dev/null
- @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
mbprintf1::
@echo $@
@GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \
@@ -2005,16 +1988,6 @@ profile7:
@sed 1,2d < address@hidden > _$@; rm address@hidden
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-next:
- @echo $@
- @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1
- @-LC_ALL=C $(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
-exit:
- @echo $@
- @-AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1
- @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
rri1::
@echo $@
@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
@@ -2235,12 +2208,6 @@ dfamb1:
AWKPATH="$(srcdir)" $(AWK) -f address@hidden "$(srcdir)"/address@hidden
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
-randtest::
- @echo $@
- @-GAWK="$(AWKPROG)" "$(srcdir)"/randtest.sh >_$@
- @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
backbigs1:
@echo $@
@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
@@ -2349,7 +2316,7 @@ nlstringtest::
include Maketests
Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
- files=`cd "$(srcdir)" && echo *.awk *.in`; \
+ files=`cd "$(srcdir)" && echo *.awk *.in *.sh`; \
$(AWK) -f "$(srcdir)"/Gentests "$(srcdir)"/Makefile.am $$files > $@
clean-local:
diff --git a/test/Makefile.in b/test/Makefile.in
index 5a8b309..e9f6f41 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1608,6 +1608,9 @@ NEED_PRETTY = profile4 profile5 profile8 profile9
profile10
# List of tests that need --traditional
NEED_TRADITIONAL = litoct tradanch rscompat
+# Lists of tests that run a shell script
+RUN_SHELL = exit fflush localenl next randtest rtlen rtlen01
+
# List of the tests which fail with EXIT CODE 1
FAIL_CODE1 = \
badassign1 badbuild callparam delfunc fcall_exit fcall_exit2 \
@@ -2054,11 +2057,6 @@ errno:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-fflush::
- @echo $@
- @"$(srcdir)"/fflush.sh >_$@
- @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
tweakfld::
@echo $@
@$(AWK) -f "$(srcdir)"/tweakfld.awk "$(srcdir)"/tweakfld.in >_$@
@@ -2262,16 +2260,6 @@ rsstart3::
@head "$(srcdir)"/rsstart1.in | $(AWK) -f "$(srcdir)"/rsstart2.awk >_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-rtlen::
- @echo $@
- @"$(srcdir)"/address@hidden >_$@ || echo EXIT CODE: $$? >>_$@
- @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
-rtlen01::
- @echo $@
- @"$(srcdir)"/address@hidden >_$@ || echo EXIT CODE: $$? >>_$@
- @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
rtlenmb::
@echo $@
@GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \
@@ -2326,11 +2314,6 @@ reint2::
AWKPATH="$(srcdir)" $(AWK) --re-interval -f address@hidden
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-localenl::
- @echo $@
- @"$(srcdir)"/address@hidden >_$@ 2>/dev/null
- @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
mbprintf1::
@echo $@
@GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \
@@ -2447,16 +2430,6 @@ profile7:
@sed 1,2d < address@hidden > _$@; rm address@hidden
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-next:
- @echo $@
- @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1
- @-LC_ALL=C $(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
-exit:
- @echo $@
- @-AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1
- @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
rri1::
@echo $@
@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
@@ -2677,11 +2650,6 @@ dfamb1:
AWKPATH="$(srcdir)" $(AWK) -f address@hidden "$(srcdir)"/address@hidden
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-randtest::
- @echo $@
- @-GAWK="$(AWKPROG)" "$(srcdir)"/randtest.sh >_$@
- @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
-
backbigs1:
@echo $@
@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
@@ -3591,6 +3559,11 @@ rand:
$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@ ; \
fi
+randtest:
+ @echo $@
+ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
range1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -3896,11 +3869,31 @@ zeroflag:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+fflush:
+ @echo $@
+ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
getlnhd:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+localenl:
+ @echo $@
+ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
+rtlen:
+ @echo $@
+ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
+rtlen01:
+ @echo $@
+ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
aadelete1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@@ -3986,6 +3979,11 @@ delsub:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+exit:
+ @echo $@
+ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
fieldwdth:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -4271,6 +4269,11 @@ nastyparm:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+next:
+ @echo $@
+ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
nondec:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@@ -4675,7 +4678,7 @@ mpgforcenum:
# Targets generated for other tests:
Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
- files=`cd "$(srcdir)" && echo *.awk *.in`; \
+ files=`cd "$(srcdir)" && echo *.awk *.in *.sh`; \
$(AWK) -f "$(srcdir)"/Gentests "$(srcdir)"/Makefile.am $$files > $@
clean-local:
diff --git a/test/Maketests b/test/Maketests
index db3c113..905bd28 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -807,6 +807,11 @@ rand:
$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@ ; \
fi
+randtest:
+ @echo $@
+ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
range1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -1112,11 +1117,31 @@ zeroflag:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+fflush:
+ @echo $@
+ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
getlnhd:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+localenl:
+ @echo $@
+ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
+rtlen:
+ @echo $@
+ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
+rtlen01:
+ @echo $@
+ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
aadelete1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@@ -1202,6 +1227,11 @@ delsub:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+exit:
+ @echo $@
+ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
fieldwdth:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -1487,6 +1517,11 @@ nastyparm:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+next:
+ @echo $@
+ @-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/address@hidden > _$@ 2>&1 ||
echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
nondec:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
diff --git a/test/randtest.sh b/test/randtest.sh
index b17fda7..597376a 100755
--- a/test/randtest.sh
+++ b/test/randtest.sh
@@ -29,9 +29,9 @@
#
#!/bin/ksh
-#GAWK=/bin/gawk
+#AWK=/bin/gawk
-# ADR: Get GAWK from the environment.
+# ADR: Get AWK from the environment.
# Additional note: This wants ksh/bash for the use of $RANDOM below to
# seed the generator. However, shells that don't provide it won't be
# a problem since gawk will then seed the generator with the time of day,
@@ -40,7 +40,7 @@
# large NSAMPLES and NRUNS will bring any correlation out of the noise better
NSAMPLES=1024; MAX_ALLOWED_SIGMA=5; NRUNS=50;
-$GAWK 'BEGIN{
+$AWK 'BEGIN{
srand('$RANDOM');
nsamples=('$NSAMPLES');
max_allowed_sigma=('$MAX_ALLOWED_SIGMA');
-----------------------------------------------------------------------
Summary of changes:
test/ChangeLog | 6 +++++
test/Gentests | 24 +++++++++++++++++-
test/Makefile.am | 41 +++----------------------------
test/Makefile.in | 75 +++++++++++++++++++++++++++++---------------------------
test/Maketests | 35 ++++++++++++++++++++++++++
test/randtest.sh | 6 ++---
6 files changed, 110 insertions(+), 77 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, feature/improve-tests, updated. gawk-4.1.0-3061-ga346e8b,
Arnold Robbins <=