aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/ChangeLog9
-rw-r--r--test/Makefile.am17
-rw-r--r--test/Makefile.in16
-rw-r--r--test/arrdbg.awk17
4 files changed, 57 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index dbac66ec..28b15fa3 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,12 @@
+2016-08-16 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (arrdbg): New test using adump.
+ (ARRAYDEBUG_TESTS): New test group requiring ARRAYDEBUG compilation.
+ (check): Add arraydebug-tests.
+ (arraydebug-tests): Check $(ARRAYDEBUG_TESTS) when compiled with
+ ARRAYDEBUG.
+ * arrdbg.awk: New test using adump to check array type.
+
2016-08-14 Andrew J. Schorr <aschorr@telemetry-investments.com>
* intarray.awk, intarray.ok: Updated.
diff --git a/test/Makefile.am b/test/Makefile.am
index 67485455..a0b4f525 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -67,6 +67,7 @@ EXTRA_DIST = \
arrayref.ok \
arraysort.awk \
arraysort.ok \
+ arrdbg.awk \
arrymem1.awk \
arrymem1.ok \
arryref2.awk \
@@ -1224,6 +1225,8 @@ GAWK_EXT_TESTS = \
timeout \
watchpoint1
+ARRAYDEBUG_TESTS = arrdbg
+
EXTRA_TESTS = inftest regtest ignrcas3
INET_TESTS = inetdayu inetdayt inetechu inetecht
@@ -1291,7 +1294,7 @@ check: msg \
printlang \
basic-msg-start basic basic-msg-end \
unix-msg-start unix-tests unix-msg-end \
- extend-msg-start gawk-extensions extend-msg-end \
+ extend-msg-start gawk-extensions arraydebug-tests extend-msg-end \
machine-msg-start machine-tests machine-msg-end \
charset-tests-all \
shlib-msg-start shlib-tests shlib-msg-end \
@@ -1333,6 +1336,12 @@ mpfr-tests:
else $(MAKE) $(MPFR_TESTS) ; \
fi
+arraydebug-tests:
+ @if echo $(CFLAGS) | grep ARRAYDEBUG > /dev/null ; then \
+ $(MAKE) $(ARRAYDEBUG_TESTS) ; \
+ else echo gawk is not compiled to support the array debug tests ; \
+ fi
+
shlib-tests:
@if $(AWK) --version | $(AWK) ' /API/ { exit 1 }' ; then \
echo shlib tests not supported on this system ; \
@@ -2338,6 +2347,12 @@ ignrcas3::
$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; \
fi
+arrdbg:
+ @echo $@
+ @$(AWK) -v "okfile=$(srcdir)/$@.ok" -f "$(srcdir)"/$@.awk | grep array_f >_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ "$(srcdir)"/$@.ok
+# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ "$(srcdir)"/$@.ok || exit 0
+
# Targets generated for other tests:
include Maketests
diff --git a/test/Makefile.in b/test/Makefile.in
index 8df786d2..5731487f 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -324,6 +324,7 @@ EXTRA_DIST = \
arrayref.ok \
arraysort.awk \
arraysort.ok \
+ arrdbg.awk \
arrymem1.awk \
arrymem1.ok \
arryref2.awk \
@@ -1480,6 +1481,7 @@ GAWK_EXT_TESTS = \
timeout \
watchpoint1
+ARRAYDEBUG_TESTS = arrdbg
EXTRA_TESTS = inftest regtest ignrcas3
INET_TESTS = inetdayu inetdayt inetechu inetecht
MACHINE_TESTS = double1 double2 fmtspcl intformat
@@ -1733,7 +1735,7 @@ check: msg \
printlang \
basic-msg-start basic basic-msg-end \
unix-msg-start unix-tests unix-msg-end \
- extend-msg-start gawk-extensions extend-msg-end \
+ extend-msg-start gawk-extensions arraydebug-tests extend-msg-end \
machine-msg-start machine-tests machine-msg-end \
charset-tests-all \
shlib-msg-start shlib-tests shlib-msg-end \
@@ -1775,6 +1777,12 @@ mpfr-tests:
else $(MAKE) $(MPFR_TESTS) ; \
fi
+arraydebug-tests:
+ @if echo $(CFLAGS) | grep ARRAYDEBUG > /dev/null ; then \
+ $(MAKE) $(ARRAYDEBUG_TESTS) ; \
+ else echo gawk is not compiled to support the array debug tests ; \
+ fi
+
shlib-tests:
@if $(AWK) --version | $(AWK) ' /API/ { exit 1 }' ; then \
echo shlib tests not supported on this system ; \
@@ -2775,6 +2783,11 @@ ignrcas3::
AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ ; \
$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ; \
fi
+
+arrdbg:
+ @echo $@
+ @$(AWK) -v "okfile=$(srcdir)/$@.ok" -f "$(srcdir)"/$@.awk | grep array_f >_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ "$(srcdir)"/$@.ok
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
@@ -4389,6 +4402,7 @@ time:
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
# end of file Maketests
+# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ "$(srcdir)"/$@.ok || exit 0
# Targets generated for other tests:
diff --git a/test/arrdbg.awk b/test/arrdbg.awk
new file mode 100644
index 00000000..951acb41
--- /dev/null
+++ b/test/arrdbg.awk
@@ -0,0 +1,17 @@
+function check(x, exptype, f) {
+ f[x]
+ printf "array_f subscript [%s]\n", x
+ printf "array_f subscript [%s]\n", x > okfile
+ adump(f, -1)
+ printf " array_func: %s_array_func\n", exptype > okfile
+}
+
+BEGIN {
+ check(3.0, "cint")
+ check(-3, "int")
+ check("3.0", "str")
+ split(" 3", f, "|") # create a maybe_num value
+ check(f[1], "str")
+ check("0", "cint")
+ check("-1", "int")
+}