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-3070-gf0cff6f
Date: Sun, 15 Apr 2018 14:50:34 -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  f0cff6fc06c2976c9961afc8a943a384f97328c0 (commit)
      from  eccbde5b95b819e39bc13e02f30a2a4ba2d4267d (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=f0cff6fc06c2976c9961afc8a943a384f97328c0

commit f0cff6fc06c2976c9961afc8a943a384f97328c0
Author: Arnold D. Robbins <address@hidden>
Date:   Sun Apr 15 21:50:04 2018 +0300

    Improve pc/GenMakefileTst.awk's processing of its input file.

diff --git a/pc/ChangeLog b/pc/ChangeLog
index 40147ab..3358e6a 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2018-04-15         Arnold D. Robbins     <address@hidden>
+
+       * GenMakefileTst.awk: Improve processing of input file.
+
 2018-04-12         Arnold D. Robbins     <address@hidden>
 
        * Makefile.tst.prologue: Initial version for autogeneration
diff --git a/pc/GenMakefileTst.awk b/pc/GenMakefileTst.awk
index 4f1611e..25762a1 100644
--- a/pc/GenMakefileTst.awk
+++ b/pc/GenMakefileTst.awk
@@ -3,88 +3,131 @@
 # This program generates pc/Makefile.tst
 
 BEGIN {
+       # Print the prologue
        system("cat Makefile.tst.prologue")
 }
 
+# Skip the first part of Makefile.in
 /Get rid of core files/ { process = 1 }
 
 ! process      { next }
 
-# process the file Makefile.am:
+# Process the bits in Makefile.in we need to generate the tests properly
+
+# Tests that fail on DJGPP
 /^EXPECTED_FAIL_DJGPP *=/,/[^\\]$/ {
+       print
        gsub(/(^EXPECTED_FAIL_DJGPP *=|\\$)/,"")
        for (i = 1; i <= NF; i++)
                djgpp[$i]
 
-       print
        next
 }
 
+# Tests that fail on MinGW
 /^EXPECTED_FAIL_MINGW *=/,/[^\\]$/ {
+       print
        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
+# Start of a target
+! in_recipe && /^[[:alpha:]_][[:alnum:]_]*:/ {
+       in_recipe = 1
+       start_new_recipe()
        next
 }
 
-inrule && /^\t/ {
-       rulelines[++line] = substitutions($0)
+# Empty targets, one after the other
+in_recipe && /^[[:alpha:]_][[:alnum:]_]*:/ {
+       print_recipe()
+       start_new_recipe()
        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"
-       }
+# Collect recipe lines
+in_recipe && /^\t/ {
+       recipe_lines[++line] = substitutions($0)
+       next
+}
 
-       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]
-       }
+# End of collected recipe, print it out
+in_recipe && /(^[^\t])|(^$)/ {
+       in_recipe = 0
+       print_recipe()
 
        print
        next
 }
 
+# Default is to print input lines
 process                { print }
 
+# substitutions --- replace *nix values with what's needed on Windows
+
 function substitutions(string)
 {
+       # locales
        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)
+
+       # command for `ls'
        gsub(/@ls/, "@$(LS)", string)
 
        return string
 }
+
+# print_recipe --- print out the recipe
+
+function print_recipe(         i, start)
+{
+       print recipe_lines[1]   # target:
+       if (line == 1)
+               return
+
+       # First line if it's @echo $@
+       if (recipe_lines[2] == "address@hidden $@") {
+               start = 3
+               print recipe_lines[2]
+       } else
+               start = 2
+
+       # print the right warning
+       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"
+       }
+
+       # Print all the lines but the last
+       for (i = start; i < line; i++)
+               print recipe_lines[i]
+
+       # Make sure last line starts with @- so that make will keep going
+       if (recipe_lines[i] ~ /address@hidden/)
+               print recipe_lines[i]
+       else if (recipe_lines[i] ~ /^\t@/)
+               printf "address@hidden", substr(recipe_lines[i], 3)
+       else
+               print recipe_lines[i]
+}
+
+# start_new_recipe --- start collecting data from scratch
+
+function start_new_recipe()
+{
+       # get the name of the target
+       name = gensub(/(^[[:alpha:]_][[:alnum:]_])*:.*/, "\\1", 1, $0)
+
+       delete recipe_lines
+       line = 0
+       recipe_lines[++line] = $0
+}
diff --git a/test/Makefile.in b/test/Makefile.in
index 219969f..9a5c11b 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1644,8 +1644,6 @@ 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 \
@@ -1663,14 +1661,6 @@ EXPECTED_FAIL_MINGW = \
        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 \

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

Summary of changes:
 pc/ChangeLog          |   4 ++
 pc/GenMakefileTst.awk | 117 ++++++++++++++++++++++++++++++++++----------------
 test/Makefile.in      |  10 -----
 3 files changed, 84 insertions(+), 47 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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