bison-patches
[Top][All Lists]
Advanced

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

Re: fix getopt portability issues (was: [bison 3.1/test suite] all syncl


From: Akim Demaille
Subject: Re: fix getopt portability issues (was: [bison 3.1/test suite] all syncline tests failing Windows (illegal characters in test file names))
Date: Sat, 3 Nov 2018 08:03:43 +0100

Hi Jannick, hi Nelson!


> Le 28 oct. 2018 à 00:48, Jannick <address@hidden> a écrit :
> 
> On Sat, 27 Oct 2018 14:36:17 +0200, Akim Demaille wrote:
> 
>> Sure.  But I would like to know if the candidate 3.2 works properly in your
>> environment.
> 
> Finally it is through. In version 3.1.91.45-7175 one test fails. It is #1 for 
> which it looks like the expectation is right, but a bit scrambled (see 
> below). So nothing really bad I think.
> 
> ~~~
> +++ 
> /c/...../bison/bison-3.1.91.45-7175/bison-3.1.91.45-7175/tests/testsuite.dir/at-groups/1/stderr
>    2018-10-27 21:52:40.160216700 +0200
> @@ -1,3 +1,3 @@
> -bison: option '--skeleton' requires an argument
> +bison: option requires an argument -- skeleton
> Try 'bison --help' for more information.
> 
> 1. input.at:27: 1. Invalid number of arguments (input.at:27): FAILED 
> (input.at:39)
> ~~~


I installed the following patch for this.

commit 5a0d7802f4c21ce72a92e56f84338240f34e7ec1
Author: Akim Demaille <address@hidden>
Date:   Sat Nov 3 07:56:00 2018 +0100

    tests: work around getopt portability issues
    
    On some systems, we don't use our getopt.  As a consequence the error
    messages vary:
    
        $ bison --skeleton
        bison: option requires an argument -- skeleton
        Try 'bison --help' for more information.
    
    instead of
    
        bison: option '--skeleton' requires an argument
        Try 'bison --help' for more information.
    
    Reported by Jannick and Nelson H. F. Beebe.
    https://lists.gnu.org/archive/html/bison-patches/2018-10/msg00140.html
    
    * tests/input.at (Invalid number of arguments): work around getopt
    portability issues.

diff --git a/tests/input.at b/tests/input.at
index 11bbe37e..d9ea2956 100644
--- a/tests/input.at
+++ b/tests/input.at
@@ -36,7 +36,13 @@ AT_BISON_CHECK([1.y 2.y], [1], [],
 Try 'bison --help' for more information.
 ]])
 
-AT_BISON_CHECK([--skeleton], [1], [],
+# For some reason, on some systems we use the system's getopt, not the
+# one we ship in gnulib.  So we can get two different error messages.
+# See https://lists.gnu.org/archive/html/bison-patches/2018-10/msg00154.html
+AT_BISON_CHECK([--skeleton], [1], [], [stderr])
+AT_CHECK([[sed -e \
+  "s/requires an argument -- skeleton/'--skeleton' requires an argument/" \
+  stderr]], 0,
 [[bison: option '--skeleton' requires an argument
 Try 'bison --help' for more information.
 ]])




reply via email to

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