diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2019-06-28 12:00:33 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2019-06-28 12:00:33 +0300 |
commit | 4e38fffcac026c4d8a8fbf52258faf478dcf4db2 (patch) | |
tree | 11c98387e4fef8f83f62504e2077713347d61bc3 | |
parent | 8ff0d3a5a55237f78a8c3076a07c38f7e1c1c5e9 (diff) | |
download | gawk-4e38fffcac026c4d8a8fbf52258faf478dcf4db2.tar.gz |
Add backwards compatibility tests for inplace extension.
-rw-r--r-- | test/ChangeLog | 11 | ||||
-rw-r--r-- | test/Makefile.am | 35 | ||||
-rw-r--r-- | test/Makefile.in | 35 | ||||
-rw-r--r-- | test/inplace2bcomp.1.ok | 2 | ||||
-rw-r--r-- | test/inplace2bcomp.1.orig.ok | 2 | ||||
-rw-r--r-- | test/inplace2bcomp.2.ok | 2 | ||||
-rw-r--r-- | test/inplace2bcomp.2.orig.ok | 2 | ||||
-rw-r--r-- | test/inplace2bcomp.ok | 6 | ||||
-rw-r--r-- | test/inplace3bcomp.1.ok | 2 | ||||
-rw-r--r-- | test/inplace3bcomp.1.orig.ok | 2 | ||||
-rw-r--r-- | test/inplace3bcomp.2.ok | 2 | ||||
-rw-r--r-- | test/inplace3bcomp.2.orig.ok | 2 | ||||
-rw-r--r-- | test/inplace3bcomp.ok | 12 |
13 files changed, 113 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index a538c593..5239ff98 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,14 @@ +2019-06-28 Michal Jaegermann <michal.jnn@gmail.com> + + Add backwards compatibility tests for inplace. + + * Makefile.am (EXTRA_DISTS): New tests, inplace2bcomp, inplace2bcomp. + * inplace2bcomp.1.ok, test/inplace2bcomp.1.orig.ok, + test/inplace2bcomp.2.ok, test/inplace2bcomp.2.orig.ok, + test/inplace2bcomp.ok, test/inplace3bcomp.1.ok, + test/inplace3bcomp.1.orig.ok, test/inplace3bcomp.2.ok, + test/inplace3bcomp.2.orig.ok, test/inplace3bcomp.ok: New files. + 2019-06-26 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (EXTRA_DIST): New tests, nsawk1[abc] and nsawk2[ab]. diff --git a/test/Makefile.am b/test/Makefile.am index d7f6e016..5b57d9ca 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -566,11 +566,21 @@ EXTRA_DIST = \ inplace2.1.bak.ok \ inplace2.2.ok \ inplace2.2.bak.ok \ + inplace2bcomp.1.ok \ + inplace2bcomp.1.orig.ok \ + inplace2bcomp.2.ok \ + inplace2bcomp.2.orig.ok \ + inplace2bcomp.ok \ inplace3.ok \ inplace3.1.ok \ inplace3.1.bak.ok \ inplace3.2.ok \ inplace3.2.bak.ok \ + inplace3bcomp.1.ok \ + inplace3bcomp.1.orig.ok \ + inplace3bcomp.2.ok \ + inplace3bcomp.2.orig.ok \ + inplace3bcomp.ok \ inputred.awk \ inputred.ok \ intarray.awk \ @@ -1393,7 +1403,7 @@ SHLIB_TESTS = \ apiterm \ filefuncs fnmatch fork fork2 fts functab4 \ getfile \ - inplace1 inplace2 inplace3 \ + inplace1 inplace2 inplace2bcomp inplace3 inplace3bcomp \ ordchr ordchr2 \ readdir readdir_test readdir_retest readfile readfile2 revout \ revtwoway rwarray \ @@ -2135,6 +2145,17 @@ inplace2:: @-$(CMP) "$(srcdir)"/$@.2.ok _$@.2 && rm -f _$@.2 @-$(CMP) "$(srcdir)"/$@.2.bak.ok _$@.2.bak && rm -f _$@.2.bak +inplace2bcomp:: + @echo $@ + @cp "$(srcdir)"/inplace.1.in _$@.1 + @cp "$(srcdir)"/inplace.2.in _$@.2 + @AWKPATH="$(srcdir)"/../awklib/eg/lib $(AWK) -i inplace -v INPLACE_SUFFIX=.orig 'BEGIN {print "before"} {gsub(/foo/, "bar"); print} END {print "after"}' _$@.1 - _$@.2 < "$(srcdir)"/inplace.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(CMP) "$(srcdir)"/$@.1.ok _$@.1 && rm -f _$@.1 + @-$(CMP) "$(srcdir)"/$@.1.orig.ok _$@.1.orig && rm -f _$@.1.orig + @-$(CMP) "$(srcdir)"/$@.2.ok _$@.2 && rm -f _$@.2 + @-$(CMP) "$(srcdir)"/$@.2.orig.ok _$@.2.orig && rm -f _$@.2.orig + inplace3:: @echo $@ @cp "$(srcdir)"/inplace.1.in _$@.1 @@ -2147,6 +2168,18 @@ inplace3:: @-$(CMP) "$(srcdir)"/$@.2.ok _$@.2 && rm -f _$@.2 @-$(CMP) "$(srcdir)"/$@.2.bak.ok _$@.2.bak && rm -f _$@.2.bak +inplace3bcomp:: + @echo $@ + @cp "$(srcdir)"/inplace.1.in _$@.1 + @cp "$(srcdir)"/inplace.2.in _$@.2 + @AWKPATH="$(srcdir)"/../awklib/eg/lib $(AWK) -i inplace -v INPLACE_SUFFIX=.orig 'BEGIN {print "before"} {gsub(/foo/, "bar"); print} END {print "after"}' _$@.1 - _$@.2 < "$(srcdir)"/inplace.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @AWKPATH="$(srcdir)"/../awklib/eg/lib $(AWK) -i inplace -v INPLACE_SUFFIX=.orig 'BEGIN {print "Before"} {gsub(/bar/, "foo"); print} END {print "After"}' _$@.1 - _$@.2 < "$(srcdir)"/inplace.in >>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(CMP) "$(srcdir)"/$@.1.ok _$@.1 && rm -f _$@.1 + @-$(CMP) "$(srcdir)"/$@.1.orig.ok _$@.1.orig && rm -f _$@.1.orig + @-$(CMP) "$(srcdir)"/$@.2.ok _$@.2 && rm -f _$@.2 + @-$(CMP) "$(srcdir)"/$@.2.orig.ok _$@.2.orig && rm -f _$@.2.orig + testext:: @echo $@ @$(AWK) ' /^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk diff --git a/test/Makefile.in b/test/Makefile.in index 53827516..3c18b260 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -825,11 +825,21 @@ EXTRA_DIST = \ inplace2.1.bak.ok \ inplace2.2.ok \ inplace2.2.bak.ok \ + inplace2bcomp.1.ok \ + inplace2bcomp.1.orig.ok \ + inplace2bcomp.2.ok \ + inplace2bcomp.2.orig.ok \ + inplace2bcomp.ok \ inplace3.ok \ inplace3.1.ok \ inplace3.1.bak.ok \ inplace3.2.ok \ inplace3.2.bak.ok \ + inplace3bcomp.1.ok \ + inplace3bcomp.1.orig.ok \ + inplace3bcomp.2.ok \ + inplace3bcomp.2.orig.ok \ + inplace3bcomp.ok \ inputred.awk \ inputred.ok \ intarray.awk \ @@ -1648,7 +1658,7 @@ SHLIB_TESTS = \ apiterm \ filefuncs fnmatch fork fork2 fts functab4 \ getfile \ - inplace1 inplace2 inplace3 \ + inplace1 inplace2 inplace2bcomp inplace3 inplace3bcomp \ ordchr ordchr2 \ readdir readdir_test readdir_retest readfile readfile2 revout \ revtwoway rwarray \ @@ -2584,6 +2594,17 @@ inplace2:: @-$(CMP) "$(srcdir)"/$@.2.ok _$@.2 && rm -f _$@.2 @-$(CMP) "$(srcdir)"/$@.2.bak.ok _$@.2.bak && rm -f _$@.2.bak +inplace2bcomp:: + @echo $@ + @cp "$(srcdir)"/inplace.1.in _$@.1 + @cp "$(srcdir)"/inplace.2.in _$@.2 + @AWKPATH="$(srcdir)"/../awklib/eg/lib $(AWK) -i inplace -v INPLACE_SUFFIX=.orig 'BEGIN {print "before"} {gsub(/foo/, "bar"); print} END {print "after"}' _$@.1 - _$@.2 < "$(srcdir)"/inplace.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(CMP) "$(srcdir)"/$@.1.ok _$@.1 && rm -f _$@.1 + @-$(CMP) "$(srcdir)"/$@.1.orig.ok _$@.1.orig && rm -f _$@.1.orig + @-$(CMP) "$(srcdir)"/$@.2.ok _$@.2 && rm -f _$@.2 + @-$(CMP) "$(srcdir)"/$@.2.orig.ok _$@.2.orig && rm -f _$@.2.orig + inplace3:: @echo $@ @cp "$(srcdir)"/inplace.1.in _$@.1 @@ -2596,6 +2617,18 @@ inplace3:: @-$(CMP) "$(srcdir)"/$@.2.ok _$@.2 && rm -f _$@.2 @-$(CMP) "$(srcdir)"/$@.2.bak.ok _$@.2.bak && rm -f _$@.2.bak +inplace3bcomp:: + @echo $@ + @cp "$(srcdir)"/inplace.1.in _$@.1 + @cp "$(srcdir)"/inplace.2.in _$@.2 + @AWKPATH="$(srcdir)"/../awklib/eg/lib $(AWK) -i inplace -v INPLACE_SUFFIX=.orig 'BEGIN {print "before"} {gsub(/foo/, "bar"); print} END {print "after"}' _$@.1 - _$@.2 < "$(srcdir)"/inplace.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @AWKPATH="$(srcdir)"/../awklib/eg/lib $(AWK) -i inplace -v INPLACE_SUFFIX=.orig 'BEGIN {print "Before"} {gsub(/bar/, "foo"); print} END {print "After"}' _$@.1 - _$@.2 < "$(srcdir)"/inplace.in >>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + @-$(CMP) "$(srcdir)"/$@.1.ok _$@.1 && rm -f _$@.1 + @-$(CMP) "$(srcdir)"/$@.1.orig.ok _$@.1.orig && rm -f _$@.1.orig + @-$(CMP) "$(srcdir)"/$@.2.ok _$@.2 && rm -f _$@.2 + @-$(CMP) "$(srcdir)"/$@.2.orig.ok _$@.2.orig && rm -f _$@.2.orig + testext:: @echo $@ @$(AWK) ' /^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk diff --git a/test/inplace2bcomp.1.ok b/test/inplace2bcomp.1.ok new file mode 100644 index 00000000..8faa542e --- /dev/null +++ b/test/inplace2bcomp.1.ok @@ -0,0 +1,2 @@ +is bar replaced? +and again bar here? diff --git a/test/inplace2bcomp.1.orig.ok b/test/inplace2bcomp.1.orig.ok new file mode 100644 index 00000000..d87f79a1 --- /dev/null +++ b/test/inplace2bcomp.1.orig.ok @@ -0,0 +1,2 @@ +is foo replaced? +and again foo here? diff --git a/test/inplace2bcomp.2.ok b/test/inplace2bcomp.2.ok new file mode 100644 index 00000000..64427be3 --- /dev/null +++ b/test/inplace2bcomp.2.ok @@ -0,0 +1,2 @@ +another input file containing bar and bar and more bar +but nothing to replace here diff --git a/test/inplace2bcomp.2.orig.ok b/test/inplace2bcomp.2.orig.ok new file mode 100644 index 00000000..4644a915 --- /dev/null +++ b/test/inplace2bcomp.2.orig.ok @@ -0,0 +1,2 @@ +another input file containing foo and foo and more foo +but nothing to replace here diff --git a/test/inplace2bcomp.ok b/test/inplace2bcomp.ok new file mode 100644 index 00000000..f2e36d46 --- /dev/null +++ b/test/inplace2bcomp.ok @@ -0,0 +1,6 @@ +before +gawk: inplace:59: warning: inplace::begin: disabling in-place editing for invalid FILENAME `-' +stdin start +is bar replaced? +stdin end +after diff --git a/test/inplace3bcomp.1.ok b/test/inplace3bcomp.1.ok new file mode 100644 index 00000000..d87f79a1 --- /dev/null +++ b/test/inplace3bcomp.1.ok @@ -0,0 +1,2 @@ +is foo replaced? +and again foo here? diff --git a/test/inplace3bcomp.1.orig.ok b/test/inplace3bcomp.1.orig.ok new file mode 100644 index 00000000..8faa542e --- /dev/null +++ b/test/inplace3bcomp.1.orig.ok @@ -0,0 +1,2 @@ +is bar replaced? +and again bar here? diff --git a/test/inplace3bcomp.2.ok b/test/inplace3bcomp.2.ok new file mode 100644 index 00000000..4644a915 --- /dev/null +++ b/test/inplace3bcomp.2.ok @@ -0,0 +1,2 @@ +another input file containing foo and foo and more foo +but nothing to replace here diff --git a/test/inplace3bcomp.2.orig.ok b/test/inplace3bcomp.2.orig.ok new file mode 100644 index 00000000..64427be3 --- /dev/null +++ b/test/inplace3bcomp.2.orig.ok @@ -0,0 +1,2 @@ +another input file containing bar and bar and more bar +but nothing to replace here diff --git a/test/inplace3bcomp.ok b/test/inplace3bcomp.ok new file mode 100644 index 00000000..b6f26505 --- /dev/null +++ b/test/inplace3bcomp.ok @@ -0,0 +1,12 @@ +before +gawk: inplace:59: warning: inplace::begin: disabling in-place editing for invalid FILENAME `-' +stdin start +is bar replaced? +stdin end +after +Before +gawk: inplace:59: warning: inplace::begin: disabling in-place editing for invalid FILENAME `-' +stdin start +is foo replaced? +stdin end +After |