aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-10-17 22:04:42 +0300
committerArnold D. Robbins <arnold@skeeve.com>2013-10-17 22:04:42 +0300
commiteb152bbe507aef92ece4a301863263818fb50a04 (patch)
tree15679ae15d5b385adb039b537f88b04df718b592 /test
parentc3f03fe1d5a7c1b2c7b8ff843afc506ce2a45811 (diff)
downloadegawk-eb152bbe507aef92ece4a301863263818fb50a04.tar.gz
egawk-eb152bbe507aef92ece4a301863263818fb50a04.tar.bz2
egawk-eb152bbe507aef92ece4a301863263818fb50a04.zip
Catch SIGPIPE.
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am6
-rw-r--r--test/Makefile.in11
-rw-r--r--test/Maketests5
-rw-r--r--test/pipeio3.awk15
-rw-r--r--test/pipeio3.ok6
5 files changed, 39 insertions, 4 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index d0caeed7..abb3fb96 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -653,6 +653,8 @@ EXTRA_DIST = \
pipeio2.awk \
pipeio2.in \
pipeio2.ok \
+ pipeio3.awk \
+ pipeio3.ok \
posix.awk \
posix.in \
posix.ok \
@@ -972,8 +974,8 @@ BASIC_TESTS = \
zero2 zeroe0 zeroflag
UNIX_TESTS = \
- fflush getlnhd localenl pid pipeio1 pipeio2 poundbang rtlen rtlen01 \
- space strftlng
+ fflush getlnhd localenl pid pipeio1 pipeio2 pipeio3 poundbang \
+ rtlen rtlen01 space strftlng
GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \
diff --git a/test/Makefile.in b/test/Makefile.in
index 5ddd9e32..9676494d 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -871,6 +871,8 @@ EXTRA_DIST = \
pipeio2.awk \
pipeio2.in \
pipeio2.ok \
+ pipeio3.awk \
+ pipeio3.ok \
posix.awk \
posix.in \
posix.ok \
@@ -1189,8 +1191,8 @@ BASIC_TESTS = \
zero2 zeroe0 zeroflag
UNIX_TESTS = \
- fflush getlnhd localenl pid pipeio1 pipeio2 poundbang rtlen rtlen01 \
- space strftlng
+ fflush getlnhd localenl pid pipeio1 pipeio2 pipeio3 poundbang \
+ rtlen rtlen01 space strftlng
GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \
@@ -3182,6 +3184,11 @@ getlnhd:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+pipeio3:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
aadelete1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index df272ce8..29f9a17c 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -907,6 +907,11 @@ getlnhd:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+pipeio3:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
aadelete1:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/pipeio3.awk b/test/pipeio3.awk
new file mode 100644
index 00000000..a1cd3743
--- /dev/null
+++ b/test/pipeio3.awk
@@ -0,0 +1,15 @@
+BEGIN {
+ outputCommand = "cart"
+ inputCommand = "ls"
+
+ print "doing first print" > "/dev/stderr"
+ print "hello" | outputCommand
+
+ print "doing first getline" > "/dev/stderr"
+ inputCommand | getline
+
+ print "doing second print" > "/dev/stderr"
+ print "hello" | outputCommand
+
+ print "made it here" > "/dev/stderr"
+}
diff --git a/test/pipeio3.ok b/test/pipeio3.ok
new file mode 100644
index 00000000..17a08e9c
--- /dev/null
+++ b/test/pipeio3.ok
@@ -0,0 +1,6 @@
+doing first print
+doing first getline
+sh: 1: cart: not found
+doing second print
+gawk: pipeio3.awk:12: fatal: print to "cart" failed (Broken pipe)
+EXIT CODE: 2