aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog5
-rw-r--r--test/Makefile.am10
-rw-r--r--test/Makefile.in10
-rw-r--r--test/argcasfile.awk1
-rw-r--r--test/argcasfile.in3
-rw-r--r--test/argcasfile.ok9
6 files changed, 36 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 9cd3edb3..53fe5627 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2021-02-13 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (EXTRA_DIST): argcasfile, new test.
+ * argcasfile.awk, argcasfile.in, argcasfile.ok: New files.
+
2021-01-09 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (EXTRA_DIST): octdec, new test.
diff --git a/test/Makefile.am b/test/Makefile.am
index ce28345f..bdb8831f 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -56,6 +56,9 @@ EXTRA_DIST = \
argarray.awk \
argarray.in \
argarray.ok \
+ argcasfile.awk \
+ argcasfile.in \
+ argcasfile.ok \
argtest.awk \
argtest.ok \
arrayind1.awk \
@@ -1378,7 +1381,7 @@ CLEANFILES = core core.* fmtspcl.ok
# try to keep these sorted. each letter starts a new line
BASIC_TESTS = \
- addcomma anchgsub anchor argarray arrayind1 arrayind2 arrayind3 arrayparm \
+ addcomma anchgsub anchor argarray argcasfile arrayind1 arrayind2 arrayind3 arrayparm \
arrayprm2 arrayprm3 arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 \
arynasty arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \
aryprm8 aryprm9 arysubnm aryunasgn asgext awkpath \
@@ -2479,6 +2482,11 @@ iolint:
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
@-$(RM) -f cat 'echo hello' 'exec cat' f1 f2 md5sum
+argcasfile:
+ @echo $@
+ @$(AWK) -f "$(srcdir)"/$@.awk ARGC=1 /no/such/file < "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
# Targets generated for other tests:
include Maketests
diff --git a/test/Makefile.in b/test/Makefile.in
index 337a48fc..92ef9d06 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -319,6 +319,9 @@ EXTRA_DIST = \
argarray.awk \
argarray.in \
argarray.ok \
+ argcasfile.awk \
+ argcasfile.in \
+ argcasfile.ok \
argtest.awk \
argtest.ok \
arrayind1.awk \
@@ -1641,7 +1644,7 @@ CLEANFILES = core core.* fmtspcl.ok
# try to keep these sorted. each letter starts a new line
BASIC_TESTS = \
- addcomma anchgsub anchor argarray arrayind1 arrayind2 arrayind3 arrayparm \
+ addcomma anchgsub anchor argarray argcasfile arrayind1 arrayind2 arrayind3 arrayparm \
arrayprm2 arrayprm3 arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 \
arynasty arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \
aryprm8 aryprm9 arysubnm aryunasgn asgext awkpath \
@@ -2925,6 +2928,11 @@ iolint:
@$(AWK) -f "$(srcdir)"/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
@-$(RM) -f cat 'echo hello' 'exec cat' f1 f2 md5sum
+
+argcasfile:
+ @echo $@
+ @$(AWK) -f "$(srcdir)"/$@.awk ARGC=1 /no/such/file < "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
diff --git a/test/argcasfile.awk b/test/argcasfile.awk
new file mode 100644
index 00000000..489f25ca
--- /dev/null
+++ b/test/argcasfile.awk
@@ -0,0 +1 @@
+{ for (i in ARGV) print i,ARGV[i] }
diff --git a/test/argcasfile.in b/test/argcasfile.in
new file mode 100644
index 00000000..86e041da
--- /dev/null
+++ b/test/argcasfile.in
@@ -0,0 +1,3 @@
+foo
+bar
+baz
diff --git a/test/argcasfile.ok b/test/argcasfile.ok
new file mode 100644
index 00000000..8b5d35b3
--- /dev/null
+++ b/test/argcasfile.ok
@@ -0,0 +1,9 @@
+0 gawk
+1 ARGC=1
+2 /no/such/file
+0 gawk
+1 ARGC=1
+2 /no/such/file
+0 gawk
+1 ARGC=1
+2 /no/such/file