aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2020-10-01 08:25:21 +0300
committerArnold D. Robbins <arnold@skeeve.com>2020-10-01 08:25:21 +0300
commit2ab1c82b4097cff8763d1ed63be6478edf55eb54 (patch)
tree2ef139df749b57cc41fd607bc366b0ecdb4ee2ac
parent2a9ffa8555af0543638cf8466d5f29d7ff1d275e (diff)
downloadegawk-2ab1c82b4097cff8763d1ed63be6478edf55eb54.tar.gz
egawk-2ab1c82b4097cff8763d1ed63be6478edf55eb54.tar.bz2
egawk-2ab1c82b4097cff8763d1ed63be6478edf55eb54.zip
Improve iolint test.
-rw-r--r--pc/ChangeLog4
-rw-r--r--pc/Makefile.tst3
-rw-r--r--test/ChangeLog6
-rw-r--r--test/Makefile.am3
-rw-r--r--test/Makefile.in3
-rw-r--r--test/iolint.awk13
-rw-r--r--test/iolint.ok12
7 files changed, 29 insertions, 15 deletions
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 428ba03f..2c38352a 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2020-10-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.tst: Rebuilt.
+
2020-09-21 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.tst: Rebuilt.
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index a09b8d1e..6db70e10 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -1233,9 +1233,10 @@ typedregex4:
iolint:
@echo $@
@echo hello > 'echo hello'
+ @touch 'exec cat' ; chmod 755 'exec cat'
@$(AWK) -f "$(srcdir)"/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
- @-$(RM) -f cat 'echo hello' f1 f2 md5sum
+ @-$(RM) -f cat 'echo hello' 'exec cat' f1 f2 md5sum
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
diff --git a/test/ChangeLog b/test/ChangeLog
index eb3899ca..8563e076 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,9 @@
+2020-10-01 Arnold D. Robbins <arnold@skeeve.com>
+
+ * iolint.awk, iolint.ok: Adjust output to cat for exit status
+ portability. Thanks to Andrew Schorr for finding the issue.
+ * Makefile.am (iolint): Adjust scaffolding around the test.
+
2020-09-21 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (EXTRA_DIST): New test iolint. Sort the list of
diff --git a/test/Makefile.am b/test/Makefile.am
index ff2ba120..662fdfb6 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -2453,9 +2453,10 @@ typedregex4:
iolint:
@echo $@
@echo hello > 'echo hello'
+ @touch 'exec cat' ; chmod 755 'exec cat'
@$(AWK) -f "$(srcdir)"/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
- @-$(RM) -f cat 'echo hello' f1 f2 md5sum
+ @-$(RM) -f cat 'echo hello' 'exec cat' f1 f2 md5sum
# Targets generated for other tests:
include Maketests
diff --git a/test/Makefile.in b/test/Makefile.in
index a8848e85..9a48a003 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -2900,9 +2900,10 @@ typedregex4:
iolint:
@echo $@
@echo hello > 'echo hello'
+ @touch 'exec cat' ; chmod 755 'exec cat'
@$(AWK) -f "$(srcdir)"/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
- @-$(RM) -f cat 'echo hello' f1 f2 md5sum
+ @-$(RM) -f cat 'echo hello' 'exec cat' f1 f2 md5sum
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
diff --git a/test/iolint.awk b/test/iolint.awk
index e7408151..b6c8eeb4 100644
--- a/test/iolint.awk
+++ b/test/iolint.awk
@@ -54,12 +54,13 @@ BEGIN {
# `%.*s' used for output file and output pipe
# `%.*s' used for output file and two-way pipe
# `%.*s' used for output pipe and two-way pipe
- print "hello" > "cat"
- print "hello" | "cat"
- print "hello" |& "cat"
- print close("cat")
- print close("cat")
- print close("cat")
+ 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)
fflush()
# `%.*s' used for input pipe and output pipe
diff --git a/test/iolint.ok b/test/iolint.ok
index 1e325aab..873b0244 100644
--- a/test/iolint.ok
+++ b/test/iolint.ok
@@ -23,15 +23,15 @@ b1946ac92492d2347c6235b4d2611184 -
gawk: ./iolint.awk:49: warning: `echo hello' used for input pipe and output file
0
0
-gawk: ./iolint.awk:58: warning: `cat' used for output file and output pipe
-gawk: ./iolint.awk:59: warning: `cat' used for output pipe and two-way pipe
-gawk: ./iolint.awk:59: warning: `cat' used for output file and two-way pipe
+gawk: ./iolint.awk:59: warning: `exec cat' used for output file and output pipe
+gawk: ./iolint.awk:60: warning: `exec cat' used for output pipe and two-way pipe
+gawk: ./iolint.awk:60: warning: `exec cat' used for output file and two-way pipe
hello
-gawk: ./iolint.awk:60: warning: failure status (141) on two-way pipe close of `cat': Success
-141
+gawk: ./iolint.awk:61: warning: failure status (269) on two-way pipe close of `exec cat': Success
+269
0
0
-gawk: ./iolint.awk:67: warning: `echo hello' used for input pipe and output pipe
+gawk: ./iolint.awk:68: warning: `echo hello' used for input pipe and output pipe
hello
0
0