bug-bison
[Top][All Lists]
Advanced

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

Re: Bison 3.5.91 on OpenBSD 6.5


From: Akim Demaille
Subject: Re: Bison 3.5.91 on OpenBSD 6.5
Date: Sun, 3 May 2020 10:27:32 +0200

Hi Bruno,

> Le 3 mai 2020 à 03:45, Bruno Haible <address@hidden> a écrit :
> 
> On OpenBSD 6.5, it compiles fine, but "make check" has 1 test failure:
> bistromathic.

Actually I guess the main test suite was not run, blocked by this
failure.

Thanks a lot for the report!  I'll shy away from this.



commit e6db3f6c4a8837f75f9c4d811ca0c38903916c96
Author: Akim Demaille <address@hidden>
Date:   Sun May 3 10:21:24 2020 +0200

    examples: beware of portability issues with readline
    
    On OpenBSD 6.5, the prompt is repeated, but not the actual command
    line...  Don't try to cope with that.
    Reported by Bruno Haible.
    https://lists.gnu.org/r/bug-bison/2020-05/msg00015.html
    
    * examples/c/bistromathic/bistromathic.test: Skip when readline behave
    this way.

diff --git a/examples/c/bistromathic/bistromathic.test 
b/examples/c/bistromathic/bistromathic.test
index 1e5bd0e1..7d3a7002 100755
--- a/examples/c/bistromathic/bistromathic.test
+++ b/examples/c/bistromathic/bistromathic.test
@@ -15,12 +15,30 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# macOS' version of readline does not repeat stdin on stdout in
-# non-interactive mode.
-if ! echo '1-1' | prog | grep '1-1' >/dev/null; then
-   strip_prompt=true
+
+# Beware of portability issues of readline when not feeding it from a
+# terminal.
+#
+# With recent versions of GNU Readline, input "1+2*3\n" gives
+# "> 1+2*3\n7\n> \n"
+#
+# macOS' version does not display the prompt and does not repeat stdin
+# on stdout, so input "1+2*3\n" gives "7\n" as output.  Let's try to
+# cope with this.
+#
+# On OpenBSD 6.5 the prompt is displayed, but the input is not
+# repeated (!).  So input "1+2*3\n" gives "> 7\n> \n" as output.
+
+if ! echo '1-1' | prog | grep '>' >/dev/null; then
+    # macOS.
+    strip_prompt=true
+elif ! echo '1-1' | prog | grep '1-1' >/dev/null; then
+    # OpenBSD 6.5.  I don't want to spend time on this.
+    echo "SKIP: this is not the GNU Readline we expect"
+    exit 0
 fi
 
+
 cat >input <<EOF
 1+2*3
 EOF




reply via email to

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