gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, feature/improve-tests, updated. gawk-4.1


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, feature/improve-tests, updated. gawk-4.1.0-3069-geccbde5
Date: Thu, 12 Apr 2018 14:34:13 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, feature/improve-tests has been updated
       via  eccbde5b95b819e39bc13e02f30a2a4ba2d4267d (commit)
      from  64b59606f3a712da1ae852b90b996d3c786267b1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=eccbde5b95b819e39bc13e02f30a2a4ba2d4267d

commit eccbde5b95b819e39bc13e02f30a2a4ba2d4267d
Author: Arnold D. Robbins <address@hidden>
Date:   Thu Apr 12 21:33:54 2018 +0300

    Start on autogenerating pc/Makefile.tst.

diff --git a/pc/ChangeLog b/pc/ChangeLog
index e623a9a..40147ab 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,9 @@
+2018-04-12         Arnold D. Robbins     <address@hidden>
+
+       * Makefile.tst.prologue: Initial version for autogeneration
+       of Makefile.tst.
+       * GenMakefileTst.awk: New file.
+
 2018-03-22         Arnold D. Robbins     <address@hidden>
 
        * config.h: Add support for printf %a format.
diff --git a/pc/GenMakefileTst.awk b/pc/GenMakefileTst.awk
new file mode 100644
index 0000000..4f1611e
--- /dev/null
+++ b/pc/GenMakefileTst.awk
@@ -0,0 +1,90 @@
+#!/usr/bin/gawk -f
+
+# This program generates pc/Makefile.tst
+
+BEGIN {
+       system("cat Makefile.tst.prologue")
+}
+
+/Get rid of core files/ { process = 1 }
+
+! process      { next }
+
+# process the file Makefile.am:
+/^EXPECTED_FAIL_DJGPP *=/,/[^\\]$/ {
+       gsub(/(^EXPECTED_FAIL_DJGPP *=|\\$)/,"")
+       for (i = 1; i <= NF; i++)
+               djgpp[$i]
+
+       print
+       next
+}
+
+/^EXPECTED_FAIL_MINGW *=/,/[^\\]$/ {
+       gsub(/(^EXPECTED_FAIL_MINGW *=|\\$)/,"")
+       for (i = 1; i <= NF; i++)
+               mingw[$i]
+
+       print
+       next
+}
+
+/^[[:alpha:]_][[:alnum:]_]*:/ {
+       inrule = 1
+       name = gensub(/(^[[:alpha:]_][[:alnum:]_])*:.*/, "\\1", 1, $0)
+       delete rulelines
+       line = 0
+       rulelines[++line] = $0
+       next
+}
+
+inrule && /^\t/ {
+       rulelines[++line] = substitutions($0)
+       next
+}
+
+inrule && /(^[^\t])|^$/ {
+       inrule = 0
+       print rulelines[1]
+       if (rulelines[2] == "address@hidden $@") {
+               start = 3
+               print rulelines[2]
+       } else
+               start = 2
+
+       if (name in djgpp && name in mingw) {
+               print "address@hidden Expect $@ to fail on DJGPP and MinGW"
+       } else if (name in djgpp) {
+               print "address@hidden Expect $@ to fail on DJGPP"
+       } else if (name in mingw) {
+               print "address@hidden Expect $@ to fail on MinGW"
+       }
+
+       for (i = start; i < line; i++)
+               print rulelines[i]
+
+       if (rulelines[i] ~ /address@hidden/)
+               print rulelines[i]
+       else if (rulelines[i] ~ /^\t@/)
+               printf "address@hidden", substr(rulelines[i], 3)
+       else {
+               print rulelines[i]
+       }
+
+       print
+       next
+}
+
+process                { print }
+
+function substitutions(string)
+{
+       gsub(/en_US.UTF-8/, "ENU_USA.1252", string)
+       gsub(/fr_FR.UTF-8/, "FRA_FRA.1252", string)
+       gsub(/ja_JP.UTF-8/, "JPN_JPN.932", string)
+       gsub(/el_GR.iso88597/, "ell_GRC.1253", string)
+       gsub(/ru_RU.UTF-8/, "RUS_RUS.1251", string)
+       gsub(/@ls/, "@$(LS)", string)
+
+       return string
+}
diff --git a/pc/Makefile.tst.prologue b/pc/Makefile.tst.prologue
new file mode 100644
index 0000000..fdecadc
--- /dev/null
+++ b/pc/Makefile.tst.prologue
@@ -0,0 +1,141 @@
+# Makefile for GNU Awk test suite.
+#
+# Copyright (C) 1988-2016 the Free Software Foundation, Inc.
+# 
+# This file is part of GAWK, the GNU implementation of the
+# AWK Programming Language.
+# 
+# GAWK is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+# 
+# GAWK is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
USA
+
+# ============================================================================
+# MS-DOS & OS/2 Notes: READ THEM!
+# ============================================================================
+
+# As of version 2.91, efforts to make this makefile run in MS-DOS and OS/2
+# have started in earnest.  The following steps need to be followed in order 
+# to run this makefile:
+#
+# 1. The first thing that you will need to do is to convert all of the 
+#    files ending in ".ok" in the test directory, all of the files ending 
+#    in ".good" (or ".goo") in the test/reg directory, and mmap8k.in from
+#    having a linefeed to having carriage return/linefeed at the end of each
+#    line. There are various public domain UNIX to DOS converters and any 
+#    should work.  Alternatively, you can use diff instead of cmp--most 
+#    versions of diff don't care about how the lines end.
+#
+# 2. You will need an sh-compatible shell.  Please refer to the "README.pc"
+#    file in the README_d directory for information about obtaining a copy.
+#    You will also need various UNIX utilities.  At a minimum, you will 
+#    need: rm, tr, cmp (or diff, see above), cat, wc, and sh.  
+#    You should also have a UNIX-compatible date program.
+#
+# The makefile has only been tested with dmake 3.8 and DJGPP Make 3.74 or
+# later.  After making all of these changes, typing "dmake check extra"
+# or "make check extra" (with DJGPP Make) should run successfully.
+
+# The Bash shell (compiled with djgpp) works very well with the
+# djgpp-compiled gawk.  It is currently the recommended shell to use
+# for testing, along with DJGPP make.  See README.pc for 
+# more information on OS/2 and DOS shells.
+
+# You will almost certainly need to change some of the values (MACROS) 
+# defined on the next few lines.  
+
+# This won't work unless you have "sh" and set SHELL equal to it (Make 3.74
+# or later which comes with DJGPP will work with SHELL=/bin/sh if you have
+# sh.exe anywhere on your PATH).
+#SHELL = e:\bin\sh.exe
+SHELL = /bin/sh
+
+# Point to gawk
+AWK = AWKLIBPATH=../extension $(AWKPROG)
+# Also point to gawk but for DOS commands needing backslashes.  We need
+# the forward slash version too or 'arrayparam' fails.
+AWK2 = '..\gawk.exe'
+AWKPROG = ../gawk.exe
+# Point $(LS) to a version of ls.exe that reports true Windows file
+# index numbers, because this is what the readdir test expects.
+# Otherwise, the readdir test will fail.  (The MSYS ls.exe doesn't
+# report full index values.)
+LS = ls.exe
+
+# Define PGAWK
+PGAWK = ../gawk.exe -p
+
+# Set your cmp command here (you can use most versions of diff instead of cmp
+# if you don't want to convert the .ok files to the DOS CR/LF format).
+# This is also an issue for the "mmap8k" test.  If it fails, make sure that
+# mmap8k.in has CR/LFs or that you've used diff.
+#
+# The following comment is for users of OSs which support long file names
+# (such as Windows 95) for all versions of gawk (both 16 & 32-bit).
+# If you use a shell which doesn't support long filenames, temporary files
+# created by this makefile will be truncated by your shell.  "_argarra" is an
+# example of this.  If $(CMP) is a DJGPP-compiled program, then it will fail
+# because it looks for the long filename (eg. _argarray).  To fix this, you
+# need to set LFN=n in your shell's environment.
+# NOTE: Setting LFN in the makefile most probably won't help you because LFN
+# needs to be an environment variable.
+#CMP = cmp
+# See the comment above for why you might want to set CMP to "env LFN=n diff"
+#CMP = env LFN=n diff
+#CMP = diff
+CMP = diff -u
+#CMP = gcmp
+
+# cmp replacement program for PC where the error messages aren't
+# exactly the same.  Should run even on old awk.
+TESTOUTCMP = $(AWK) -f ../testoutcmp.awk
+
+# Set your "cp," "mv," and "mkdir" commands here.  Note: DOS's copy must take
+# forward slashes.
+CP = cp
+#CP = : && command -c copy
+#CP  = command.com /c copy
+
+#MV = cmd.exe /c ren
+MV = mv
+
+MKDIR = mkdir
+#MKDIR = gmkdir
+#MKDIR = : && command -c mkdir
+#MKDIR  = command.com /c mkdir
+
+# Set your unix-style date function here
+#DATE = date
+DATE = gdate
+
+# MS-DOS and OS/2 use ; as a PATH delimiter
+PATH_SEPARATOR = ;
+
+# Argument to -F to produce -F/, should be // for MinGW, / otherwise,
+# because MSYS Bash converts a single slash to the equivalent Windows
+# directory.
+SLASH = /
+#SLASH = //
+
+# Non-default GREP_OPTIONS might fail the badargs test
+export GREP_OPTIONS=
+
+# ============================================================================
+# You shouldn't need to modify anything below this line.
+# ============================================================================
+
+srcdir = .
+abs_srcdir = .
+abs_builddir = .
+top_srcdir = "$(srcdir)"/..
+abs_top_builddir = "$(top_srcdir)"
+
diff --git a/test/ChangeLog b/test/ChangeLog
index 8693672..3043a20 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -5,6 +5,11 @@
        (NEED_LOCALE_EN): Add reint2 to the list.
        * gsubtst3.awk, leaddig.awk: Modified to support automating.
 
+       Unrelated: Start on being able to generate pc/Makefile.tst.
+       
+       * Makfile.am (EXPECTED_FAIL_DJGPP, EXPECTED_FAIL_MINGW):
+       New lists of test expected to fail on the given platforms.
+
 2018-04-11         Arnold D. Robbins     <address@hidden>
 
        * Gentests: Add support for tests that need a specific locale.
diff --git a/test/Makefile.am b/test/Makefile.am
index 0f39152..a8197c0 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1386,6 +1386,21 @@ NEED_LOCALE_JP = mbprintf2
 
 NEED_LOCALE_RU = mtchi18n
 
+# List of tests that fail on DGJPP
+EXPECTED_FAIL_DJGPP = \
+       backbigs1 backsmalls1 backw beginfile1 clos1way clos1way2 \
+       clos1way3 clos1way4 clos1way5 clos1way6 errno getlndir \
+       getlnhd id ignrcas3 inetdayt inetdayu inetecht inetechu \
+       inftest jarebug mbfw1 mbprintf1 mbprintf4 mbstr1 mbstr2 \
+       nonfatal1 nonfatal2 nonfatal3 pid pty1 pty2 strtod timeout
+
+# List of tests that fail on MinGW
+EXPECTED_FAIL_MINGW = \
+       backbigs1 backsmalls1 devfd devfd1 devfd2 errno exitval2 fmtspcl \
+       fork fork2 fts getfile getlnhd ignrcas3 inetdayt inetecht mbfw1 \
+       mbprintf1 mbprintf4 mbstr1 mbstr2 pid pipeio2 pty1 pty2 readdir \
+       readdir_test rstest4 rstest5 status-close timeout
+
 # List of the files that appear in manual tests or are for reserve testing:
 GENTESTS_UNUSED = Makefile.in checknegtime.awk dtdgport.awk gtlnbufv.awk \
        hello.awk inchello.awk inclib.awk inplace.1.in inplace.2.in \
@@ -1741,7 +1756,7 @@ rsnulbig::
        @ : Suppose that block size for pipe is at most 128kB:
        @$(AWK) 'BEGIN { for (i = 1; i <= 128*64+1; i++) print 
"abcdefgh123456\n" }' 2>&1 | \
        $(AWK) 'BEGIN { RS = ""; ORS = "\n\n" }; { print }' 2>&1 | \
-       $(AWK) '/^[^a]/; END{ print NR }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       $(AWK) ' /^[^a]/; END{ print NR }' >_$@ 2>&1 || echo EXIT CODE: $$? 
>>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
 rsnulbig2::
@@ -1749,7 +1764,7 @@ rsnulbig2::
        @$(AWK) 'BEGIN { ORS = ""; n = "\n"; for (i = 1; i <= 10; i++) n = (n 
n); \
                for (i = 1; i <= 128; i++) print n; print "abc\n" }' 2>&1 | \
                $(AWK) 'BEGIN { RS = ""; ORS = "\n\n" };{ print }' 2>&1 | \
-               $(AWK) '/^[^a]/; END { print NR }' >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
+               $(AWK) ' /^[^a]/; END { print NR }' >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
 # This test makes sure gawk exits with a zero code.
@@ -1997,7 +2012,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)"/address@hidden _$@ && rm -f _$@ testext.awk 
testexttmp.txt
 
diff --git a/test/Makefile.in b/test/Makefile.in
index db33f05..219969f 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1644,6 +1644,33 @@ NEED_LOCALE_EN = \
 NEED_LOCALE_JP = mbprintf2
 NEED_LOCALE_RU = mtchi18n
 
+# NOTE - need to change @ to @- on last command if not there
+#
+# List of tests that fail on DGJPP
+EXPECTED_FAIL_DJGPP = \
+       backbigs1 backsmalls1 backw beginfile1 clos1way clos1way2 \
+       clos1way3 clos1way4 clos1way5 clos1way6 errno getlndir \
+       getlnhd id ignrcas3 inetdayt inetdayu inetecht inetechu \
+       inftest jarebug mbfw1 mbprintf1 mbprintf4 mbstr1 mbstr2 \
+       nonfatal1 nonfatal2 nonfatal3 pid pty1 pty2 strtod timeout
+
+
+# List of tests that fail on MinGW
+EXPECTED_FAIL_MINGW = \
+       backbigs1 backsmalls1 devfd devfd1 devfd2 errno exitval2 fmtspcl \
+       fork fork2 fts getfile getlnhd ignrcas3 inetdayt inetecht mbfw1 \
+       mbprintf1 mbprintf4 mbstr1 mbstr2 pid pipeio2 pty1 pty2 readdir \
+       readdir_test rstest4 rstest5 status-close timeout
+
+
+# NOTE - need to translate locales
+# en_US.UTF-8 --> ENU_USA.1252
+# fr_FR.UTF-8 --> FRA_FRA.1252
+# ja_JP.UTF-8 --> JPN_JPN.932
+# el_GR.iso88597 --> ell_GRC.1253
+# ru_RU.UTF-8 --> RUS_RUS.1251
+# @ls --> @$(LS)
+
 # List of the files that appear in manual tests or are for reserve testing:
 GENTESTS_UNUSED = Makefile.in checknegtime.awk dtdgport.awk gtlnbufv.awk \
        hello.awk inchello.awk inclib.awk inplace.1.in inplace.2.in \
@@ -2183,7 +2210,7 @@ rsnulbig::
        @ : Suppose that block size for pipe is at most 128kB:
        @$(AWK) 'BEGIN { for (i = 1; i <= 128*64+1; i++) print 
"abcdefgh123456\n" }' 2>&1 | \
        $(AWK) 'BEGIN { RS = ""; ORS = "\n\n" }; { print }' 2>&1 | \
-       $(AWK) '/^[^a]/; END{ print NR }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       $(AWK) ' /^[^a]/; END{ print NR }' >_$@ 2>&1 || echo EXIT CODE: $$? 
>>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
 rsnulbig2::
@@ -2191,7 +2218,7 @@ rsnulbig2::
        @$(AWK) 'BEGIN { ORS = ""; n = "\n"; for (i = 1; i <= 10; i++) n = (n 
n); \
                for (i = 1; i <= 128; i++) print n; print "abc\n" }' 2>&1 | \
                $(AWK) 'BEGIN { RS = ""; ORS = "\n\n" };{ print }' 2>&1 | \
-               $(AWK) '/^[^a]/; END { print NR }' >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
+               $(AWK) ' /^[^a]/; END { print NR }' >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
 # This test makes sure gawk exits with a zero code.
@@ -2439,7 +2466,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)"/address@hidden _$@ && rm -f _$@ testext.awk 
testexttmp.txt
 

-----------------------------------------------------------------------

Summary of changes:
 pc/ChangeLog             |   6 ++
 pc/GenMakefileTst.awk    |  90 ++++++++++++++++++++++++++++++
 pc/Makefile.tst.prologue | 141 +++++++++++++++++++++++++++++++++++++++++++++++
 test/ChangeLog           |   5 ++
 test/Makefile.am         |  21 ++++++-
 test/Makefile.in         |  33 ++++++++++-
 6 files changed, 290 insertions(+), 6 deletions(-)
 create mode 100644 pc/GenMakefileTst.awk
 create mode 100644 pc/Makefile.tst.prologue


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]