From 5a0d7802f4c21ce72a92e56f84338240f34e7ec1 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 3 Nov 2018 07:56:00 +0100 Subject: [PATCH] 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. --- tests/input.at | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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. ]])