diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/Makefile.am | 4 | ||||
-rw-r--r-- | test/Makefile.in | 9 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/status-close.awk | 14 | ||||
-rw-r--r-- | test/status-close.ok | 6 |
6 files changed, 41 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 08196ead..f159be72 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2016-07-23 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (status-close): New test. + * status-close.awk, status-close.ok: New files. + 2015-06-17 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (ofmtstrnum): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 5fa153eb..40636acd 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -997,6 +997,8 @@ EXTRA_DIST = \ sprintfc.awk \ sprintfc.in \ sprintfc.ok \ + status-close.awk \ + status-close.ok \ strcat1.awk \ strcat1.ok \ strftime.awk \ @@ -1173,7 +1175,7 @@ BASIC_TESTS = \ reparse resplit rri1 rs rscompat rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin sigpipe1 sortempty sortglos splitargv splitarr splitdef \ - splitvar splitwht strcat1 strnum1 strnum2 strtod subamp subback subi18n \ + splitvar splitwht status-close strcat1 strnum1 strnum2 strtod subamp subback subi18n \ subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \ uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \ wideidx wideidx2 widesub widesub2 widesub3 widesub4 wjposer1 \ diff --git a/test/Makefile.in b/test/Makefile.in index 900054f7..beb2af2d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1254,6 +1254,8 @@ EXTRA_DIST = \ sprintfc.awk \ sprintfc.in \ sprintfc.ok \ + status-close.awk \ + status-close.ok \ strcat1.awk \ strcat1.ok \ strftime.awk \ @@ -1429,7 +1431,7 @@ BASIC_TESTS = \ reparse resplit rri1 rs rscompat rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \ rstest3 rstest4 rstest5 rswhite \ scalar sclforin sclifin sigpipe1 sortempty sortglos splitargv splitarr splitdef \ - splitvar splitwht strcat1 strnum1 strnum2 strtod subamp subback subi18n \ + splitvar splitwht status-close strcat1 strnum1 strnum2 strtod subamp subback subi18n \ subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \ uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \ wideidx wideidx2 widesub widesub2 widesub3 widesub4 wjposer1 \ @@ -3655,6 +3657,11 @@ splitwht: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +status-close: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + strcat1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 16586ae9..d9b4fe09 100644 --- a/test/Maketests +++ b/test/Maketests @@ -897,6 +897,11 @@ splitwht: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +status-close: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + strcat1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/status-close.awk b/test/status-close.awk new file mode 100644 index 00000000..345bea49 --- /dev/null +++ b/test/status-close.awk @@ -0,0 +1,14 @@ +BEGIN { + cat = "cat ; exit 3" + print system("echo xxx | (cat ; exit 4)") + + print "YYY" | cat + + print close(cat) + + echo = "echo boo ; exit 5" + echo | getline boo + print "got", boo + + print close(echo) +} diff --git a/test/status-close.ok b/test/status-close.ok new file mode 100644 index 00000000..ad3c0ce1 --- /dev/null +++ b/test/status-close.ok @@ -0,0 +1,6 @@ +xxx +4 +YYY +3 +got boo +5 |