From a26ea21bba35f0118c7d5c4414c6f6c7fa74b16b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 29 Dec 2013 19:38:09 +0200 Subject: Enable compiling extensions on VMS. --- test/ChangeLog | 4 ++++ test/fts.awk | 24 +++++++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 378c6ae3..dd73cbc6 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2013-12-29 John E. Malmberg + + * fts.awk: Adjust for VMS. + 2013-12-10 Arnold D. Robbins * Makefile.am: Remove instances of "" that were incorrect. diff --git a/test/fts.awk b/test/fts.awk index a1b49cbd..d2e55cab 100644 --- a/test/fts.awk +++ b/test/fts.awk @@ -3,8 +3,19 @@ BEGIN { Level = 0 - system("rm -fr d1 d2") - system("mkdir d1 d2 ; touch d1/f1 d1/f2 d2/f1 d2/f2") + os = "" + if (ENVIRON["AWKLIBPATH"] == "sys$disk:[-]") { + os = "VMS" + system("create/dir/prot=o:rwed [.d1]") + system("create/dir/prot=o:rwed [.d2]") + system("copy fts.awk [.d1]f1") + system("copy fts.awk [.d1]f2") + system("copy fts.awk [.d2]f1") + system("copy fts.awk [.d2]f2") + } else { + system("rm -fr d1 d2") + system("mkdir d1 d2 ; touch d1/f1 d1/f2 d2/f1 d2/f2") + } pathlist[1] = "d1" pathlist[2] = "d2" flags = FTS_PHYSICAL @@ -19,7 +30,14 @@ BEGIN { traverse(data2) close(output) - system("rm -fr d1 d2") + if (os == "VMS") { + system("delete [.d1]*.*;*") + system("delete [.d2]*.*;*") + system("delete d1.dir;*") + system("delete d2.dir;*") + } else { + system("rm -fr d1 d2") + } } function indent( i) -- cgit v1.2.3 From dad5f25058c4ecf69ebe4543a13281d3f28c69bc Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 30 Dec 2013 21:52:45 +0200 Subject: Build and test dynamic extensions on VMS. Documented too. --- test/ChangeLog | 1 + test/fts.awk | 7 +++++++ test/rwarray.awk | 25 ++++++++++++++++--------- 3 files changed, 24 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index dd73cbc6..cc81d9a4 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,6 +1,7 @@ 2013-12-29 John E. Malmberg * fts.awk: Adjust for VMS. + * rwarray.awk: Adjust for VMS. 2013-12-10 Arnold D. Robbins diff --git a/test/fts.awk b/test/fts.awk index d2e55cab..70af560f 100644 --- a/test/fts.awk +++ b/test/fts.awk @@ -114,6 +114,13 @@ function process(pathname, data_array, for (i in stat_data) data_array[pathname]["."]["stat"][i] = stat_data[i] + os = "" + if (ENVIRON["AWKLIBPATH"] == "sys$disk:[-]") { + os = "VMS" + # Command in next section not valid on VMS. + return + } + command = ("ls -f " pathname) while ((command | getline direntry) > 0) { if (direntry == "." || direntry == "..") diff --git a/test/rwarray.awk b/test/rwarray.awk index 5d1b7e9d..0cb214ee 100644 --- a/test/rwarray.awk +++ b/test/rwarray.awk @@ -21,13 +21,20 @@ BEGIN { printf("dict[%s] = %s\n", dictindices[i], dict[dictindices[i]]) > "new.out" close("new.out"); - ret = system("cmp orig.out new.out") - - if (ret == 0) - print "old and new are equal - GOOD" - else - print "old and new are not equal - BAD" - - if (ret == 0 && !("KEEPIT" in ENVIRON)) - system("rm -f orig.bin orig.out new.out") + os = "" + if (ENVIRON["AWKLIBPATH"] == "sys$disk:[-]") { + os = "VMS" + # return status from system() on VMS can not be used here + } + if (os != "VMS") { + ret = system("cmp orig.out new.out") + + if (ret == 0) + print "old and new are equal - GOOD" + else + print "old and new are not equal - BAD" + + if (ret == 0 && !("KEEPIT" in ENVIRON)) + system("rm -f orig.bin orig.out new.out") + } } -- cgit v1.2.3 From 6b76f3d292993fe2a15a515d078726cd68fd78d8 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 30 Dec 2013 22:02:32 +0200 Subject: Fix ignrcas2 test to use right locale. --- test/ChangeLog | 6 ++++++ test/Makefile.am | 2 +- test/Makefile.in | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 378c6ae3..c941f51c 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2013-12-30 Arnold D. Robbins + + * Makefile.am (ignrcas2): Change to use en_US.UTF-8; it + seems that plain en_US doesn't exist anymore. Thanks to + Richard Palo. + 2013-12-10 Arnold D. Robbins * Makefile.am: Remove instances of "" that were incorrect. diff --git a/test/Makefile.am b/test/Makefile.am index fb265747..371a13ea 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1452,7 +1452,7 @@ widesub4:: ignrcas2:: @echo $@ - @GAWKLOCALE=en_US ; export GAWKLOCALE ; \ + @GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \ $(AWK) -f "$(srcdir)"/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ diff --git a/test/Makefile.in b/test/Makefile.in index 421767b4..c2efe1ed 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1876,7 +1876,7 @@ widesub4:: ignrcas2:: @echo $@ - @GAWKLOCALE=en_US ; export GAWKLOCALE ; \ + @GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \ $(AWK) -f "$(srcdir)"/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ -- cgit v1.2.3 From c338576a8fefa700cb989319d10d27f6f31e9b00 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 14 Jan 2014 22:17:04 +0200 Subject: Bug fix to do_split(). --- test/ChangeLog | 6 ++++++ test/Makefile.am | 8 ++++++-- test/Makefile.in | 13 +++++++++++-- test/Maketests | 5 +++++ test/split_after_fpat.awk | 11 +++++++++++ test/split_after_fpat.in | 1 + test/split_after_fpat.ok | 4 ++++ 7 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 test/split_after_fpat.awk create mode 100644 test/split_after_fpat.in create mode 100644 test/split_after_fpat.ok (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 81fed7c8..b5ff6e64 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2014-01-14 Arnold D. Robbins + + * Makefile.am (split_after_fpat): New test. + * split_after_fpat.awk, split_after_fpat.ok, + split_after_fpat.in: New files. + 2013-12-30 Arnold D. Robbins * Makefile.am (ignrcas2): Change to use en_US.UTF-8; it diff --git a/test/Makefile.am b/test/Makefile.am index 371a13ea..e6dfea17 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,7 +1,7 @@ # # test/Makefile.am --- automake input file for gawk # -# Copyright (C) 1988-2012 the Free Software Foundation, Inc. +# Copyright (C) 1988-2014 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -806,6 +806,9 @@ EXTRA_DIST = \ sortu.awk \ sortu.ok \ space.ok \ + split_after_fpat.awk \ + split_after_fpat.in \ + split_after_fpat.ok \ splitarg4.awk \ splitarg4.in \ splitarg4.ok \ @@ -993,7 +996,8 @@ GAWK_EXT_TESTS = \ patsplit posix printfbad1 printfbad2 printfbad3 procinfs \ profile1 profile2 profile3 profile4 profile5 pty1 \ rebuf regx8bit reginttrad reint reint2 rsstart1 \ - rsstart2 rsstart3 rstest6 shadow sortfor sortu splitarg4 strftime \ + rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ + splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ symtab7 symtab8 symtab9 diff --git a/test/Makefile.in b/test/Makefile.in index c2efe1ed..8fe395ef 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -17,7 +17,7 @@ # # test/Makefile.am --- automake input file for gawk # -# Copyright (C) 1988-2012 the Free Software Foundation, Inc. +# Copyright (C) 1988-2014 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. @@ -1052,6 +1052,9 @@ EXTRA_DIST = \ sortu.awk \ sortu.ok \ space.ok \ + split_after_fpat.awk \ + split_after_fpat.in \ + split_after_fpat.ok \ splitarg4.awk \ splitarg4.in \ splitarg4.ok \ @@ -1238,7 +1241,8 @@ GAWK_EXT_TESTS = \ patsplit posix printfbad1 printfbad2 printfbad3 procinfs \ profile1 profile2 profile3 profile4 profile5 pty1 \ rebuf regx8bit reginttrad reint reint2 rsstart1 \ - rsstart2 rsstart3 rstest6 shadow sortfor sortu splitarg4 strftime \ + rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ + splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ symtab7 symtab8 symtab9 @@ -3497,6 +3501,11 @@ sortu: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +split_after_fpat: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + splitarg4: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index df272ce8..b9b713c4 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1182,6 +1182,11 @@ sortu: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +split_after_fpat: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + splitarg4: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/split_after_fpat.awk b/test/split_after_fpat.awk new file mode 100644 index 00000000..7e7cfd99 --- /dev/null +++ b/test/split_after_fpat.awk @@ -0,0 +1,11 @@ +BEGIN { FPAT = "\"[^\"]*\"" } + +{ print $1 } + +END { f("hi there") } + +function f (p, a, n, i) +{ + n = split(p,a) + print n ; for (i=1; i<=n; i++) print a[i] +} diff --git a/test/split_after_fpat.in b/test/split_after_fpat.in new file mode 100644 index 00000000..1aeefd59 --- /dev/null +++ b/test/split_after_fpat.in @@ -0,0 +1 @@ +a"stuff"b diff --git a/test/split_after_fpat.ok b/test/split_after_fpat.ok new file mode 100644 index 00000000..5c284490 --- /dev/null +++ b/test/split_after_fpat.ok @@ -0,0 +1,4 @@ +"stuff" +2 +hi +there -- cgit v1.2.3 From a0414ef0949eaf66c467abd5009790a6f339b164 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Thu, 16 Jan 2014 10:51:30 -0500 Subject: Fix strftime test race condition. --- test/ChangeLog | 10 ++++++++++ test/Makefile.am | 4 +--- test/Makefile.in | 4 +--- test/strftime.awk | 34 ++++++++++++++++++++++++++-------- 4 files changed, 38 insertions(+), 14 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index b5ff6e64..95f8fe17 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,13 @@ +2014-01-16 Andrew J. Schorr + + * Makefile.am (strftime): Remove comment about the race condition, since + this should be fixed. And gawk now calls date inside the script. + * strftime.awk: Based on an idea from Pat Ranking, fix the race + condition by looping repeatedly over strftime/date/strftime until + the before and after strftime results match. That should fix + the race condition where the seconds field might increment between + invocations. + 2014-01-14 Arnold D. Robbins * Makefile.am (split_after_fpat): New test. diff --git a/test/Makefile.am b/test/Makefile.am index e6dfea17..cb9bdc83 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1252,12 +1252,10 @@ nonl:: @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ strftime:: - @echo This test could fail on slow machines or on a minute boundary, - @echo so if it does, double check the actual results: @echo $@ @GAWKLOCALE=C; export GAWKLOCALE; \ TZ=GMT0; export TZ; \ - (LC_ALL=C date) | $(AWK) -v OUTPUT=_$@ -f "$(srcdir)"/strftime.awk + $(AWK) -v OUTPUT=_$@ -f "$(srcdir)"/strftime.awk @-$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0 litoct:: diff --git a/test/Makefile.in b/test/Makefile.in index 8fe395ef..fa0f6345 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1676,12 +1676,10 @@ nonl:: @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ strftime:: - @echo This test could fail on slow machines or on a minute boundary, - @echo so if it does, double check the actual results: @echo $@ @GAWKLOCALE=C; export GAWKLOCALE; \ TZ=GMT0; export TZ; \ - (LC_ALL=C date) | $(AWK) -v OUTPUT=_$@ -f "$(srcdir)"/strftime.awk + $(AWK) -v OUTPUT=_$@ -f "$(srcdir)"/strftime.awk @-$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0 litoct:: diff --git a/test/strftime.awk b/test/strftime.awk index 775cd4e5..a52957f0 100644 --- a/test/strftime.awk +++ b/test/strftime.awk @@ -2,18 +2,36 @@ # # input is the output of `date', see Makefile.in # -# The mucking about with $0 and $N is to avoid problems +# The mucking about with $0 and $NF is to avoid problems # on cygwin, where the timezone field is empty and there # are two consecutive blanks. -# Additional mucking about to lop off the seconds field; -# helps decrease chance of difference due to a second boundary +BEGIN { + maxtries = 10 + datecmd = "date" + fmt = "%a %b %d %H:%M:%S %Z %Y" -{ - $3 = sprintf("%02d", $3 + 0) - $4 = substr($4, 1, 5) - print > "strftime.ok" - $0 = strftime("%a %b %d %H:%M %Z %Y") + # loop until before equals after, thereby protecting + # against a race condition where the seconds field might have + # incremented between running date and strftime + i = 0 + while (1) { + if (++i > maxtries) { + printf "Warning: this system is so slow that after %d attempts, we could never get two sequential invocations of strftime to give the same result!\n", maxtries > "/dev/stderr" + break + } + before = strftime(fmt) + datecmd | getline sd + after = strftime(fmt) + close(datecmd) + if (before == after) { + if (i > 1) + printf "Notice: it took %d loops to get the before and after strftime values to match\n", i > "/dev/stderr" + break + } + } + print sd > "strftime.ok" + $0 = after $NF = $NF print > OUTPUT } -- cgit v1.2.3 From 132f956360d721fccf4f3829044f5f6eceac3ffd Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 17 Jan 2014 13:35:08 +0200 Subject: Quote $(top_srcdir) in test/Makefile.am. --- test/ChangeLog | 4 ++++ test/Makefile.am | 6 +++--- test/Makefile.in | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 95f8fe17..1da74f8a 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2014-01-17 Arnold D. Robbins + + * Makefile.am: Quote instances of $(top_srcdir) also. + 2014-01-16 Andrew J. Schorr * Makefile.am (strftime): Remove comment about the race condition, since diff --git a/test/Makefile.am b/test/Makefile.am index cb9bdc83..8f37d25b 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1800,7 +1800,7 @@ inplace3:: testext:: @echo $@ - @$(AWK) '/^(@load|BEGIN)/,/^}/' $(top_srcdir)/extension/testext.c > testext.awk + @$(AWK) '/^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk @$(AWK) -f testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk @@ -1810,8 +1810,8 @@ readdir: echo If it does, try rerunning on an ext'[234]' filesystem. ; \ fi @echo $@ - @$(AWK) -f "$(srcdir)"/readdir.awk $(top_srcdir) > _$@ - @ls -afli $(top_srcdir) | sed 1d | $(AWK) -f "$(srcdir)"/readdir0.awk -v extout=_$@ $(top_srcdir) > $@.ok + @$(AWK) -f "$(srcdir)"/readdir.awk "$(top_srcdir)" > _$@ + @ls -afli $"(top_srcdir)" | sed 1d | $(AWK) -f "$(srcdir)"/readdir0.awk -v extout=_$@ "$(top_srcdir)" > $@.ok @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@ fts: diff --git a/test/Makefile.in b/test/Makefile.in index fa0f6345..3108723f 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -2223,7 +2223,7 @@ inplace3:: testext:: @echo $@ - @$(AWK) '/^(@load|BEGIN)/,/^}/' $(top_srcdir)/extension/testext.c > testext.awk + @$(AWK) '/^(@load|BEGIN)/,/^}/' "$(top_srcdir)"/extension/testext.c > testext.awk @$(AWK) -f testext.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ testext.awk @@ -2233,8 +2233,8 @@ readdir: echo If it does, try rerunning on an ext'[234]' filesystem. ; \ fi @echo $@ - @$(AWK) -f "$(srcdir)"/readdir.awk $(top_srcdir) > _$@ - @ls -afli $(top_srcdir) | sed 1d | $(AWK) -f "$(srcdir)"/readdir0.awk -v extout=_$@ $(top_srcdir) > $@.ok + @$(AWK) -f "$(srcdir)"/readdir.awk "$(top_srcdir)" > _$@ + @ls -afli $"(top_srcdir)" | sed 1d | $(AWK) -f "$(srcdir)"/readdir0.awk -v extout=_$@ "$(top_srcdir)" > $@.ok @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@ fts: -- cgit v1.2.3 From 5163d771a34406de44889c9e297699d04af13308 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 17 Jan 2014 13:40:38 +0200 Subject: Fix typo from last change. --- test/Makefile.am | 2 +- test/Makefile.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/Makefile.am b/test/Makefile.am index 8f37d25b..5a0c5a63 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1811,7 +1811,7 @@ readdir: fi @echo $@ @$(AWK) -f "$(srcdir)"/readdir.awk "$(top_srcdir)" > _$@ - @ls -afli $"(top_srcdir)" | sed 1d | $(AWK) -f "$(srcdir)"/readdir0.awk -v extout=_$@ "$(top_srcdir)" > $@.ok + @ls -afli "$(top_srcdir)" | sed 1d | $(AWK) -f "$(srcdir)"/readdir0.awk -v extout=_$@ "$(top_srcdir)" > $@.ok @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@ fts: diff --git a/test/Makefile.in b/test/Makefile.in index 3108723f..d0d527f4 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -2234,7 +2234,7 @@ readdir: fi @echo $@ @$(AWK) -f "$(srcdir)"/readdir.awk "$(top_srcdir)" > _$@ - @ls -afli $"(top_srcdir)" | sed 1d | $(AWK) -f "$(srcdir)"/readdir0.awk -v extout=_$@ "$(top_srcdir)" > $@.ok + @ls -afli "$(top_srcdir)" | sed 1d | $(AWK) -f "$(srcdir)"/readdir0.awk -v extout=_$@ "$(top_srcdir)" > $@.ok @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@ fts: -- cgit v1.2.3 From 20ca1d1ba6e46f116e2dc169d263fd548b9bd074 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 19 Jan 2014 21:36:37 +0200 Subject: Fix -0 for MPFR. --- test/ChangeLog | 5 +++++ test/Makefile.am | 10 +++++++++- test/Makefile.in | 11 ++++++++++- test/mpfrnegzero.awk | 15 +++++++++++++++ test/mpfrnegzero.ok | 9 +++++++++ 5 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 test/mpfrnegzero.awk create mode 100644 test/mpfrnegzero.ok (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 1da74f8a..535f6f14 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-01-19 Arnold D. Robbins + + * Makefile.am (mpfrnegzero): New test. + * mpfrnegzero.awk, mpfrnegzero.ok: New files. + 2014-01-17 Arnold D. Robbins * Makefile.am: Quote instances of $(top_srcdir) also. diff --git a/test/Makefile.am b/test/Makefile.am index 5a0c5a63..b6390009 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -522,6 +522,8 @@ EXTRA_DIST = \ mpfrexprange.ok \ mpfrieee.awk \ mpfrieee.ok \ + mpfrnegzero.awk \ + mpfrnegzero.ok \ mpfrnr.awk \ mpfrnr.in \ mpfrnr.ok \ @@ -1007,7 +1009,8 @@ INET_TESTS = inetdayu inetdayt inetechu inetecht MACHINE_TESTS = double1 double2 fmtspcl intformat -MPFR_TESTS = mpfrnr mpfrrnd mpfrieee mpfrexprange mpfrsort mpfrbigint +MPFR_TESTS = mpfrnr mpfrnegzero mpfrrnd mpfrieee mpfrexprange \ + mpfrsort mpfrbigint LOCALE_CHARSET_TESTS = \ asort asorti backbigs1 backsmalls1 backsmalls2 \ @@ -1695,6 +1698,11 @@ mpfrrnd: @$(AWK) -M -vPREC=53 -f "$(srcdir)"/$@.awk > _$@ 2>&1 @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +mpfrnegzero: + @echo $@ + @$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1 + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + mpfrnr: @echo $@ @$(AWK) -M -vPREC=113 -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in > _$@ diff --git a/test/Makefile.in b/test/Makefile.in index d0d527f4..fd0484a8 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -768,6 +768,8 @@ EXTRA_DIST = \ mpfrexprange.ok \ mpfrieee.awk \ mpfrieee.ok \ + mpfrnegzero.awk \ + mpfrnegzero.ok \ mpfrnr.awk \ mpfrnr.in \ mpfrnr.ok \ @@ -1249,7 +1251,9 @@ GAWK_EXT_TESTS = \ EXTRA_TESTS = inftest regtest INET_TESTS = inetdayu inetdayt inetechu inetecht MACHINE_TESTS = double1 double2 fmtspcl intformat -MPFR_TESTS = mpfrnr mpfrrnd mpfrieee mpfrexprange mpfrsort mpfrbigint +MPFR_TESTS = mpfrnr mpfrnegzero mpfrrnd mpfrieee mpfrexprange \ + mpfrsort mpfrbigint + LOCALE_CHARSET_TESTS = \ asort asorti backbigs1 backsmalls1 backsmalls2 \ fmttest fnarydel fnparydl jarebug lc_num1 mbfw1 \ @@ -2118,6 +2122,11 @@ mpfrrnd: @$(AWK) -M -vPREC=53 -f "$(srcdir)"/$@.awk > _$@ 2>&1 @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +mpfrnegzero: + @echo $@ + @$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1 + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + mpfrnr: @echo $@ @$(AWK) -M -vPREC=113 -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in > _$@ diff --git a/test/mpfrnegzero.awk b/test/mpfrnegzero.awk new file mode 100644 index 00000000..cc6bf65b --- /dev/null +++ b/test/mpfrnegzero.awk @@ -0,0 +1,15 @@ +BEGIN { + printf("-0 -> %f, -0.0 -> %f\n", -0, -0.0) + + printf("atan2(+0, -0) = %f\n", atan2(+0, -0)) + printf("atan2(+0.0, -0.0) = %f\n", atan2(+0.0, -0.0)) + + printf("atan2(-0, -0) = %f\n", atan2(-0, -0)) + printf("atan2(-0.0, -0.0) = %f\n", atan2(-0.0, -0.0)) + + printf("atan2(+0, +0) = %f\n", atan2(+0, +0)) + printf("atan2(+0.0, +0.0) = %f\n", atan2(+0.0, +0.0)) + + printf("atan2(-0, +0) = %f\n", atan2(-0, +0)) + printf("atan2(-0.0, +0.0) = %f\n", atan2(-0.0, +0.0)) +} diff --git a/test/mpfrnegzero.ok b/test/mpfrnegzero.ok new file mode 100644 index 00000000..7af16292 --- /dev/null +++ b/test/mpfrnegzero.ok @@ -0,0 +1,9 @@ +-0 -> -0.000000, -0.0 -> -0.000000 +atan2(+0, -0) = 3.141593 +atan2(+0.0, -0.0) = 3.141593 +atan2(-0, -0) = -3.141593 +atan2(-0.0, -0.0) = -3.141593 +atan2(+0, +0) = 0.000000 +atan2(+0.0, +0.0) = 0.000000 +atan2(-0, +0) = -0.000000 +atan2(-0.0, +0.0) = -0.000000 -- cgit v1.2.3 From 93a1a268246ed72edc71381069ace49d52bf8fec Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 20 Jan 2014 21:50:24 +0200 Subject: Improve readdir test for MinGW. --- test/ChangeLog | 6 ++++++ test/Makefile.am | 7 +++++-- test/Makefile.in | 7 +++++-- test/readdir0.awk | 25 +++++++++++-------------- 4 files changed, 27 insertions(+), 18 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 535f6f14..d9ecfe5f 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -3,6 +3,12 @@ * Makefile.am (mpfrnegzero): New test. * mpfrnegzero.awk, mpfrnegzero.ok: New files. +2014-01-17 Arnold D. Robbins + + * Makefile.am (readdir): Run ls commands outside the awk script. + * readdir0.awk: Read ls results from files. Helps with MinGW. + Thanks to Eli Zaretskii for the problem report. + 2014-01-17 Arnold D. Robbins * Makefile.am: Quote instances of $(top_srcdir) also. diff --git a/test/Makefile.am b/test/Makefile.am index b6390009..ca39e0b8 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1819,8 +1819,11 @@ readdir: fi @echo $@ @$(AWK) -f "$(srcdir)"/readdir.awk "$(top_srcdir)" > _$@ - @ls -afli "$(top_srcdir)" | sed 1d | $(AWK) -f "$(srcdir)"/readdir0.awk -v extout=_$@ "$(top_srcdir)" > $@.ok - @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@ + @ls -afi "$(top_srcdir)" > _dirlist + @ls -lna "$(top_srcdir)" | sed 1d > _longlist + @$(AWK) -f "$(srcdir)"/readdir0.awk -v extout=_$@ \ + -v dirlist=_dirlist -v longlist=_longlist > $@.ok + @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@ _dirlist _longlist fts: @case `uname` in \ diff --git a/test/Makefile.in b/test/Makefile.in index fd0484a8..52fa49ef 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -2243,8 +2243,11 @@ readdir: fi @echo $@ @$(AWK) -f "$(srcdir)"/readdir.awk "$(top_srcdir)" > _$@ - @ls -afli "$(top_srcdir)" | sed 1d | $(AWK) -f "$(srcdir)"/readdir0.awk -v extout=_$@ "$(top_srcdir)" > $@.ok - @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@ + @ls -afi "$(top_srcdir)" > _dirlist + @ls -lna "$(top_srcdir)" | sed 1d > _longlist + @$(AWK) -f "$(srcdir)"/readdir0.awk -v extout=_$@ \ + -v dirlist=_dirlist -v longlist=_longlist > $@.ok + @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@ _dirlist _longlist fts: @case `uname` in \ diff --git a/test/readdir0.awk b/test/readdir0.awk index 296c03c7..2b7674a4 100644 --- a/test/readdir0.awk +++ b/test/readdir0.awk @@ -1,4 +1,9 @@ +# NOTE: This program is not a generalized parser for the output of 'ls'. +# It's job is to read the output of ls from the gawk source code directory, +# where we know there are no symbolic links, nor are there files with +# spaces in their file names, etc. BEGIN { + # analyze results from readdir extension while ((getline x < extout) > 0) { numrec++ if ((split(x, f, "/") == 3) && (f[3] == "u")) @@ -12,12 +17,7 @@ BEGIN { } BEGIN { - dir = ARGV[1] - delete ARGV[1] - ls_afi = "ls -afi " dir - ls_al = ("ls -lna " dir " | sed 1d") - - for (i = 1; (ls_afi | getline) > 0; i++) { + for (i = 1; (getline < dirlist) > 0; i++) { # inode number is $1, filename is read of record inode = $1 $1 = "" @@ -26,21 +26,18 @@ BEGIN { names[i] = $0 ino[names[i]] = inode } - close(ls_afi) + close(dirlist) - for (j = 1; (ls_al | getline) > 0; j++) { + for (j = 1; (getline < longlist) > 0; j++) { type_let = substr($0, 1, 1) if (type_let == "-") type_let = "f" - $1 = $2 = $3 = $4 = $5 = $6 = $7 = $8 = "" - $0 = $0 - sub(/^ */, "") - type[$0] = type_let + type[$NF] = type_let } - close(ls_al) + close(longlist) if (i != j) - printf("mismatch: %d from `ls -afi' and %d from `ls -l'\n", i, j) > "/dev/stderr" + printf("mismatch: %d from `ls -afi' and %d from `ls -lna'\n", i, j) > "/dev/stderr" for (i = 1; i in names; i++) printf("%s/%s/%s\n", ino[names[i]], names[i], (ftype_unknown ? "u" : type[names[i]])) -- cgit v1.2.3 From 6520f31b24575ce7308a8b42c8b617568db6c4d8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 28 Jan 2014 18:55:11 +0200 Subject: Fix the test suite for the pc ports. test/strftime.awk: If DATECMD variable is non-empty, use it instead of the literal "date" as the 'date'-like command. pc/Makefile.tst (strftime): Pass the value of 'date' command through the DATECMD variable. (readdir): Adapt to changes in test/readdir0.awk. --- test/ChangeLog | 5 +++++ test/strftime.awk | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index d9ecfe5f..ff57e6da 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-01-28 Eli Zaretskii + + * strftime.awk: If DATECMD variable is non-empty, use it instead + of the literal "date" as the 'date'-like command. + 2014-01-19 Arnold D. Robbins * Makefile.am (mpfrnegzero): New test. diff --git a/test/strftime.awk b/test/strftime.awk index a52957f0..73cdc698 100644 --- a/test/strftime.awk +++ b/test/strftime.awk @@ -8,7 +8,11 @@ BEGIN { maxtries = 10 - datecmd = "date" + # On DOS/Windows, DATECMD is set by the Makefile to point to + # Unix-like 'date' command. + datecmd = DATECMD + if (datecmd == "") + datecmd = "date" fmt = "%a %b %d %H:%M:%S %Z %Y" # loop until before equals after, thereby protecting -- cgit v1.2.3 From 5a1e957a2cda7d1f0062454a1c6caa4c835bd201 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 3 Feb 2014 21:04:18 +0200 Subject: Fix strftime test. --- test/ChangeLog | 9 ++++++++- test/strftime.awk | 10 ++-------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index ff57e6da..8a5945bc 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,4 +1,11 @@ -2014-01-28 Eli Zaretskii +2014-02-03 Stepan Kasal + + * strftime.awk: the default format uses %e, not %d (Introduced on + 2014-01-16; the previous code mangled the output of command "date" + to match %d.) Remove the "mucking" for cygwin, it's obsolete and + incompatible with %e. + +2014-01-28 Eli Zaretskii * strftime.awk: If DATECMD variable is non-empty, use it instead of the literal "date" as the 'date'-like command. diff --git a/test/strftime.awk b/test/strftime.awk index 73cdc698..f1276c15 100644 --- a/test/strftime.awk +++ b/test/strftime.awk @@ -1,10 +1,6 @@ # strftime.awk ; test the strftime code # # input is the output of `date', see Makefile.in -# -# The mucking about with $0 and $NF is to avoid problems -# on cygwin, where the timezone field is empty and there -# are two consecutive blanks. BEGIN { maxtries = 10 @@ -13,7 +9,7 @@ BEGIN { datecmd = DATECMD if (datecmd == "") datecmd = "date" - fmt = "%a %b %d %H:%M:%S %Z %Y" + fmt = "%a %b %e %H:%M:%S %Z %Y" # loop until before equals after, thereby protecting # against a race condition where the seconds field might have @@ -35,7 +31,5 @@ BEGIN { } } print sd > "strftime.ok" - $0 = after - $NF = $NF - print > OUTPUT + print after > OUTPUT } -- cgit v1.2.3 From 489a63923b753883500b8981b1fa578491d8f4ad Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 4 Feb 2014 06:23:53 +0200 Subject: Fix a spelling error in the ChangeLog. --- test/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 8a5945bc..18b912dd 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -29,7 +29,7 @@ * Makefile.am (strftime): Remove comment about the race condition, since this should be fixed. And gawk now calls date inside the script. - * strftime.awk: Based on an idea from Pat Ranking, fix the race + * strftime.awk: Based on an idea from Pat Rankin, fix the race condition by looping repeatedly over strftime/date/strftime until the before and after strftime results match. That should fix the race condition where the seconds field might increment between -- cgit v1.2.3 From 0b27d28fad7db725bb6a72c025c91ac39f5eeaf3 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 28 Feb 2014 14:22:43 +0200 Subject: Sync dfa with grep, update a test. --- test/ChangeLog | 4 ++++ test/regrange.ok | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 18b912dd..ab7ff0f2 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2014-02-28 Arnold D. Robbins + + * regrange.ok: Update after code improvements. + 2014-02-03 Stepan Kasal * strftime.awk: the default format uses %e, not %d (Introduced on diff --git a/test/regrange.ok b/test/regrange.ok index 1fa00c70..ae8c6499 100644 --- a/test/regrange.ok +++ b/test/regrange.ok @@ -3,4 +3,4 @@ "c" ~ /[[a-d]/ --> 1 "\" ~ /[\[-\]]/ --> 1 "[.c.]" ~ /[a-[.e.]]/ --> 1 -"[.d.]" ~ /[[.c.]-[.z.]]/ --> 0 +"[.d.]" ~ /[[.c.]-[.z.]]/ --> 1 -- cgit v1.2.3 From 4d396858eb897f2bb6d318b851a369ee92e50147 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 27 Mar 2014 22:49:58 +0200 Subject: Add input parser to readfile extension, document it and test it. --- test/ChangeLog | 5 +++++ test/Makefile.am | 8 +++++++- test/Makefile.in | 8 +++++++- test/readfile2.awk | 12 ++++++++++++ test/readfile2.ok | 21 +++++++++++++++++++++ 5 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 test/readfile2.awk create mode 100644 test/readfile2.ok (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index ab7ff0f2..f8d9f943 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-03-27 Arnold D. Robbins + + * Makefile.am (readfile2): New test. + * readfile2.awk, readfile2.ok: New files. + 2014-02-28 Arnold D. Robbins * regrange.ok: Update after code improvements. diff --git a/test/Makefile.am b/test/Makefile.am index ca39e0b8..d92f358e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -708,6 +708,7 @@ EXTRA_DIST = \ range1.ok \ readdir.awk \ readdir0.awk \ + readfile2.awk \ rebt8b1.awk \ rebt8b1.ok \ rebt8b2.awk \ @@ -1019,7 +1020,7 @@ LOCALE_CHARSET_TESTS = \ SHLIB_TESTS = \ fnmatch filefuncs fork fork2 fts functab4 inplace1 inplace2 inplace3 \ - ordchr ordchr2 readdir readfile revout revtwoway rwarray testext time + ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray testext time # List of the tests which should be run with --lint option: NEED_LINT = \ @@ -1734,6 +1735,11 @@ readfile:: @$(AWK) -l readfile 'BEGIN {printf "%s", readfile("Makefile")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) Makefile _$@ && rm -f _$@ || cp -p Makefile $@.ok +readfile2:: + @echo $@ + @$(AWK) -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.awk "$(srcdir)"/readdir.awk > _$@ || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + include2:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --include inclib 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Makefile.in b/test/Makefile.in index 52fa49ef..6e1bcbb3 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -954,6 +954,7 @@ EXTRA_DIST = \ range1.ok \ readdir.awk \ readdir0.awk \ + readfile2.awk \ rebt8b1.awk \ rebt8b1.ok \ rebt8b2.awk \ @@ -1261,7 +1262,7 @@ LOCALE_CHARSET_TESTS = \ SHLIB_TESTS = \ fnmatch filefuncs fork fork2 fts functab4 inplace1 inplace2 inplace3 \ - ordchr ordchr2 readdir readfile revout revtwoway rwarray testext time + ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray testext time # List of the tests which should be run with --lint option: @@ -2158,6 +2159,11 @@ readfile:: @$(AWK) -l readfile 'BEGIN {printf "%s", readfile("Makefile")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) Makefile _$@ && rm -f _$@ || cp -p Makefile $@.ok +readfile2:: + @echo $@ + @$(AWK) -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.awk "$(srcdir)"/readdir.awk > _$@ || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + include2:: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --include inclib 'BEGIN {print sandwich("a", "b", "c")}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/readfile2.awk b/test/readfile2.awk new file mode 100644 index 00000000..c21483fc --- /dev/null +++ b/test/readfile2.awk @@ -0,0 +1,12 @@ +@load "readfile" +BEGIN { PROCINFO["readfile"] = 1 } +BEGINFILE { print "Start of", basename(FILENAME) } +{ printf ("%d: <%s>\n", FNR, $0 ) } +ENDFILE { print "End of", basename(FILENAME) } + +function basename(file, result) +{ + result = file + gsub(".*/", "", result) + return result +} diff --git a/test/readfile2.ok b/test/readfile2.ok new file mode 100644 index 00000000..be1ded6c --- /dev/null +++ b/test/readfile2.ok @@ -0,0 +1,21 @@ +Start of readfile2.awk +1: <@load "readfile" +BEGIN { PROCINFO["readfile"] = 1 } +BEGINFILE { print "Start of", basename(FILENAME) } +{ printf ("%d: <%s>\n", FNR, $0 ) } +ENDFILE { print "End of", basename(FILENAME) } + +function basename(file, result) +{ + result = file + gsub(".*/", "", result) + return result +} +> +End of readfile2.awk +Start of readdir.awk +1: <@load "readdir" + +{ print } +> +End of readdir.awk -- cgit v1.2.3 From a32f6ebcbe39093b9e4cf91c621da46342fcc593 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 3 Apr 2014 21:48:44 +0300 Subject: Fix test/Makefile.am for making dists. --- test/ChangeLog | 4 ++++ test/Makefile.am | 1 + test/Makefile.in | 1 + 3 files changed, 6 insertions(+) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index f8d9f943..68615c9a 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2014-04-03 Arnold D. Robbins + + * Makefile.am (EXTRA_DIST): Add readfile2.ok. Oops. + 2014-03-27 Arnold D. Robbins * Makefile.am (readfile2): New test. diff --git a/test/Makefile.am b/test/Makefile.am index d92f358e..d295f6f2 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -709,6 +709,7 @@ EXTRA_DIST = \ readdir.awk \ readdir0.awk \ readfile2.awk \ + readfile2.ok \ rebt8b1.awk \ rebt8b1.ok \ rebt8b2.awk \ diff --git a/test/Makefile.in b/test/Makefile.in index 6e1bcbb3..0c582a00 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -955,6 +955,7 @@ EXTRA_DIST = \ readdir.awk \ readdir0.awk \ readfile2.awk \ + readfile2.ok \ rebt8b1.awk \ rebt8b1.ok \ rebt8b2.awk \ -- cgit v1.2.3 From 729a652d8e504f0897ea216505b027ae2d682c16 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 8 Apr 2014 19:14:52 +0300 Subject: Prettify lists of tests. --- test/ChangeLog | 4 ++++ test/Makefile.am | 3 +-- test/Makefile.in | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 68615c9a..f694c61c 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2014-04-04 Arnold D. Robbins + + * Makefile.am: Prettify list of tests a little bit. + 2014-04-03 Arnold D. Robbins * Makefile.am (EXTRA_DIST): Add readfile2.ok. Oops. diff --git a/test/Makefile.am b/test/Makefile.am index d295f6f2..dc379e06 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -947,8 +947,7 @@ BASIC_TESTS = \ arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 arysubnm asgext awkpath \ - back89 backgsub \ - badassign1 \ + back89 backgsub badassign1 \ childin clobber closebad clsflnam compare compare2 concat1 concat2 \ concat3 concat4 convfmt \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ diff --git a/test/Makefile.in b/test/Makefile.in index 0c582a00..d94c6e67 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1192,8 +1192,7 @@ BASIC_TESTS = \ arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 arysubnm asgext awkpath \ - back89 backgsub \ - badassign1 \ + back89 backgsub badassign1 \ childin clobber closebad clsflnam compare compare2 concat1 concat2 \ concat3 concat4 convfmt \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ -- cgit v1.2.3 From dc5af665700d9b04fdf9c18930526d28eef5d5d9 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 8 Apr 2014 21:15:08 +0300 Subject: Make release tar ball. --- test/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index f694c61c..7bcd9dc6 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2014-04-08 Arnold D. Robbins + + * 4.1.1: Release tar ball made. + 2014-04-04 Arnold D. Robbins * Makefile.am: Prettify list of tests a little bit. -- cgit v1.2.3 From e28178f891964d8ec2209379ac615102519a6e06 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 11 Apr 2014 07:39:41 +0300 Subject: Add a warning that locale support is needed for the charset tests. --- test/ChangeLog | 6 ++++++ test/Makefile.am | 4 ++++ test/Makefile.in | 4 ++++ 3 files changed, 14 insertions(+) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 7bcd9dc6..7845e8ad 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2014-04-11 Arnold D. Robbins + + * Makefile.am (charset-msg-start): Add a warning message that tests + may fail without adequate locale support, per request from + Nelson H.F. Beebe. + 2014-04-08 Arnold D. Robbins * 4.1.1: Release tar ball made. diff --git a/test/Makefile.am b/test/Makefile.am index dc379e06..32d6bd7b 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1143,6 +1143,10 @@ machine-msg-end: charset-msg-start: @echo "======== Starting tests that can vary based on character set or locale support ========" + @echo "************************************************" + @echo "** Some or all of these tests may fail if you **" + @echo "** have inadequate or missing locale support **" + @echo "************************************************" charset-msg-end: @echo "======== Done with tests that can vary based on character set or locale support ========" diff --git a/test/Makefile.in b/test/Makefile.in index d94c6e67..267fea75 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1570,6 +1570,10 @@ machine-msg-end: charset-msg-start: @echo "======== Starting tests that can vary based on character set or locale support ========" + @echo "************************************************" + @echo "** Some or all of these tests may fail if you **" + @echo "** have inadequate or missing locale support **" + @echo "************************************************" charset-msg-end: @echo "======== Done with tests that can vary based on character set or locale support ========" -- cgit v1.2.3 From 40694fc1c11bae6fac8e809a6a4c161c12cc37b7 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 9 May 2014 11:59:29 +0300 Subject: Fix in read_a_record for short file with RS=regex. --- test/ChangeLog | 7 +++++++ test/Makefile.am | 10 +++++++++- test/Makefile.in | 18 +++++++++++++----- test/Maketests | 8 ++++---- test/rsgetline.awk | 23 +++++++++++++++++++++++ test/rsgetline.in | 1 + test/rsgetline.ok | 3 +++ 7 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 test/rsgetline.awk create mode 100644 test/rsgetline.in create mode 100644 test/rsgetline.ok (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 7845e8ad..9af1c5bc 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,10 @@ +2014-05-09 Andrew J. Schorr + + * Makefile.am (rebuf): Force buffer size to 4096 via AWKBUFSIZE + environment variable. + (rsgetline): New test. + * rsgetline.awk, rsgetline.in, rsgetline.ok: New files. + 2014-04-11 Arnold D. Robbins * Makefile.am (charset-msg-start): Add a warning message that tests diff --git a/test/Makefile.am b/test/Makefile.am index 32d6bd7b..856532cd 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -757,6 +757,9 @@ EXTRA_DIST = \ rs.awk \ rs.in \ rs.ok \ + rsgetline.awk \ + rsgetline.in \ + rsgetline.ok \ rsnul1nl.awk \ rsnul1nl.in \ rsnul1nl.ok \ @@ -998,7 +1001,7 @@ GAWK_EXT_TESTS = \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 procinfs \ profile1 profile2 profile3 profile4 profile5 pty1 \ - rebuf regx8bit reginttrad reint reint2 rsstart1 \ + rebuf regx8bit reginttrad reint reint2 rsgetline rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ @@ -1327,6 +1330,11 @@ fmtspcl: fmtspcl.ok $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ fi +rebuf:: + @echo $@ + @AWKBUFSIZE=4096 AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + reint:: @echo $@ @$(AWK) --re-interval -f "$(srcdir)"/reint.awk "$(srcdir)"/reint.in >_$@ diff --git a/test/Makefile.in b/test/Makefile.in index 267fea75..1dbc3359 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1003,6 +1003,9 @@ EXTRA_DIST = \ rs.awk \ rs.in \ rs.ok \ + rsgetline.awk \ + rsgetline.in \ + rsgetline.ok \ rsnul1nl.awk \ rsnul1nl.in \ rsnul1nl.ok \ @@ -1243,7 +1246,7 @@ GAWK_EXT_TESTS = \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 procinfs \ profile1 profile2 profile3 profile4 profile5 pty1 \ - rebuf regx8bit reginttrad reint reint2 rsstart1 \ + rebuf regx8bit reginttrad reint reint2 rsgetline rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ @@ -1752,6 +1755,11 @@ fmtspcl: fmtspcl.ok $(CMP) "$(srcdir)"/$@-mpfr.ok _$@ && rm -f _$@ ; \ fi +rebuf:: + @echo $@ + @AWKBUFSIZE=4096 AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + reint:: @echo $@ @$(AWK) --re-interval -f "$(srcdir)"/reint.awk "$(srcdir)"/reint.in >_$@ @@ -3491,14 +3499,14 @@ pty1: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ -rebuf: +regx8bit: @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ -regx8bit: +rsgetline: @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ rstest6: diff --git a/test/Maketests b/test/Maketests index b9b713c4..e847d765 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1152,14 +1152,14 @@ pty1: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ -rebuf: +regx8bit: @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ -regx8bit: +rsgetline: @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ rstest6: diff --git a/test/rsgetline.awk b/test/rsgetline.awk new file mode 100644 index 00000000..fa327fcf --- /dev/null +++ b/test/rsgetline.awk @@ -0,0 +1,23 @@ +# Date: Sun, 4 May 2014 18:09:01 +0200 +# From: Davide Brini +# To: bug-gawk@gnu.org +# Subject: Re: [bug-gawk] Computed regex and getline bug / issue +# +# I have been able to reduce the behavior to these simple test cases, which +# (unless I'm missing something obvious) should behave identically but don't: +# +# $ printf '1,2,' | gawk 'BEGIN{RS="[,]+"}{print; a = getline; print "-"a"-"; print}' +# 1 +# -0- +# 1 + +BEGIN { + RS = "[,]+" +} + +{ + printf "[%s] [%s]\n", $0, RT + a = getline + print "-"a"-" + printf "[%s] [%s]\n", $0, RT +} diff --git a/test/rsgetline.in b/test/rsgetline.in new file mode 100644 index 00000000..f1782346 --- /dev/null +++ b/test/rsgetline.in @@ -0,0 +1 @@ +1,2, \ No newline at end of file diff --git a/test/rsgetline.ok b/test/rsgetline.ok new file mode 100644 index 00000000..1388369a --- /dev/null +++ b/test/rsgetline.ok @@ -0,0 +1,3 @@ +[1] [,] +-1- +[2] [,] -- cgit v1.2.3 From 0ebae58196378b06e083109701875f15c60a7b9a Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 10 May 2014 22:53:29 +0300 Subject: Additional fix for TERMNEAREND. --- test/ChangeLog | 5 +++++ test/Makefile.am | 8 +++++++- test/Makefile.in | 8 +++++++- test/rsglstdin.ok | 3 +++ 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 test/rsglstdin.ok (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 9af1c5bc..095fe155 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-05-10 Andrew J. Schorr + + * Makefile.am (rsglstdin): New test. + * rsglstdin.ok: New file. + 2014-05-09 Andrew J. Schorr * Makefile.am (rebuf): Force buffer size to 4096 via AWKBUFSIZE diff --git a/test/Makefile.am b/test/Makefile.am index 856532cd..260b216a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -760,6 +760,7 @@ EXTRA_DIST = \ rsgetline.awk \ rsgetline.in \ rsgetline.ok \ + rsglstdin.ok \ rsnul1nl.awk \ rsnul1nl.in \ rsnul1nl.ok \ @@ -1001,7 +1002,7 @@ GAWK_EXT_TESTS = \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 procinfs \ profile1 profile2 profile3 profile4 profile5 pty1 \ - rebuf regx8bit reginttrad reint reint2 rsgetline rsstart1 \ + rebuf regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ @@ -1335,6 +1336,11 @@ rebuf:: @AWKBUFSIZE=4096 AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +rsglstdin:: + @echo $@ + @cat "$(srcdir)"/rsgetline.in | AWKPATH="$(srcdir)" $(AWK) -f rsgetline.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + reint:: @echo $@ @$(AWK) --re-interval -f "$(srcdir)"/reint.awk "$(srcdir)"/reint.in >_$@ diff --git a/test/Makefile.in b/test/Makefile.in index 1dbc3359..34d5c594 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1006,6 +1006,7 @@ EXTRA_DIST = \ rsgetline.awk \ rsgetline.in \ rsgetline.ok \ + rsglstdin.ok \ rsnul1nl.awk \ rsnul1nl.in \ rsnul1nl.ok \ @@ -1246,7 +1247,7 @@ GAWK_EXT_TESTS = \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 procinfs \ profile1 profile2 profile3 profile4 profile5 pty1 \ - rebuf regx8bit reginttrad reint reint2 rsgetline rsstart1 \ + rebuf regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ @@ -1760,6 +1761,11 @@ rebuf:: @AWKBUFSIZE=4096 AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +rsglstdin:: + @echo $@ + @cat "$(srcdir)"/rsgetline.in | AWKPATH="$(srcdir)" $(AWK) -f rsgetline.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + reint:: @echo $@ @$(AWK) --re-interval -f "$(srcdir)"/reint.awk "$(srcdir)"/reint.in >_$@ diff --git a/test/rsglstdin.ok b/test/rsglstdin.ok new file mode 100644 index 00000000..1388369a --- /dev/null +++ b/test/rsglstdin.ok @@ -0,0 +1,3 @@ +[1] [,] +-1- +[2] [,] -- cgit v1.2.3 From 35de6ecfbbc272f25d12370785b1032447f37164 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 11 May 2014 05:22:51 +0300 Subject: Further fix to eval "" in debugger. --- test/ChangeLog | 5 +++++ test/Makefile.am | 8 +++++++- test/Makefile.in | 8 +++++++- test/dbugeval.in | 2 ++ test/dbugeval.ok | 1 + 5 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 test/dbugeval.in create mode 100644 test/dbugeval.ok (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 095fe155..b5800961 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-05-11 Arnold D. Robbins + + * Makefile.am (dbugeval): New test. + * dbugeval.in, dbugeval.ok: New files. + 2014-05-10 Andrew J. Schorr * Makefile.am (rsglstdin): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 260b216a..574ca2ea 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -167,6 +167,7 @@ EXTRA_DIST = \ datanonl.awk \ datanonl.in \ datanonl.ok \ + dbugeval.in \ defref.awk \ defref.ok \ delargv.awk \ @@ -990,7 +991,7 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - colonwarn clos1way delsub devfd devfd1 devfd2 dumpvars exit \ + colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ @@ -1928,6 +1929,11 @@ backsmalls2: AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +dbugeval:: + @echo $@ + $(AWK) --debug -f /dev/null < "$(srcdir)"/$@.in > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + # Targets generated for other tests: include Maketests diff --git a/test/Makefile.in b/test/Makefile.in index 34d5c594..595e4966 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -413,6 +413,7 @@ EXTRA_DIST = \ datanonl.awk \ datanonl.in \ datanonl.ok \ + dbugeval.in \ defref.awk \ defref.ok \ delargv.awk \ @@ -1235,7 +1236,7 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - colonwarn clos1way delsub devfd devfd1 devfd2 dumpvars exit \ + colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ @@ -2351,6 +2352,11 @@ backsmalls2: @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +dbugeval:: + @echo $@ + $(AWK) --debug -f /dev/null < "$(srcdir)"/$@.in > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: diff --git a/test/dbugeval.in b/test/dbugeval.in new file mode 100644 index 00000000..6a3c2459 --- /dev/null +++ b/test/dbugeval.in @@ -0,0 +1,2 @@ +eval "" +eval "" diff --git a/test/dbugeval.ok b/test/dbugeval.ok new file mode 100644 index 00000000..284f2abb --- /dev/null +++ b/test/dbugeval.ok @@ -0,0 +1 @@ +EXIT CODE: 2 -- cgit v1.2.3 From 1f09ba8c86f73123383cd69d38414f8e922855e0 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 13 May 2014 05:36:04 +0300 Subject: Add dbugeval.ok to EXTRADIST in Makefile.am. --- test/ChangeLog | 4 ++++ test/Makefile.am | 1 + test/Makefile.in | 1 + 3 files changed, 6 insertions(+) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index b5800961..9bd0540b 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2014-05-13 Arnold D. Robbins + + * Makefile.am (EXTRA_DIST): Forgot dbugeval.ok. Ooops. + 2014-05-11 Arnold D. Robbins * Makefile.am (dbugeval): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 574ca2ea..c53e0d01 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -168,6 +168,7 @@ EXTRA_DIST = \ datanonl.in \ datanonl.ok \ dbugeval.in \ + dbugeval.ok \ defref.awk \ defref.ok \ delargv.awk \ diff --git a/test/Makefile.in b/test/Makefile.in index 595e4966..f00efc63 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -414,6 +414,7 @@ EXTRA_DIST = \ datanonl.in \ datanonl.ok \ dbugeval.in \ + dbugeval.ok \ defref.awk \ defref.ok \ delargv.awk \ -- cgit v1.2.3 From cb3db09270b4caaddb0d606ec892841c149698eb Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 22 May 2014 06:11:32 +0300 Subject: Allow any redirected getline inside BEGINFILE/ENDFILE. --- test/ChangeLog | 4 ++++ test/lintwarn.ok | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 9bd0540b..4af051f0 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2014-05-22 Andrew J. Schorr + + * lintwarn.ok: Updated. + 2014-05-13 Arnold D. Robbins * Makefile.am (EXTRA_DIST): Forgot dbugeval.ok. Ooops. diff --git a/test/lintwarn.ok b/test/lintwarn.ok index ec87612f..bc5226e6 100644 --- a/test/lintwarn.ok +++ b/test/lintwarn.ok @@ -1,6 +1,6 @@ gawk: lintwarn.awk:2: warning: `BEGINFILE' is a gawk extension -gawk: lintwarn.awk:3: error: `getline var' invalid inside `BEGINFILE' rule -gawk: lintwarn.awk:4: error: `getline' invalid inside `BEGINFILE' rule +gawk: lintwarn.awk:3: error: non-redirected `getline' invalid inside `BEGINFILE' rule +gawk: lintwarn.awk:4: error: non-redirected `getline' invalid inside `BEGINFILE' rule gawk: lintwarn.awk:8: warning: statement may have no effect gawk: lintwarn.awk:9: warning: plain `print' in BEGIN or END rule should probably be `print ""' gawk: lintwarn.awk:10: error: `nextfile' used in BEGIN action -- cgit v1.2.3 From d1093f2c3c24ccabfc2c093a6a7c8205a30cb3c7 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 30 May 2014 09:55:13 +0300 Subject: New tests for regex match against NUL byte. --- test/ChangeLog | 5 +++ test/Makefile.am | 6 ++- test/Makefile.in | 16 +++++++- test/Maketests | 10 +++++ test/regnul1.awk | 84 +++++++++++++++++++++++++++++++++++++++++ test/regnul1.ok | 8 ++++ test/regnul2.awk | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ test/regnul2.ok | 27 ++++++++++++++ 8 files changed, 266 insertions(+), 2 deletions(-) create mode 100644 test/regnul1.awk create mode 100644 test/regnul1.ok create mode 100644 test/regnul2.awk create mode 100644 test/regnul2.ok (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 4af051f0..ae144a27 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-05-30 Arnold D. Robbins + + * Makefile.am (regnul1, regnul2): New tests. + * regnul1.awk, regnul1.ok, regnul1.awk, regnul2.ok: New files. + 2014-05-22 Andrew J. Schorr * lintwarn.ok: Updated. diff --git a/test/Makefile.am b/test/Makefile.am index c53e0d01..5675c1d6 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -729,6 +729,10 @@ EXTRA_DIST = \ regexprange.ok \ reginttrad.awk \ reginttrad.ok \ + regnul1.awk \ + regnul1.ok \ + regnul2.awk \ + regnul2.ok \ regrange.awk \ regrange.ok \ regtest.sh \ @@ -1004,7 +1008,7 @@ GAWK_EXT_TESTS = \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 procinfs \ profile1 profile2 profile3 profile4 profile5 pty1 \ - rebuf regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ + rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ diff --git a/test/Makefile.in b/test/Makefile.in index f00efc63..a7e1f193 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -975,6 +975,10 @@ EXTRA_DIST = \ regexprange.ok \ reginttrad.awk \ reginttrad.ok \ + regnul1.awk \ + regnul1.ok \ + regnul2.awk \ + regnul2.ok \ regrange.awk \ regrange.ok \ regtest.sh \ @@ -1249,7 +1253,7 @@ GAWK_EXT_TESTS = \ nastyparm next nondec nondec2 \ patsplit posix printfbad1 printfbad2 printfbad3 procinfs \ profile1 profile2 profile3 profile4 profile5 pty1 \ - rebuf regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ + rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \ rsstart2 rsstart3 rstest6 shadow sortfor sortu split_after_fpat \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ @@ -3512,6 +3516,16 @@ pty1: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +regnul1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +regnul2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + regx8bit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index e847d765..0841ae77 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1152,6 +1152,16 @@ pty1: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +regnul1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +regnul2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + regx8bit: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/regnul1.awk b/test/regnul1.awk new file mode 100644 index 00000000..2a35d176 --- /dev/null +++ b/test/regnul1.awk @@ -0,0 +1,84 @@ +# From denis@gissoft.eu Thu May 29 09:07:56 IDT 2014 +# Article: 8400 of comp.lang.awk +# X-Received: by 10.236.81.99 with SMTP id l63mr3912466yhe.3.1401224812642; +# Tue, 27 May 2014 14:06:52 -0700 (PDT) +# X-Received: by 10.140.37.148 with SMTP id r20mr578874qgr.0.1401224812310; Tue, +# 27 May 2014 14:06:52 -0700 (PDT) +# Path: eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!hl10no6493021igb.0!news-out.google.com!gi6ni15574igc.0!nntp.google.com!hl10no6493018igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail +# Newsgroups: comp.lang.awk +# Date: Tue, 27 May 2014 14:06:52 -0700 (PDT) +# Complaints-To: groups-abuse@google.com +# Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.253.50.165; +# posting-account=zNhVLgoAAACsg-WfVe_or2VV7loUhx8H +# NNTP-Posting-Host: 85.253.50.165 +# User-Agent: G2/1.0 +# MIME-Version: 1.0 +# Message-ID: <3112e356-d2e1-45cd-ba55-2f939ee50105@googlegroups.com> +# Subject: \0 character can't be implement inside regexp in some cases? +# From: denis@gissoft.eu +# Injection-Date: Tue, 27 May 2014 21:06:52 +0000 +# Content-Type: text/plain; charset=ISO-8859-1 +# Xref: news.eternal-september.org comp.lang.awk:8400 +# +# Hello, +# +# while doing some experiments with the gawk(4.1.1) i was found problem in implementing character \x00 inside regexp for two cases: +# +# str~/\0/ +# +# and +# +# switch ( str ) { case /\0/: ... } +# +# the following code try to match given string(=="\x00") with the regexp /^\0$/ using different ways provided by gawk: +# +func _chm(t) { + _ch("match()",match(t,/^\0$/)) + _ch("split()",split(t,A,/^\0$/)>1) + _ch("patsplit()",patsplit(t,A,/^\0$/)) + _ch("gsub()",gsub(/^\0$/,"&",t)) + _ch("sub()",sub(/^\0$/,"&",t)) + _ch("gensub()",!gensub(/^\0$/,"","G",t)) + _ch("str~/rexp/",t~/^\0$/) + a=0; switch ( t ) { case /^\0$/: a=1 }; _ch("switch-case //",a) } + +func _ch(fn,bool) { + print substr(fn ": ",1,16) (bool ? "+" : "-") } + +BEGIN{ _chm("\000") } +# +# output: +# +# > gawk -f _null.gwk +# match(): + +# split(): + +# patsplit(): + +# gsub(): + +# sub(): + +# gensub(): + +# str~/rexp/: - +# switch-case //: - +# +# can someone explain me: +# +# why in case using match(), split(), patsplit(), gsub(), sub() and gensub() the given string "\x00" matches with the /^\0$/ +# +# but in cases: +# +# "\x00"~/^\0$/ +# +# and +# +# switch ( "\x00" ) { case /^\0$/: doesn't match? } +# +# +# thank You +# +# +# GNU Awk 4.1.1, API: 1.1 (GNU MPFR 3.1.0-p8, GNU MP 5.0.2) +# Copyright (C) 1989, 1991-2014 Free Software Foundation. +# downloaded from ezwinports +# +# windows 7x64; cmd +# +# diff --git a/test/regnul1.ok b/test/regnul1.ok new file mode 100644 index 00000000..2ba0e1da --- /dev/null +++ b/test/regnul1.ok @@ -0,0 +1,8 @@ +match(): + +split(): + +patsplit(): + +gsub(): + +sub(): + +gensub(): + +str~/rexp/: + +switch-case //: + diff --git a/test/regnul2.awk b/test/regnul2.awk new file mode 100644 index 00000000..3d93df41 --- /dev/null +++ b/test/regnul2.awk @@ -0,0 +1,112 @@ +# From denis@gissoft.eu Thu May 29 09:10:18 IDT 2014 +# Article: 8408 of comp.lang.awk +# X-Received: by 10.182.128.166 with SMTP id np6mr93689obb.16.1401289466734; +# Wed, 28 May 2014 08:04:26 -0700 (PDT) +# X-Received: by 10.140.36.6 with SMTP id o6mr4939qgo.26.1401289466607; Wed, 28 +# May 2014 08:04:26 -0700 (PDT) +# Path: eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!c1no19185457igq.0!news-out.google.com!qf4ni13600igc.0!nntp.google.com!c1no19185454igq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail +# Newsgroups: comp.lang.awk +# Date: Wed, 28 May 2014 08:04:26 -0700 (PDT) +# In-Reply-To: +# Complaints-To: groups-abuse@google.com +# Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.131.35.51; posting-account=zNhVLgoAAACsg-WfVe_or2VV7loUhx8H +# NNTP-Posting-Host: 82.131.35.51 +# References: <3112e356-d2e1-45cd-ba55-2f939ee50105@googlegroups.com> +# +# +# User-Agent: G2/1.0 +# MIME-Version: 1.0 +# Message-ID: <79828a24-d265-4e88-8de1-e61ecbaa6701@googlegroups.com> +# Subject: Re: \0 character can't be implement inside regexp in some cases? +# From: Denis Shirokov +# Injection-Date: Wed, 28 May 2014 15:04:26 +0000 +# Content-Type: text/plain; charset=ISO-8859-1 +# Xref: news.eternal-september.org comp.lang.awk:8408 +# +# +# All of the other use-cases just cluttered up your posting. +# +# oh, really? +# +# 1. where in the Janis code the case with the `switch-case'? +# 2. how do you know about that there is only two cases? may be you know it because my code contains the other test cases? +# 3. fine. do you know what situation with the dynamic regexps? no? +# 4. do you know what situation with RS,FS and /.../ in the middle-area? how you can say that there is only two cases if you absolutely do not know it? +# +# i'm asking: WHO will perform testing other cases? You? gawk-team? the God? +# what is that point of view: that it will be enough to say: +# Oh! my match(t,/^\0$/) is matching "\x00" but t~/^\0$/ is not. why oh why? +# +# where is the test cover? or you think that other peoples will doing its instead of You? instead of Me? +# +# and the second point: guys you are screaming about two levels of stack. really, you kidding? =) +# +# however, i'm attaching some additional information about dynrexp: +# +func _chmd(t,r) { + _ch("match()",match(t,r)) + _ch("split()",split(t,A,r)>1) + _ch("patsplit()",patsplit(t,A,r)) + _ch("gsub()",gsub(r,"&",t)) + t2=t; _ch("sub()",sub(r,"&",t2)) + _ch("gensub()",!gensub(r,"","G",t)) + _ch("str~/rexp/",t~r) + # switch-case is not applicable with dynrxp + _conline() } + +func _ch(fn,bool) { + print substr(fn ": ",1,16) (bool ? "+" : "-") } + +func _conline() { + print "__________________________"; print } + +BEGIN{ _chmd("\x01","^\1$") #testing that all doings right; all match + _chmd("\x00","^\1$") #testing that all doings right; all not match + _chmd("\x00","^\0$") #tesing dynrexp +} +# +# output: +# +# match(): + +# split(): + +# patsplit(): + +# gsub(): + +# sub(): + +# gensub(): + +# str~/rexp/: + +# __________________________ +# +# match(): - +# split(): - +# patsplit(): - +# gsub(): - +# sub(): - +# gensub(): - +# str~/rexp/: - +# __________________________ +# +# match(): + +# split(): + +# patsplit(): + +# gsub(): + +# sub(): + +# gensub(): + +# str~/rexp/: - +# +# it's looks like with the dynamic regexp the same story. +# +# i found another one moment that is possible near with the reason of this issue: +# +# i was testing what characters can be present in doublestring and regexp "directly" (just as the character) and what characters must be present as escape sequence (\qqq) +# +# so, i found the following: +# +# t="abc" +# if ( match(t,/^abc[NUL]def/) ) ... - where [NUL] is the character \x00 +# +# it's seems that in that case the regular expression is processed until [NUL]character and the other part is ignored because the example above gives TRUE +# +# friendship +# Denis Shirokov +# +# diff --git a/test/regnul2.ok b/test/regnul2.ok new file mode 100644 index 00000000..6b3cecab --- /dev/null +++ b/test/regnul2.ok @@ -0,0 +1,27 @@ +match(): + +split(): + +patsplit(): + +gsub(): + +sub(): + +gensub(): + +str~/rexp/: + +__________________________ + +match(): - +split(): - +patsplit(): - +gsub(): - +sub(): - +gensub(): - +str~/rexp/: - +__________________________ + +match(): + +split(): + +patsplit(): + +gsub(): + +sub(): + +gensub(): + +str~/rexp/: + +__________________________ + -- cgit v1.2.3 From 55390bf583f7a3629a4c63de436702fa1b8b613b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 8 Jun 2014 22:57:08 +0300 Subject: Minor fix in dbugeval test. --- test/ChangeLog | 4 ++++ test/Makefile.am | 2 +- test/Makefile.in | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index ae144a27..4315bbb9 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2014-06-08 Arnold D. Robbins + + * Makefile.am (dbugeval): Add leading @ to recipe. Ooops. + 2014-05-30 Arnold D. Robbins * Makefile.am (regnul1, regnul2): New tests. diff --git a/test/Makefile.am b/test/Makefile.am index 5675c1d6..e5c3c1eb 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1936,7 +1936,7 @@ backsmalls2: dbugeval:: @echo $@ - $(AWK) --debug -f /dev/null < "$(srcdir)"/$@.in > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @$(AWK) --debug -f /dev/null < "$(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 a7e1f193..5326e0b1 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -2360,7 +2360,7 @@ backsmalls2: dbugeval:: @echo $@ - $(AWK) --debug -f /dev/null < "$(srcdir)"/$@.in > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @$(AWK) --debug -f /dev/null < "$(srcdir)"/$@.in > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program -- cgit v1.2.3 From a83444c3f520da5983965baa1ea04dc4476ef1d9 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 19 Jun 2014 20:24:33 +0300 Subject: Bug fix for poundbang test. --- test/ChangeLog | 4 ++++ test/Makefile.am | 2 +- test/Makefile.in | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index 4315bbb9..5674ec67 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2014-06-19 Michael Forney + + * Makefile.am (poundbang): Fix relative path of AWKPROG. + 2014-06-08 Arnold D. Robbins * Makefile.am (dbugeval): Add leading @ to recipe. Ooops. diff --git a/test/Makefile.am b/test/Makefile.am index e5c3c1eb..904553b8 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1193,7 +1193,7 @@ poundbang:: @if ./_pbd.awk "$(srcdir)"/poundbang.awk > _`basename $@` ; \ then : ; \ else \ - sed "s;/tmp/gawk;../$(AWKPROG);" < "$(srcdir)"/poundbang.awk > ./_pbd.awk ; \ + sed "s;/tmp/gawk;$(AWKPROG);" < "$(srcdir)"/poundbang.awk > ./_pbd.awk ; \ chmod +x ./_pbd.awk ; \ LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} ./_pbd.awk "$(srcdir)"/poundbang.awk > _`basename $@`; \ fi diff --git a/test/Makefile.in b/test/Makefile.in index 5326e0b1..15c95345 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1618,7 +1618,7 @@ poundbang:: @if ./_pbd.awk "$(srcdir)"/poundbang.awk > _`basename $@` ; \ then : ; \ else \ - sed "s;/tmp/gawk;../$(AWKPROG);" < "$(srcdir)"/poundbang.awk > ./_pbd.awk ; \ + sed "s;/tmp/gawk;$(AWKPROG);" < "$(srcdir)"/poundbang.awk > ./_pbd.awk ; \ chmod +x ./_pbd.awk ; \ LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} ./_pbd.awk "$(srcdir)"/poundbang.awk > _`basename $@`; \ fi -- cgit v1.2.3