1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

github: Revert failed experiment (re: 2e6c56df, 9ad9a1de, 5c389035)

.github/workflows/ci.yml:
- Go back to wrapping the regression tests in script(1).

src/cmd/ksh93/data/builtins.c:
- Never mind about the stty builtin.

src/cmd/ksh93/tests/pty.sh:
- Refuse to run if there isn't a functioning tty.
- Make sure stty(1) works on /dev/tty by redirecting stdin.
This commit is contained in:
Martijn Dekker 2021-02-13 13:48:35 +00:00
parent 2e6c56df82
commit d790731a80
3 changed files with 8 additions and 14 deletions

View file

@ -19,14 +19,14 @@ jobs:
export TZ=UTC
ulimit -n 1024
: default regression tests &&
bin/shtests &&
script -q -e -c "bin/shtests" &&
: regression tests with OS-provided UTF-8 locales &&
LANG=nl_NL.UTF-8 bin/shtests --locale --nocompile &&
LANG=ja_JP.UTF-8 bin/shtests --locale --nocompile &&
LANG=nl_NL.UTF-8 script -q -e -c "bin/shtests --locale --nocompile" &&
LANG=ja_JP.UTF-8 script -q -e -c "bin/shtests --locale --nocompile" &&
: disable most SHOPTs, rebuild ksh &&
sed --regexp-extended --in-place=.orig \
'/^SHOPT (2DMATCH|AUDIT|BGX|BRACEPAT|DYNAMIC|EDPREDICT|ESH|FIXEDARRAY|HISTEXPAND|MULTIBYTE|NAMESPACE|OPTIMIZE|SUID_EXEC|STATS|VSH)=/ s/=1/=0/' \
src/cmd/ksh93/SHOPT.sh &&
bin/package make &&
: default regression tests with SHOPTs disabled &&
bin/shtests
script -q -e -c "bin/shtests"

View file

@ -153,10 +153,6 @@ const struct shtable3 shtab_builtins[] =
#if !_std_malloc && !_AST_std_malloc
CMDLIST(vmstate)
#endif
#if !_AST_ksh_release
/* The pty.sh regression tests need the stty builtin */
CMDLIST(stty)
#endif
#endif
#if SHOPT_REGRESS
"__regress__", NV_BLTIN|BLT_ENV, bltin(__regress__),

View file

@ -47,12 +47,10 @@ 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; }
# On FreeBSD, or if there is no tty, the OS-provided stty command does not appear to work correctly on a pty pseudoterminal.
# To avoid false regressions, we have to either use the stty builtin, or set 'erase' and 'kill' on the real terminal.
if builtin stty 2>/dev/null
then PATH=/opt/ast/bin:$PATH # virtual path for ksh path-bound builtins, so child shells use the stty builtin
elif test -t 1 2>/dev/null 1>/dev/tty && stty_restore=$(stty -g)
then trap 'stty "$stty_restore"' EXIT # note: on ksh, the EXIT trap is also triggered for termination due to a signal
# 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 </dev/tty && stty_restore=$(stty -g </dev/tty)
then trap 'stty "$stty_restore" </dev/tty' EXIT # note: on ksh, the EXIT trap is also triggered for termination due to a signal
stty erase ^H kill ^X
else warning "cannot set tty state -- tests skipped"
exit 0