mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
.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:
parent
2e6c56df82
commit
d790731a80
3 changed files with 8 additions and 14 deletions
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
|
@ -19,14 +19,14 @@ jobs:
|
||||||
export TZ=UTC
|
export TZ=UTC
|
||||||
ulimit -n 1024
|
ulimit -n 1024
|
||||||
: default regression tests &&
|
: default regression tests &&
|
||||||
bin/shtests &&
|
script -q -e -c "bin/shtests" &&
|
||||||
: regression tests with OS-provided UTF-8 locales &&
|
: regression tests with OS-provided UTF-8 locales &&
|
||||||
LANG=nl_NL.UTF-8 bin/shtests --locale --nocompile &&
|
LANG=nl_NL.UTF-8 script -q -e -c "bin/shtests --locale --nocompile" &&
|
||||||
LANG=ja_JP.UTF-8 bin/shtests --locale --nocompile &&
|
LANG=ja_JP.UTF-8 script -q -e -c "bin/shtests --locale --nocompile" &&
|
||||||
: disable most SHOPTs, rebuild ksh &&
|
: disable most SHOPTs, rebuild ksh &&
|
||||||
sed --regexp-extended --in-place=.orig \
|
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/' \
|
'/^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 &&
|
src/cmd/ksh93/SHOPT.sh &&
|
||||||
bin/package make &&
|
bin/package make &&
|
||||||
: default regression tests with SHOPTs disabled &&
|
: default regression tests with SHOPTs disabled &&
|
||||||
bin/shtests
|
script -q -e -c "bin/shtests"
|
||||||
|
|
|
@ -153,10 +153,6 @@ const struct shtable3 shtab_builtins[] =
|
||||||
#if !_std_malloc && !_AST_std_malloc
|
#if !_std_malloc && !_AST_std_malloc
|
||||||
CMDLIST(vmstate)
|
CMDLIST(vmstate)
|
||||||
#endif
|
#endif
|
||||||
#if !_AST_ksh_release
|
|
||||||
/* The pty.sh regression tests need the stty builtin */
|
|
||||||
CMDLIST(stty)
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
#if SHOPT_REGRESS
|
#if SHOPT_REGRESS
|
||||||
"__regress__", NV_BLTIN|BLT_ENV, bltin(__regress__),
|
"__regress__", NV_BLTIN|BLT_ENV, bltin(__regress__),
|
||||||
|
|
|
@ -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; }
|
[[ -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; }
|
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.
|
# On some systems, the 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.
|
# To avoid false regressions, we have to set 'erase' and 'kill' on the real terminal.
|
||||||
if builtin stty 2>/dev/null
|
if test -t 0 2>/dev/null </dev/tty && stty_restore=$(stty -g </dev/tty)
|
||||||
then PATH=/opt/ast/bin:$PATH # virtual path for ksh path-bound builtins, so child shells use the stty builtin
|
then trap 'stty "$stty_restore" </dev/tty' EXIT # note: on ksh, the EXIT trap is also triggered for termination due to a signal
|
||||||
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
|
|
||||||
stty erase ^H kill ^X
|
stty erase ^H kill ^X
|
||||||
else warning "cannot set tty state -- tests skipped"
|
else warning "cannot set tty state -- tests skipped"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue