diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 9 | ||||
-rw-r--r-- | test/Makefile.am | 17 | ||||
-rw-r--r-- | test/Makefile.in | 16 | ||||
-rw-r--r-- | test/arrdbg.awk | 17 |
4 files changed, 57 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 11d93d05..e6d2123c 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 13d4f240..1e65ea1d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -72,6 +72,7 @@ EXTRA_DIST = \ arrayref.ok \ arraysort.awk \ arraysort.ok \ + arrdbg.awk \ arrymem1.awk \ arrymem1.ok \ arryref2.awk \ @@ -1232,6 +1233,8 @@ GAWK_EXT_TESTS = \ timeout \ watchpoint1 +ARRAYDEBUG_TESTS = arrdbg + EXTRA_TESTS = inftest regtest ignrcas3 INET_TESTS = inetdayu inetdayt inetechu inetecht @@ -1299,7 +1302,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 \ @@ -1341,6 +1344,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 ; \ @@ -2346,6 +2355,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 19d82e54..9610b720 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -329,6 +329,7 @@ EXTRA_DIST = \ arrayref.ok \ arraysort.awk \ arraysort.ok \ + arrdbg.awk \ arrymem1.awk \ arrymem1.ok \ arryref2.awk \ @@ -1488,6 +1489,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 @@ -1741,7 +1743,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 \ @@ -1783,6 +1785,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 ; \ @@ -2783,6 +2791,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: @@ -4412,6 +4425,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") +} |