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

shtests: Stop requiring a tty

It is desirable to be able to run the tests on a system without
a functioning tty. Since this distribution comes with its own
pseudo-tty facility, pty, it should be possible to run the few
tests that require a tty on the pseudo-tty instead. I've verified
that they fail as expected on older ksh93.

Discussion: https://github.com/ksh93/ksh/pull/171

src/cmd/ksh93/tests/basic.sh,
src/cmd/ksh93/tests/bracket.sh:
- Remove tests that require a tty.

src/cmd/ksh93/tests/pty.sh:
- Put them here, adapted to work as interactive pty scripts.

src/cmd/ksh93/tests/shtests:
- No longer refuse to run if there is no functioning tty.

.github/workflows/ci.yml:
- Since the tests no longer require a tty, no longer use script(1)
  to get a pseudo-tty. Let's see if this works...
- Re-enable the Mac runner (re: 14632361). Maybe it has improved.
This commit is contained in:
Martijn Dekker 2021-02-13 05:44:23 +00:00
parent a7121b6689
commit 5c389035d8
5 changed files with 104 additions and 61 deletions

View file

@ -14,19 +14,46 @@ jobs:
run: bin/package make
- name: Regression tests
run: |
PS4="$PS4 [ci.yml] "
PS4="$PS4[ci.yml] "
set -o xtrace
export TZ=UTC
ulimit -n 1024
: default regression tests &&
script -q -e -c "bin/shtests" &&
bin/shtests &&
: regression tests with OS-provided UTF-8 locales &&
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" &&
LANG=nl_NL.UTF-8 bin/shtests --locale --nocompile &&
LANG=ja_JP.UTF-8 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 &&
script -q -e -c "bin/shtests"
bin/shtests
MacOS:
name: macOS
runs-on: macos-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Build
run: bin/package make
- name: Regression tests
run: |
PS4="$PS4[ci.yml] "
set -o xtrace
export TZ=UTC
ulimit -n 1024
: default regression tests &&
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 &&
: disable most SHOPTs, rebuild ksh &&
sed -E -i.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