gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4374-g0b94b683


From: Arnold Robbins
Subject: [SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4374-g0b94b683
Date: Wed, 9 Feb 2022 00:35:31 -0500 (EST)

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, gawk-5.1-stable has been updated
       via  0b94b68387b85310b7104bb669d7b698e92888d2 (commit)
      from  128a6b43506a530a44777c1156ba1940c4d8fba0 (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=0b94b68387b85310b7104bb669d7b698e92888d2

commit 0b94b68387b85310b7104bb669d7b698e92888d2
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Wed Feb 9 07:35:02 2022 +0200

    Add tests for indirect calls of builtins.

diff --git a/pc/ChangeLog b/pc/ChangeLog
index 2ca19739..e75df278 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2022-02-09         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * Makefile.tst: Regenerated.
+
 2022-01-05         Arnold D. Robbins     <arnold@skeeve.com>
 
        * Makefile.tst: Regenerated.
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index 5569e571..f25e887b 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -196,6 +196,7 @@ GAWK_EXT_TESTS = \
        gnuops2 gnuops3 gnureops gsubind icasefs icasers id igncdym igncfs \
        ignrcas2 ignrcas4 ignrcase incdupe incdupe2 incdupe3 incdupe4 \
        incdupe5 incdupe6 incdupe7 include include2 indirectbuiltin \
+       indirectbuiltin2 \
        indirectcall indirectcall2 inf-nan-torture intarray iolint \
        isarrayunset lint lintexp lintindex lintint lintlength lintplus \
        lintold lintset lintwarn manyfiles match1 match2 match3 mbstr1 \
@@ -1235,6 +1236,13 @@ argcasfile:
        @echo $@
        @-$(AWK) -f "$(srcdir)"/$@.awk ARGC=1 ' /no/such/file' < 
"$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+indirectbuiltin2:
+       @echo $@
+       @-for test in 0 1 2 3 4 5 ; do \
+       $(AWK) -v test=$$test -f "$(srcdir)"/$@.awk ; \
+       done > _$@ 2>&1 || exit 0
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 Gt-dummy:
 # file Maketests, generated from Makefile.am by the Gentests program
 addcomma:
diff --git a/test/ChangeLog b/test/ChangeLog
index 7db73f3c..c45b2f43 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2022-02-09         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * Makefile.am (EXTRA_DIST): indirectbuiltin2, new test.
+       * indirectbuiltin2.awk, indirectbuiltin2.ok: New files.
+
 2022-01-05         Arnold D. Robbins     <arnold@skeeve.com>
 
        * Makefile.am (EXTRA_DIST): nsidentifier, new test.
diff --git a/test/Makefile.am b/test/Makefile.am
index abd1fc00..424aaa82 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -567,6 +567,8 @@ EXTRA_DIST = \
        include.ok \
        indirectbuiltin.awk \
        indirectbuiltin.ok \
+       indirectbuiltin2.awk \
+       indirectbuiltin2.ok \
        indirectcall2.awk \
        indirectcall2.ok \
        indirectcall.awk \
@@ -1449,6 +1451,7 @@ GAWK_EXT_TESTS = \
        gnuops2 gnuops3 gnureops gsubind icasefs icasers id igncdym igncfs \
        ignrcas2 ignrcas4 ignrcase incdupe incdupe2 incdupe3 incdupe4 \
        incdupe5 incdupe6 incdupe7 include include2 indirectbuiltin \
+       indirectbuiltin2 \
        indirectcall indirectcall2 inf-nan-torture intarray iolint \
        isarrayunset lint lintexp lintindex lintint lintlength lintplus \
        lintold lintset lintwarn manyfiles match1 match2 match3 mbstr1 \
@@ -2489,6 +2492,13 @@ argcasfile:
        @-$(AWK) -f "$(srcdir)"/$@.awk ARGC=1 ' /no/such/file' < 
"$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+indirectbuiltin2:
+       @echo $@
+       @-for test in 0 1 2 3 4 5 ; do \
+       $(AWK) -v test=$$test -f "$(srcdir)"/$@.awk ; \
+       done > _$@ 2>&1 || exit 0
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 # Targets generated for other tests:
 include Maketests
 
diff --git a/test/Makefile.in b/test/Makefile.in
index ab45c3aa..82b60902 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -833,6 +833,8 @@ EXTRA_DIST = \
        include.ok \
        indirectbuiltin.awk \
        indirectbuiltin.ok \
+       indirectbuiltin2.awk \
+       indirectbuiltin2.ok \
        indirectcall2.awk \
        indirectcall2.ok \
        indirectcall.awk \
@@ -1715,6 +1717,7 @@ GAWK_EXT_TESTS = \
        gnuops2 gnuops3 gnureops gsubind icasefs icasers id igncdym igncfs \
        ignrcas2 ignrcas4 ignrcase incdupe incdupe2 incdupe3 incdupe4 \
        incdupe5 incdupe6 incdupe7 include include2 indirectbuiltin \
+       indirectbuiltin2 \
        indirectcall indirectcall2 inf-nan-torture intarray iolint \
        isarrayunset lint lintexp lintindex lintint lintlength lintplus \
        lintold lintset lintwarn manyfiles match1 match2 match3 mbstr1 \
@@ -2937,6 +2940,13 @@ argcasfile:
        @echo $@
        @-$(AWK) -f "$(srcdir)"/$@.awk ARGC=1 ' /no/such/file' < 
"$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+indirectbuiltin2:
+       @echo $@
+       @-for test in 0 1 2 3 4 5 ; do \
+       $(AWK) -v test=$$test -f "$(srcdir)"/$@.awk ; \
+       done > _$@ 2>&1 || exit 0
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 Gt-dummy:
 # file Maketests, generated from Makefile.am by the Gentests program
 addcomma:
diff --git a/test/indirectbuiltin2.awk b/test/indirectbuiltin2.awk
new file mode 100644
index 00000000..6409f91a
--- /dev/null
+++ b/test/indirectbuiltin2.awk
@@ -0,0 +1,29 @@
+@load "ordchr"
+
+BEGIN {
+       o = "ord"               # check stack for indirect call of ext function
+       l = "length"            # check bad args for function of 1 argument
+       m = "match"             # check bad args for function of 3-4 argument
+       s = "systime"           # check bad args for function of 0 arguments
+
+       switch (test) {
+       case 0:
+               print "indirect, "  @o("A")
+               break
+       case 1:
+               print @l()
+               break
+       case 2:
+               print @l("a", "b")
+               break
+       case 3:
+               print @m(@/foo/)
+               break
+       case 4:
+               print @m(@/foo/, "bar", a, b)
+               break
+       case 5:
+               print @s("xxx")
+               break
+       }
+}
diff --git a/test/indirectbuiltin2.ok b/test/indirectbuiltin2.ok
new file mode 100644
index 00000000..dfb2005e
--- /dev/null
+++ b/test/indirectbuiltin2.ok
@@ -0,0 +1,6 @@
+indirect, 65
+gawk: ./indirectbuiltin2.awk:14: fatal: length: called with 0 arguments
+gawk: ./indirectbuiltin2.awk:17: fatal: length: called with 2 arguments
+gawk: ./indirectbuiltin2.awk:20: fatal: indirect call to match requires two or 
three arguments
+gawk: ./indirectbuiltin2.awk:23: fatal: indirect call to match requires two or 
three arguments
+gawk: ./indirectbuiltin2.awk:26: fatal: systime: called with 1 arguments

-----------------------------------------------------------------------

Summary of changes:
 pc/ChangeLog              |  4 ++++
 pc/Makefile.tst           |  8 ++++++++
 test/ChangeLog            |  5 +++++
 test/Makefile.am          | 10 ++++++++++
 test/Makefile.in          | 10 ++++++++++
 test/indirectbuiltin2.awk | 29 +++++++++++++++++++++++++++++
 test/indirectbuiltin2.ok  |  6 ++++++
 7 files changed, 72 insertions(+)
 create mode 100644 test/indirectbuiltin2.awk
 create mode 100644 test/indirectbuiltin2.ok


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]