From: Ben Pfaff Date: Thu, 2 Nov 2023 01:41:57 +0000 (-0700) Subject: tests: Try another strategy to check for immediate output. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1849aee2d184e1ece5361d8e3d3ed15a4e3d101f;p=pspp 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. --- 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