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 7ddced8a..a74023f8 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 3ac9ee70..f0adb5a5 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 \ @@ -1220,6 +1221,8 @@ GAWK_EXT_TESTS = \ timeout \ watchpoint1 +ARRAYDEBUG_TESTS = arrdbg + EXTRA_TESTS = inftest regtest ignrcas3 INET_TESTS = inetdayu inetdayt inetechu inetecht @@ -1287,7 +1290,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 \ @@ -1329,6 +1332,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 ; \ @@ -2334,6 +2343,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 07989791..484aa780 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 \ @@ -1476,6 +1477,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 @@ -1729,7 +1731,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 \ @@ -1771,6 +1773,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 ; \ @@ -2771,6 +2779,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: @@ -4385,6 +4398,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") +} |