diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-02-08 19:50:27 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-02-08 19:50:27 +0200 |
commit | 34c33ee0f9d3863f9ef381e499e396c9f447a941 (patch) | |
tree | ac2f262b486cd81f4a7499708fad40396da8ff65 | |
parent | 2f9c84e82632cbce017a6d342acb3dede5e59e12 (diff) | |
download | egawk-34c33ee0f9d3863f9ef381e499e396c9f447a941.tar.gz egawk-34c33ee0f9d3863f9ef381e499e396c9f447a941.tar.bz2 egawk-34c33ee0f9d3863f9ef381e499e396c9f447a941.zip |
Add tests for non fatal i/o.
-rw-r--r-- | test/ChangeLog | 6 | ||||
-rw-r--r-- | test/Makefile.am | 5 | ||||
-rw-r--r-- | test/Makefile.in | 15 | ||||
-rw-r--r-- | test/Maketests | 10 | ||||
-rw-r--r-- | test/nonfatal1.awk | 5 | ||||
-rw-r--r-- | test/nonfatal1.ok | 2 | ||||
-rw-r--r-- | test/nonfatal2.awk | 5 | ||||
-rw-r--r-- | test/nonfatal2.ok | 1 |
8 files changed, 49 insertions, 0 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 2787b909..bff1d808 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2015-02-06 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (nonfatal1, nonfatal2): New tests. + * nonfatal1.awk, nonfatal1.ok: New files. + * nonfatal2.awk, nonfatal2.ok: New files. + 2014-12-24 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (badbuild): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 7335da32..802a3551 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -595,6 +595,10 @@ EXTRA_DIST = \ nondec.ok \ nondec2.awk \ nondec2.ok \ + nonfatal1.awk \ + nonfatal1.ok \ + nonfatal2.awk \ + nonfatal2.ok \ nonl.awk \ nonl.ok \ noparms.awk \ @@ -1028,6 +1032,7 @@ GAWK_EXT_TESTS = \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ + nonfatal1 nonfatal2 \ patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \ profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ diff --git a/test/Makefile.in b/test/Makefile.in index fa86fc7f..70dd1f4e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -842,6 +842,10 @@ EXTRA_DIST = \ nondec.ok \ nondec2.awk \ nondec2.ok \ + nonfatal1.awk \ + nonfatal1.ok \ + nonfatal2.awk \ + nonfatal2.ok \ nonl.awk \ nonl.ok \ noparms.awk \ @@ -1274,6 +1278,7 @@ GAWK_EXT_TESTS = \ lint lintold lintwarn \ manyfiles match1 match2 match3 mbstr1 \ nastyparm next nondec nondec2 \ + nonfatal1 nonfatal2 \ patsplit posix printfbad1 printfbad2 printfbad3 printhuge procinfs \ profile1 profile2 profile3 profile4 profile5 profile6 profile7 pty1 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ @@ -3568,6 +3573,16 @@ nondec: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +nonfatal1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nonfatal2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + patsplit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index e1b92bf9..08085a0f 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1137,6 +1137,16 @@ nondec: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +nonfatal1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +nonfatal2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + patsplit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/nonfatal1.awk b/test/nonfatal1.awk new file mode 100644 index 00000000..83661284 --- /dev/null +++ b/test/nonfatal1.awk @@ -0,0 +1,5 @@ +BEGIN { + PROCINFO["nonfatal"] + print |& "/inet/tcp/0/ti10/357" + print ERRNO +} diff --git a/test/nonfatal1.ok b/test/nonfatal1.ok new file mode 100644 index 00000000..b96b8e27 --- /dev/null +++ b/test/nonfatal1.ok @@ -0,0 +1,2 @@ +gawk: nonfatal1.awk:3: fatal: remote host and port information (ti10, 357) invalid +EXIT CODE: 2 diff --git a/test/nonfatal2.awk b/test/nonfatal2.awk new file mode 100644 index 00000000..f5db71c5 --- /dev/null +++ b/test/nonfatal2.awk @@ -0,0 +1,5 @@ +BEGIN { + PROCINFO["nonfatal"] = 1 + print > "/dev/no/such/file" + print ERRNO +} diff --git a/test/nonfatal2.ok b/test/nonfatal2.ok new file mode 100644 index 00000000..ddc88691 --- /dev/null +++ b/test/nonfatal2.ok @@ -0,0 +1 @@ +No such file or directory |