aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-06-25 23:12:55 +0300
committerArnold D. Robbins <arnold@skeeve.com>2015-06-25 23:12:55 +0300
commit056cd074c60d940d5bb46410f114a6c2584daaae (patch)
treee2b095b3740b35cc95a8b25fd10ee5d81288565e /test
parent5b246a31d63a31180136934adbed361651f325ba (diff)
parent3712ad29b6cddcf49bf1507f5677a49ccfcff83d (diff)
downloadegawk-056cd074c60d940d5bb46410f114a6c2584daaae.tar.gz
egawk-056cd074c60d940d5bb46410f114a6c2584daaae.tar.bz2
egawk-056cd074c60d940d5bb46410f114a6c2584daaae.zip
Merge branch 'master' into feature/cmake
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog19
-rw-r--r--test/Makefile.am20
-rw-r--r--test/Makefile.in35
-rw-r--r--test/Maketests15
-rw-r--r--test/dbugtypedre.awk1
-rw-r--r--test/dbugtypedre.in4
-rw-r--r--test/dbugtypedre.ok17
-rw-r--r--test/typeof2.awk20
-rw-r--r--test/typeof2.ok6
-rw-r--r--test/typeof3.awk19
-rw-r--r--test/typeof3.ok9
-rw-r--r--test/typeof4.awk13
-rw-r--r--test/typeof4.ok1
13 files changed, 173 insertions, 6 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index b57a756f..b92d8ae7 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,22 @@
+2015-06-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (negtime): Fix out-of-tree test run.
+
+ Unrelated:
+
+ * Makefile.am (typeof3, typeof4): New tests.
+ * typeof2.awk, typeof2.ok, typeof3.awk, typeof3.ok: New files.
+
+ Unrelated:
+
+ * Makefile.am (dbugtypedre): New tests.
+ * dbugtypedre.awk, dbugtypedre.in, dbugtypedre.ok: New files.
+
+2015-06-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (typeof2): New test.
+ * typeof2.awk, typeof2.ok: New files.
+
2015-06-19 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (gsubind, typedregex1, typeof1): New tests.
diff --git a/test/Makefile.am b/test/Makefile.am
index 537a5655..03d28f21 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -177,6 +177,9 @@ EXTRA_DIST = \
datanonl.ok \
dbugeval.in \
dbugeval.ok \
+ dbugtypedre.awk \
+ dbugtypedre.in \
+ dbugtypedre.ok \
defref.awk \
defref.ok \
delargv.awk \
@@ -985,6 +988,12 @@ EXTRA_DIST = \
typedregex1.ok \
typeof1.awk \
typeof1.ok \
+ typeof2.awk \
+ typeof2.ok \
+ typeof3.awk \
+ typeof3.ok \
+ typeof4.awk \
+ typeof4.ok \
uninit2.awk \
uninit2.ok \
uninit3.awk \
@@ -1079,7 +1088,7 @@ UNIX_TESTS = \
GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \
backw badargs beginfile1 beginfile2 binmode1 charasbytes \
- colonwarn clos1way crlf dbugeval delsub devfd devfd1 devfd2 dumpvars errno exit \
+ colonwarn clos1way crlf dbugeval dbugtypedre delsub devfd devfd1 devfd2 dumpvars errno exit \
fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \
functab1 functab2 functab3 fwtest fwtest2 fwtest3 \
genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops gsubind \
@@ -1099,7 +1108,7 @@ GAWK_EXT_TESTS = \
splitarg4 strftime \
strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \
symtab7 symtab8 symtab9 \
- typedregex1 typeof1
+ typedregex1 typeof1 typeof2 typeof3 typeof4
timeout
EXTRA_TESTS = inftest regtest
@@ -2124,7 +2133,12 @@ paramasfunc2::
negtime::
@echo $@
@TZ=GMT AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @AWKPATH="$(srcdir)" $(AWK) -f checknegtime.awk $@.ok _$@ && rm -f _$@
+ @AWKPATH="$(srcdir)" $(AWK) -f checknegtime.awk "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+dbugtypedre:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -D -f $@.awk < $@.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 a8895ed7..294c60c0 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -434,6 +434,9 @@ EXTRA_DIST = \
datanonl.ok \
dbugeval.in \
dbugeval.ok \
+ dbugtypedre.awk \
+ dbugtypedre.in \
+ dbugtypedre.ok \
defref.awk \
defref.ok \
delargv.awk \
@@ -1242,6 +1245,12 @@ EXTRA_DIST = \
typedregex1.ok \
typeof1.awk \
typeof1.ok \
+ typeof2.awk \
+ typeof2.ok \
+ typeof3.awk \
+ typeof3.ok \
+ typeof4.awk \
+ typeof4.ok \
uninit2.awk \
uninit2.ok \
uninit3.awk \
@@ -1335,7 +1344,7 @@ UNIX_TESTS = \
GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \
backw badargs beginfile1 beginfile2 binmode1 charasbytes \
- colonwarn clos1way crlf dbugeval delsub devfd devfd1 devfd2 dumpvars errno exit \
+ colonwarn clos1way crlf dbugeval dbugtypedre delsub devfd devfd1 devfd2 dumpvars errno exit \
fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \
functab1 functab2 functab3 fwtest fwtest2 fwtest3 \
genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops gsubind \
@@ -1355,7 +1364,7 @@ GAWK_EXT_TESTS = \
splitarg4 strftime \
strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \
symtab7 symtab8 symtab9 \
- typedregex1 typeof1
+ typedregex1 typeof1 typeof2 typeof3 typeof4
EXTRA_TESTS = inftest regtest
INET_TESTS = inetdayu inetdayt inetechu inetecht
@@ -2560,7 +2569,12 @@ paramasfunc2::
negtime::
@echo $@
@TZ=GMT AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @AWKPATH="$(srcdir)" $(AWK) -f checknegtime.awk $@.ok _$@ && rm -f _$@
+ @AWKPATH="$(srcdir)" $(AWK) -f checknegtime.awk "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+dbugtypedre:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -D -f $@.awk < $@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
@@ -3905,6 +3919,21 @@ typeof1:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+typeof2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+typeof3:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+typeof4:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
double1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index a674d5d0..e4cea0de 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1342,6 +1342,21 @@ typeof1:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+typeof2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+typeof3:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+typeof4:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
double1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/dbugtypedre.awk b/test/dbugtypedre.awk
new file mode 100644
index 00000000..b8c0b6d7
--- /dev/null
+++ b/test/dbugtypedre.awk
@@ -0,0 +1 @@
+@include "typeof1.awk"
diff --git a/test/dbugtypedre.in b/test/dbugtypedre.in
new file mode 100644
index 00000000..00158c65
--- /dev/null
+++ b/test/dbugtypedre.in
@@ -0,0 +1,4 @@
+watch e
+run
+next
+p e
diff --git a/test/dbugtypedre.ok b/test/dbugtypedre.ok
new file mode 100644
index 00000000..de3c8bcd
--- /dev/null
+++ b/test/dbugtypedre.ok
@@ -0,0 +1,17 @@
+Watchpoint 1: e
+Starting program:
+scalar_n
+untyped
+regexp
+scalar_s
+array scalar_n
+Stopping in BEGIN ...
+Watchpoint 1: e
+ Old value: untyped variable
+ New value: @/foo/
+main() at `typeof1.awk':7
+7 e = @/foo/ ; print typeof(e)
+regexp
+8 print typeof(@/bar/)
+e = @/foo/
+EXIT CODE: 2
diff --git a/test/typeof2.awk b/test/typeof2.awk
new file mode 100644
index 00000000..25da02e4
--- /dev/null
+++ b/test/typeof2.awk
@@ -0,0 +1,20 @@
+BEGIN {
+ print typeof(x)
+ x[1] = 3
+ print typeof(x)
+}
+
+function test1() {
+}
+
+function test2(p) {
+ p[1] = 1
+}
+
+BEGIN {
+ print typeof(a)
+ test1(a)
+ print typeof(a)
+ test2(a)
+ print typeof(a)
+}
diff --git a/test/typeof2.ok b/test/typeof2.ok
new file mode 100644
index 00000000..cc032a83
--- /dev/null
+++ b/test/typeof2.ok
@@ -0,0 +1,6 @@
+untyped
+array
+untyped
+gawk: typeof2.awk:16: warning: function `test1' called with more arguments than declared
+untyped
+array
diff --git a/test/typeof3.awk b/test/typeof3.awk
new file mode 100644
index 00000000..d148f373
--- /dev/null
+++ b/test/typeof3.awk
@@ -0,0 +1,19 @@
+BEGIN {
+ x = @/xx/
+ print typeof(x)
+ print x
+}
+
+# this set may not really be needed for the test
+BEGIN {
+ x = 4
+ print typeof(@/xxx/)
+ print typeof(3)
+ print x
+}
+
+BEGIN {
+ print typeof(x)
+ print typeof(a[1])
+ a[1][2] # fatals on this
+}
diff --git a/test/typeof3.ok b/test/typeof3.ok
new file mode 100644
index 00000000..8186ad9e
--- /dev/null
+++ b/test/typeof3.ok
@@ -0,0 +1,9 @@
+regexp
+xx
+regexp
+scalar_n
+4
+scalar_n
+untyped
+gawk: typeof3.awk:18: fatal: attempt to use scalar `a["1"]' as an array
+EXIT CODE: 2
diff --git a/test/typeof4.awk b/test/typeof4.awk
new file mode 100644
index 00000000..62c2905c
--- /dev/null
+++ b/test/typeof4.awk
@@ -0,0 +1,13 @@
+BEGIN{ a["x"]["y"]["z"]="scalar" ; walk_array(a, "a")}
+function walk_array(arr, name, i, r)
+{
+ for (i in arr) {
+ r = typeof(arr[i])
+# printf("typeof(%s[%s]) = %s\n", name, i, r) > "/dev/stderr"
+ if (r == "array") {
+ walk_array(arr[i], name "[" i "]")
+ } else {
+ printf "%s[%s] = %s\n", name, i, arr[i]
+ }
+ }
+}
diff --git a/test/typeof4.ok b/test/typeof4.ok
new file mode 100644
index 00000000..fca0263d
--- /dev/null
+++ b/test/typeof4.ok
@@ -0,0 +1 @@
+a[x][y][z] = scalar