aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2021-05-10 21:36:23 +0300
committerArnold D. Robbins <arnold@skeeve.com>2021-05-10 21:36:23 +0300
commitffef5abf2023140a106fd894565dae1abad77a15 (patch)
tree0bb4aa9789b42e95dca03e232bfe2efa7b4d6537 /test
parent110e88df64d96ec8d0b9a1eeea0d1d18d1de289f (diff)
parent229c965beec283952be89b889b5c407ccf620ace (diff)
downloadegawk-ffef5abf2023140a106fd894565dae1abad77a15.tar.gz
egawk-ffef5abf2023140a106fd894565dae1abad77a15.tar.bz2
egawk-ffef5abf2023140a106fd894565dae1abad77a15.zip
Merge branch 'master' into feature/bool
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog26
-rw-r--r--test/Makefile.am24
-rw-r--r--test/Makefile.in24
-rw-r--r--test/argcasfile.ok6
-rw-r--r--test/iolint.awk20
-rw-r--r--test/iolint.ok10
6 files changed, 67 insertions, 43 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 7966fcf0..6a4d8bd1 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,29 @@
+2021-05-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * argcasfile.ok: Add the leading space in the argument; see
+ pc/ChangeLog for explanation why.
+
+ General:
+ - Don't use egrep -q, not portable to Solaris 10.
+ - Use $(CMP) instead of cmp.
+
+ * iolint.awk: Change order so can use plain 'cat' instead of
+ 'exec cat'. Makes it available for MinGW.
+ * iolint.ok: Update after code changes.
+ * Makefile.am (iolint): Update shell recipe.
+
+2021-05-09 Eli Zaretskii <eliz@gnu.org>
+
+ * Makefile.am (EXPECTED_FAIL_MINGW): Update for the new tests.
+
+ * argcasfile.ok: Adjust for the leading space in the argument; see
+ pc/ChangeLog for explanation why.
+
+2021-05-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * iolint.awk: Use cksum instead of md5sum, for better portability.
+ * iolint.ok: Adjusted.
+
2021-05-05 Arnold D. Robbins <arnold@skeeve.com>
* CMakeLists.txt: Removed.
diff --git a/test/Makefile.am b/test/Makefile.am
index b8fe1cb7..c7f5d108 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1572,9 +1572,10 @@ EXPECTED_FAIL_DJGPP = \
# List of tests that fail on MinGW
EXPECTED_FAIL_MINGW = \
backbigs1 backsmalls1 clos1way6 devfd devfd1 devfd2 \
- errno exitval2 fork fork2 fts getfile getlnhd ignrcas3 inetdayt \
- inetecht mbfw1 mbprintf1 mbprintf4 mbstr1 mbstr2 pid pipeio2 \
- pty1 pty2 readdir rstest4 rstest5 status-close timeout
+ errno exitval2 fmttest fork fork2 fts functab5 \
+ getfile getlnhd hsprint ignrcas3 inetdayt inetecht inf-nan-torture \
+ mbfw1 mbprintf1 mbprintf4 mbstr1 mbstr2 \
+ pid pipeio2 pty1 pty2 readdir rstest4 rstest5 status-close timeout
# List of tests that fail on z/OS
EXPECTED_FAIL_ZOS = \
@@ -2281,9 +2282,9 @@ testext::
@echo $@
@$(AWK) ' /^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk
@$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum'; \
- then cmp "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; \
- else cmp "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; fi
+ @-if echo "$$GAWK_TEST_ARGS" | egrep -e '-M|--bignum' > /dev/null; \
+ then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; \
+ else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; fi
getfile:
@echo $@
@@ -2421,9 +2422,9 @@ ignrcas3::
arrdbg:
@echo $@
@$(AWK) -v "okfile=./$@.ok" -v "mpfr_okfile=./$@-mpfr.ok" -f "$(srcdir)"/$@.awk | grep array_f >_$@ || echo EXIT CODE: $$? >> _$@
- @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum'; \
- then cmp "."/$@-mpfr.ok _$@ && rm -f _$@ $@.ok $@-mpfr.ok ; \
- else cmp "."/$@.ok _$@ && rm -f _$@ $@.ok $@-mpfr.ok ; fi
+ @-if echo "$$GAWK_TEST_ARGS" | egrep -e '-M|--bignum' > /dev/null; \
+ then $(CMP) "."/$@-mpfr.ok _$@ && rm -f _$@ $@.ok $@-mpfr.ok ; \
+ else $(CMP) "."/$@.ok _$@ && rm -f _$@ $@.ok $@-mpfr.ok ; fi
sourcesplit:
@echo $@
@@ -2479,14 +2480,13 @@ typedregex4:
iolint:
@echo $@
@echo hello > 'echo hello'
- @touch 'exec cat' ; chmod 755 'exec cat'
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
- @-$(RM) -f cat 'echo hello' 'exec cat' f1 f2 md5sum
+ @-$(RM) -f cat 'echo hello' f1 f2 cksum
argcasfile:
@echo $@
- @$(AWK) -f "$(srcdir)"/$@.awk ARGC=1 /no/such/file < "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @$(AWK) -f "$(srcdir)"/$@.awk ARGC=1 ' /no/such/file' < "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
# Targets generated for other tests:
diff --git a/test/Makefile.in b/test/Makefile.in
index ada72c07..75bf251e 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1836,9 +1836,10 @@ EXPECTED_FAIL_DJGPP = \
# List of tests that fail on MinGW
EXPECTED_FAIL_MINGW = \
backbigs1 backsmalls1 clos1way6 devfd devfd1 devfd2 \
- errno exitval2 fork fork2 fts getfile getlnhd ignrcas3 inetdayt \
- inetecht mbfw1 mbprintf1 mbprintf4 mbstr1 mbstr2 pid pipeio2 \
- pty1 pty2 readdir rstest4 rstest5 status-close timeout
+ errno exitval2 fmttest fork fork2 fts functab5 \
+ getfile getlnhd hsprint ignrcas3 inetdayt inetecht inf-nan-torture \
+ mbfw1 mbprintf1 mbprintf4 mbstr1 mbstr2 \
+ pid pipeio2 pty1 pty2 readdir rstest4 rstest5 status-close timeout
# List of tests that fail on z/OS
@@ -2733,9 +2734,9 @@ testext::
@echo $@
@$(AWK) ' /^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk
@$(AWK) -f ./testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
- @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum'; \
- then cmp "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; \
- else cmp "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; fi
+ @-if echo "$$GAWK_TEST_ARGS" | egrep -e '-M|--bignum' > /dev/null; \
+ then $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; \
+ else $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk testexttmp.txt ; fi
getfile:
@echo $@
@@ -2871,9 +2872,9 @@ ignrcas3::
arrdbg:
@echo $@
@$(AWK) -v "okfile=./$@.ok" -v "mpfr_okfile=./$@-mpfr.ok" -f "$(srcdir)"/$@.awk | grep array_f >_$@ || echo EXIT CODE: $$? >> _$@
- @-if echo "$$GAWK_TEST_ARGS" | egrep -q -e '-M|--bignum'; \
- then cmp "."/$@-mpfr.ok _$@ && rm -f _$@ $@.ok $@-mpfr.ok ; \
- else cmp "."/$@.ok _$@ && rm -f _$@ $@.ok $@-mpfr.ok ; fi
+ @-if echo "$$GAWK_TEST_ARGS" | egrep -e '-M|--bignum' > /dev/null; \
+ then $(CMP) "."/$@-mpfr.ok _$@ && rm -f _$@ $@.ok $@-mpfr.ok ; \
+ else $(CMP) "."/$@.ok _$@ && rm -f _$@ $@.ok $@-mpfr.ok ; fi
sourcesplit:
@echo $@
@@ -2926,14 +2927,13 @@ typedregex4:
iolint:
@echo $@
@echo hello > 'echo hello'
- @touch 'exec cat' ; chmod 755 'exec cat'
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
- @-$(RM) -f cat 'echo hello' 'exec cat' f1 f2 md5sum
+ @-$(RM) -f cat 'echo hello' f1 f2 cksum
argcasfile:
@echo $@
- @$(AWK) -f "$(srcdir)"/$@.awk ARGC=1 /no/such/file < "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @$(AWK) -f "$(srcdir)"/$@.awk ARGC=1 ' /no/such/file' < "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
diff --git a/test/argcasfile.ok b/test/argcasfile.ok
index 8b5d35b3..bdb69185 100644
--- a/test/argcasfile.ok
+++ b/test/argcasfile.ok
@@ -1,9 +1,9 @@
0 gawk
1 ARGC=1
-2 /no/such/file
+2 /no/such/file
0 gawk
1 ARGC=1
-2 /no/such/file
+2 /no/such/file
0 gawk
1 ARGC=1
-2 /no/such/file
+2 /no/such/file
diff --git a/test/iolint.awk b/test/iolint.awk
index 3f3bb22f..a866ed6d 100644
--- a/test/iolint.awk
+++ b/test/iolint.awk
@@ -38,10 +38,10 @@ BEGIN {
fflush()
# `%.*s' used for output file and output pipe"
- print "junk" > "md5sum"
- print "hello" | "md5sum"
- print close("md5sum")
- print close("md5sum")
+ print "junk" > "cksum" # cksum is more portable than md5sum
+ print "hello" | "cksum"
+ print close("cksum")
+ print close("cksum")
fflush()
# `%.*s' used for input pipe and output file
@@ -55,13 +55,11 @@ BEGIN {
# `%.*s' used for output file and two-way pipe
# `%.*s' used for output pipe and two-way pipe
# Not doing |& due to race condition and signals. sigh
- exec_cat = "exec cat"
- print "/bin/cat \"$@\"" > exec_cat
- print "hello" | exec_cat
- # print "hello" |& exec_cat
- print close(exec_cat)
- print close(exec_cat)
- # print close(exec_cat)
+ cat = "cat"
+ print "hello" | "cat"
+ print "/bin/cat \"$@\"" > "cat"
+ print close("cat")
+ print close("cat")
fflush()
# `%.*s' used for input pipe and output pipe
diff --git a/test/iolint.ok b/test/iolint.ok
index 70f1cd2b..0008b0aa 100644
--- a/test/iolint.ok
+++ b/test/iolint.ok
@@ -16,18 +16,18 @@ gawk: iolint.awk:35: warning: unnecessary mixing of `>' and `>>' for file `f2'
0
gawk: iolint.awk:37: warning: close: `f2' is not an open file, pipe or co-process
-1
-gawk: iolint.awk:42: warning: `md5sum' used for output file and output pipe
-b1946ac92492d2347c6235b4d2611184 -
+gawk: iolint.awk:42: warning: `cksum' used for output file and output pipe
+3015617425 6
0
0
gawk: iolint.awk:49: warning: `echo hello' used for input pipe and output file
0
0
-gawk: iolint.awk:60: warning: `exec cat' used for output file and output pipe
-hello
+gawk: iolint.awk:60: warning: `cat' used for output file and output pipe
0
+hello
0
-gawk: iolint.awk:69: warning: `echo hello' used for input pipe and output pipe
+gawk: iolint.awk:67: warning: `echo hello' used for input pipe and output pipe
hello
0
0