aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-06-18 21:14:33 +0300
committerArnold D. Robbins <arnold@skeeve.com>2012-06-18 21:14:33 +0300
commitb0f08ac2443e239b0ed9cc4421758f0ed3f7a94f (patch)
tree9a1b4869e7c52a4d1a864c655340cd51e24e403a /test
parent6311c35dd8984a8516802b3cc111c1f411e098fd (diff)
downloadegawk-b0f08ac2443e239b0ed9cc4421758f0ed3f7a94f.tar.gz
egawk-b0f08ac2443e239b0ed9cc4421758f0ed3f7a94f.tar.bz2
egawk-b0f08ac2443e239b0ed9cc4421758f0ed3f7a94f.zip
Add testext to list of shared library tests.
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog6
-rw-r--r--test/Makefile.am11
-rw-r--r--test/Makefile.in11
-rw-r--r--test/testext.ok30
4 files changed, 54 insertions, 4 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index ac8737d6..a1717010 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-18 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (testext): New test.
+ (clean): Add testext.awk to the list.
+ * testext.ok: New file.
+
2012-06-12 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (clean): Add fork.tmp.* to the list.
diff --git a/test/Makefile.am b/test/Makefile.am
index 6b052f1d..c520b722 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -757,6 +757,7 @@ EXTRA_DIST = \
synerr1.ok \
synerr2.awk \
synerr2.ok \
+ testext.ok \
time.awk \
time.ok \
tradanch.awk \
@@ -884,7 +885,7 @@ LOCALE_CHARSET_TESTS = \
asort asorti fmttest fnarydel fnparydl lc_num1 mbfw1 \
mbprintf1 mbprintf2 mbprintf3 rebt8b2 rtlenmb sort1 sprintfc
-SHLIB_TESTS = ordchr ordchr2 fork fork2 readfile filefuncs time
+SHLIB_TESTS = ordchr ordchr2 fork fork2 readfile filefuncs testext time
# List of the tests which should be run with --lint option:
NEED_LINT = \
@@ -1580,6 +1581,12 @@ incdupe3::
@AWKPATH=$(srcdir) $(AWK) --lint -f hello -f hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+testext::
+ @echo $@
+ @$(AWK) '/^(@load|BEGIN)/,/^}/' $(top_srcdir)/extension/testext.c > testext.awk
+ @$(AWK) -f testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ testext.awk
+
# Targets generated for other tests:
include Maketests
@@ -1588,7 +1595,7 @@ $(srcdir)/Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
$(AWK) -f $(srcdir)/Gentests "$(srcdir)/Makefile.am" $$files > $(srcdir)/Maketests
clean:
- rm -fr _* core core.* fmtspcl.ok junk out1 out2 out3 strftime.ok test1 test2 seq *~ readfile.ok fork.tmp.*
+ rm -fr _* core core.* fmtspcl.ok junk out1 out2 out3 strftime.ok test1 test2 seq *~ readfile.ok fork.tmp.* testext.awk
# An attempt to print something that can be grepped for in build logs
pass-fail:
diff --git a/test/Makefile.in b/test/Makefile.in
index 05f9db13..57ccbd99 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -969,6 +969,7 @@ EXTRA_DIST = \
synerr1.ok \
synerr2.awk \
synerr2.ok \
+ testext.ok \
time.awk \
time.ok \
tradanch.awk \
@@ -1092,7 +1093,7 @@ LOCALE_CHARSET_TESTS = \
asort asorti fmttest fnarydel fnparydl lc_num1 mbfw1 \
mbprintf1 mbprintf2 mbprintf3 rebt8b2 rtlenmb sort1 sprintfc
-SHLIB_TESTS = ordchr ordchr2 fork fork2 readfile filefuncs time
+SHLIB_TESTS = ordchr ordchr2 fork fork2 readfile filefuncs testext time
# List of the tests which should be run with --lint option:
NEED_LINT = \
@@ -1960,6 +1961,12 @@ incdupe3::
@echo $@
@AWKPATH=$(srcdir) $(AWK) --lint -f hello -f hello.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+testext::
+ @echo $@
+ @$(AWK) '/^(@load|BEGIN)/,/^}/' $(top_srcdir)/extension/testext.c > testext.awk
+ @$(AWK) -f testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ testext.awk
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
@@ -3195,7 +3202,7 @@ $(srcdir)/Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
$(AWK) -f $(srcdir)/Gentests "$(srcdir)/Makefile.am" $$files > $(srcdir)/Maketests
clean:
- rm -fr _* core core.* fmtspcl.ok junk out1 out2 out3 strftime.ok test1 test2 seq *~ readfile.ok fork.tmp.*
+ rm -fr _* core core.* fmtspcl.ok junk out1 out2 out3 strftime.ok test1 test2 seq *~ readfile.ok fork.tmp.* testext.awk
# An attempt to print something that can be grepped for in build logs
pass-fail:
diff --git a/test/testext.ok b/test/testext.ok
new file mode 100644
index 00000000..9cac57ad
--- /dev/null
+++ b/test/testext.ok
@@ -0,0 +1,30 @@
+var_test: sym_lookup of ARGC passed - did not get a value
+var_test: sym_update("testvar") succeeded
+var_test() returned 1, test_var = 42
+
+test_errno() returned 1, ERRNO = No child processes
+
+length of test_array is 10, should be 10
+test_array_size: incoming size is 10
+test_array_size() returned 1, length is now 0
+
+test_array_elem: a["3"] = "three"
+test_array_elem() returned 1, test_array2[3] = 42
+test_array_elem did remove element "5"
+test_array_elem added element "7" --> seven
+
+Initial value of LINT is 0
+print_do_lint: lint = 0
+print_do_lint() returned 1
+Changed value of LINT is 1
+print_do_lint: lint = 1
+print_do_lint() returned 1
+
+answer_num = 42
+message_string = hello, world
+new_array["hello"] = "world"
+new_array["answer"] = "42"
+
+at_exit2 called (should be first): data = NULL, exit_status = 0
+at_exit1 called (should be second): (data is & data_for_1), data value = 0xdeadbeef, exit_status = 0
+at_exit0 called (should be third): data = NULL, exit_status = 0