From e3882fe71b0746dd64317105fad3963dc00280b1 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Tue, 23 Feb 2021 09:37:20 +0000 Subject: [PATCH] Only run pty tests on systems where pty is known to be good On some systems (AIX, HP-UX, OpenBSD) the pty tests may hang. On all systems except Darwin/macOS, FreeBSD and Linux, the pty tests show one or more regressions. But when I try out the failing tests manually in a real session, it seems to work fine. So I suspect pty is broken and not ksh. src/cmd/ksh93/tests/pty.sh: - For now, only run the pty tests on Darwin, FreeBSD and Linux. src/lib/libast/Mamfile: - tvsleep.c: Add missing error.h dependency (re: 2f7918de). (unrelated, but just wasn't worth its own commit) --- src/cmd/ksh93/tests/pty.sh | 7 +++++++ src/lib/libast/Mamfile | 1 + 2 files changed, 8 insertions(+) diff --git a/src/cmd/ksh93/tests/pty.sh b/src/cmd/ksh93/tests/pty.sh index 3b282be9a..31720769c 100755 --- a/src/cmd/ksh93/tests/pty.sh +++ b/src/cmd/ksh93/tests/pty.sh @@ -47,6 +47,13 @@ integer Errors=0 lineno=1 [[ -d $tmp && -w $tmp && $tmp == "$PWD" ]] || { err\_exit "$LINENO" '$tmp not set; run this from shtests. Aborting.'; exit 1; } whence -q pty || { warning "pty command not found -- tests skipped"; exit 0; } +case $(uname -s) in +Darwin | FreeBSD | Linux ) + ;; +* ) warning "pty not confirmed to work correctly on this system -- tests skipped" + exit 0 ;; +esac + # On some systems, the stty command does not appear to work correctly on a pty pseudoterminal. # To avoid false regressions, we have to set 'erase' and 'kill' on the real terminal. if test -t 0 2>/dev/null