From 1849aee2d184e1ece5361d8e3d3ed15a4e3d101f Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 1 Nov 2023 18:41:57 -0700 Subject: [PATCH] tests: Try another strategy to check for immediate output. The previous strategy hung on some machines and failed on others. The failures are sometimes sensitive to whether libreadline is available. I hope that this avoids the problem. --- tests/ui/terminal/main.at | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/ui/terminal/main.at b/tests/ui/terminal/main.at index 8a692017b7..e62eefd3d8 100644 --- a/tests/ui/terminal/main.at +++ b/tests/ui/terminal/main.at @@ -74,17 +74,11 @@ dnl Bug #63910 reported that command output was delayed until the dnl next command was supplied. This checks for regression against dnl that bug. AT_SETUP([interactive output appears immediately]) -dnl The crucial thing to notice below is that the SHOW output -dnl must appear before the prompt for FINISH. -AT_CHECK([echo 'SHOW N. -FINISH.' | PSPP_INTERACTIVE=1 pspp], [0], [stdout]) -AT_CHECK([sed -n 's/ $// -/^PSPP>/,$p' stdout], [0], [dnl -PSPP> SHOW N. - Settings -+-+-------+ -|N|Unknown| -+-+-------+ -PSPP> FINISH. +dnl This uses concatenation with + so that just printing the +dnl command itself doesn't make "text string" appear in the +dnl output. +AT_CHECK([(echo 'ECHO "text"+" "+"string".'; sleep 10) | PSPP_INTERACTIVE=1 pspp & sleep 1; kill $!], [0], [stdout]) +cat stdout +AT_CHECK([grep 'text string' stdout], [0], [text string ]) AT_CLEANUP -- 2.30.2