Le 7 janv. 09 à 08:22, Summum Bonum a écrit :

Hi Bug-Bison,

Part of the Bison-2.4.1 testsuite failed on Solaris 10, and they are:

Failed tests:
GNU Bison 2.4.1 test suite test groups:

NUM: FILE-NAME:LINE     TEST-GROUP-NAME
     KEYWORDS

205: java.at:480        Java parser class and package names
206: java.at:501        Java parser class modifiers
207: java.at:559        Java parser class extends and implements
208: java.at:579        Java %parse-param and %lex-param
209: java.at:653        Java throws specifications
210: java.at:742        Java stype, position_class and location_class

That is caused by the java.at file uses Solaris grep and tries to use
illegal switch -q. With the change below for the poor Solaris users,
the java tests will run fine.

Thank you, I have installed the following patch in the newly created branch-2.4.2. I will also install it in master.

From 8defe11bfa8e614988f4f9cd66f9abcd051b8abb Mon Sep 17 00:00:00 2001
From: Akim Demaille <[email protected]>
Date: Thu, 8 Jan 2009 09:41:21 +0100
Subject: [PATCH] Fix grep portability issues.

Grep on Solaris does not support -q.
Reported by Summum Bonum.

        * NEWS: Add a stub for 2.4.2.
        * THANKS: Add Summum Bonum.
        * tests/atlocal.in (EGREP): New.
        (CC, CXX, XSLTPROC): Make it possible to override them via
        envvars.
        * tests/java.at: Use $EGREP instead of egrep.
        Use AT_CHECK's ignore instead of grep's -q.
---
 ChangeLog        |   14 ++++++++++++++
 NEWS             |    6 ++++--
 THANKS           |    3 ++-
 tests/atlocal.in |   13 ++++++++-----
 tests/java.at    |   22 +++++++++++-----------
 5 files changed, 39 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f28a847..5320ec3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2009-01-08  Akim Demaille  <[email protected]>
+
+       Fix grep portability issues.
+       Grep on Solaris does not support -q.
+       Reported by Summum Bonum.
+       
+       * NEWS: Add a stub for 2.4.2.
+       * THANKS: Add Summum Bonum.
+       * tests/atlocal.in (EGREP): New.
+       (CC, CXX, XSLTPROC): Make it possible to override them via
+       envvars.
+       * tests/java.at: Use $EGREP instead of egrep.
+       Use AT_CHECK's ignore instead of grep's -q.
+
 2008-12-11  Joel E. Denny  <[email protected]>
 
        Version 2.4.1.
diff --git a/NEWS b/NEWS
index 7d1a444..69c6d3b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
 Bison News
 ----------
 
+* Changes in version 2.4.2 (????-??-??):
+
 * Changes in version 2.4.1 (2008-12-11):
 
 ** In the GLR defines file, unexpanded M4 macros in the yylval and yylloc
@@ -1049,9 +1051,9 @@ End:
 -----
 
 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
-This file is part of Bison, the GNU Compiler Compiler.
+This file is part of Bison, the GNU Parser Generator.
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/THANKS b/THANKS
index 40291c7..d7adddd 100644
--- a/THANKS
+++ b/THANKS
@@ -78,11 +78,12 @@ Raja R Harinath           [email protected]
 Richard Stallman          [email protected]
 Robert Anisko             [email protected]
 Satya Kiran Popuri        [email protected]
-Sebastien Fricker         [email protected]
 Sebastian Setzer          [email protected]
+Sebastien Fricker         [email protected]
 Sergei Steshenko          [email protected]
 Shura                     [email protected]
 Steve Murphy              [email protected]
+Summum Bonum              [email protected]
 Tim Josling               [email protected]
 Tim Van Holder            [email protected]
 Tom Lane                  [email protected]
diff --git a/tests/atlocal.in b/tests/atlocal.in
index 1a5f5f4..91ba674 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -1,11 +1,11 @@
 # @configure_input@                                    -*- shell-script -*-
 # Configurable variable values for Bison test suite.
 
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free
-# Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+# 2009 Free Software Foundation, Inc.
 
 # We need a C compiler.
-CC='@CC@'
+: ${CC='@CC@'}
 
 # We want no optimization.
 CFLAGS='@O0CFLAGS@ @WARN_CFLAGS@ @WERROR_CFLAGS@'
@@ -17,7 +17,7 @@ CPPFLAGS="-I$abs_top_builddir/lib @CPPFLAGS@"
 GCC='@GCC@'
 
 # The C++ compiler.
-CXX='@CXX@'
+: ${CXX='@CXX@'}
 
 # If 'exit 77'; skip all C++ tests; otherwise ':'.
 BISON_CXX_WORKS='@BISON_CXX_WORKS@'
@@ -38,4 +38,7 @@ CONF_JAVAC='@CONF_JAVAC@'
 CONF_JAVA='@CONF_JAVA@'
 
 # Empty if no xsltproc was found
-XSLTPROC='@XSLTPROC@'
+: ${XSLTPROC='@XSLTPROC@'}
+
+# We need egrep.
+: ${EGREP='@EGREP@'}
diff --git a/tests/java.at b/tests/java.at
index a3e1a0e..ac6564f 100644
--- a/tests/java.at
+++ b/tests/java.at
@@ -1,6 +1,6 @@
 # Java tests for simple calculator.           -*- Autotest -*-
 
-# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -134,7 +134,7 @@ AT_LOCATION_IF([[
 ]], [[
   public void yyerror (String s)
   {
-    System.err.println (s); 
+    System.err.println (s);
   }
 ]])[
 
@@ -342,7 +342,7 @@ _AT_CHECK_JAVA_CALC_ERROR([$1], [/dev/null],
 #   first error is ")", which is needed to recover from the error and
 #   produce the "0" that triggers the "0 != 1" error.
 #
-_AT_CHECK_JAVA_CALC_ERROR([$1], 
+_AT_CHECK_JAVA_CALC_ERROR([$1],
                           [() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1],
 [1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
 1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
@@ -426,7 +426,7 @@ start: "end" {$2};
 class m4_default([$3], [Position]) {}
 ])
 AT_BISON_CHECK([[YYParser.y]])
-AT_CHECK([[grep -q '[mb]4_' YYParser.y]], [1])
+AT_CHECK([[grep '[mb]4_' YYParser.y]], [1], [ignore])
 AT_JAVA_COMPILE([[YYParser.java]])
 ])
 
@@ -458,7 +458,7 @@ m4_define([AT_CHECK_JAVA_MINIMAL_W_LEXER],
   {
     $3
   }
-  
+
   $4
 }], [$5], [$7])])
 
@@ -747,9 +747,9 @@ AT_CHECK_JAVA_MINIMAL([[
 %define location_type "MyLoc"
 %define position_type "MyPos"
 %code { class MyPos {} }]], [[$$ = $<java.awt.Color>1;]], [[MyPos]])
-AT_CHECK([[grep -q 'java.awt.Color' YYParser.java]])
-AT_CHECK([[egrep -v ' */?\*' YYParser.java | grep -q 'Position']], [1])
-AT_CHECK([[egrep -v ' */?\*' YYParser.java | grep -q 'Location']], [1])
+AT_CHECK([[grep 'java.awt.Color' YYParser.java]], [0], [ignore])
+AT_CHECK([[$EGREP -v ' */?\*' YYParser.java | grep 'Position']], [1], [ignore])
+AT_CHECK([[$EGREP -v ' */?\*' YYParser.java | grep 'Location']], [1], [ignore])
 
 AT_CHECK_JAVA_MINIMAL_W_LEXER([[
 %define stype "java.awt.Color"
@@ -759,8 +759,8 @@ AT_CHECK_JAVA_MINIMAL_W_LEXER([[
 %code { class MyPos {} }]], [], [[return EOF;]], [],
 [[$$ = $<java.awt.Color>1;]],
 [[java.awt.Color]], [[MyPos]], [[MyLoc]])
-AT_CHECK([[grep -q 'java.awt.Color' YYParser.java]])
-AT_CHECK([[egrep -v ' */?\*' YYParser.java | grep -q 'Position']], [1])
-AT_CHECK([[egrep -v ' */?\*' YYParser.java | grep -q 'Location']], [1])
+AT_CHECK([[grep 'java.awt.Color' YYParser.java]], [0], [ignore])
+AT_CHECK([[$EGREP -v ' */?\*' YYParser.java | grep 'Position']], [1], [ignore])
+AT_CHECK([[$EGREP -v ' */?\*' YYParser.java | grep 'Location']], [1], [ignore])
 
 AT_CLEANUP
-- 
1.6.0.4.790.gaa14a



(Thank you very much for the patch! Please note that it was reversed, it is nicer to use when you run "diff old new" rather than "diff new old").

Reply via email to