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.
This commit is contained in:
Akim Demaille
2018-11-03 07:56:00 +01:00
parent f1e0839c9e
commit 5a0d7802f4

View File

@@ -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.
]])