Skip to content

Commit 7102fec

Browse files
committed
tests: Switch from unbuffer to ptyx
unbuffer is part of expect, which is not actively maintained. This recently led to a CI failure on NetBSD which looked like can't find package Expect while executing "package require Expect" (file "/usr/pkg/bin/unbuffer" line 6) Rather than debug this, I just reimplemented unbuffer myself. This also reduces our test dependencies, which is nice. Link: https://sourceforge.net/p/expect/bugs/107/ Link: https://github.com/tavianator/bfs/actions/runs/14421150823/job/40444068385
1 parent 52e1a31 commit 7102fec

4 files changed

Lines changed: 5 additions & 22 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ jobs:
1616
sudo dpkg --add-architecture i386
1717
sudo apt-get update -y
1818
sudo apt-get install -y \
19-
expect \
2019
mandoc \
2120
gcc-multilib \
2221
libgcc-s1:i386 \
@@ -57,7 +56,6 @@ jobs:
5756
run: |
5857
sudo apt-get update -y
5958
sudo apt-get install -y \
60-
expect \
6159
mandoc \
6260
acl \
6361
libacl1-dev \
@@ -110,10 +108,8 @@ jobs:
110108
run: |
111109
sudo pkg install -y \
112110
bash \
113-
expect \
114111
oniguruma \
115-
pkgconf \
116-
tcl-wrapper
112+
pkgconf
117113
sudo mount -t fdescfs none /dev/fd
118114
.github/diag.sh make -j$(nproc) distcheck
119115
@@ -139,7 +135,6 @@ jobs:
139135
run: |
140136
sudo pkg_add \
141137
bash \
142-
expect \
143138
gmake \
144139
oniguruma
145140
jobs=$(sysctl -n hw.ncpu)
@@ -170,8 +165,7 @@ jobs:
170165
sudo pkgin -y install \
171166
bash \
172167
oniguruma \
173-
pkgconf \
174-
tcl-expect
168+
pkgconf
175169
jobs=$(sysctl -n hw.ncpu)
176170
./configure
177171
.github/diag.sh make -j$jobs check TEST_FLAGS="--sudo --verbose=skipped"
@@ -198,11 +192,9 @@ jobs:
198192
prepare: |
199193
pkg install -y \
200194
bash \
201-
expect \
202195
oniguruma \
203196
pkgconf \
204-
sudo \
205-
tcl-wrapper
197+
sudo
206198
pw useradd -n action -m -G wheel -s /usr/local/bin/bash
207199
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >>/usr/local/etc/sudoers
208200
@@ -235,7 +227,6 @@ jobs:
235227
pkg install \
236228
bash \
237229
build-essential \
238-
expect \
239230
gnu-make \
240231
onig \
241232
sudo

.github/workflows/codecov.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
run: |
1414
sudo apt-get update -y
1515
sudo apt-get install -y \
16-
expect \
1716
gcc \
1817
acl \
1918
libacl1-dev \

tests/run.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -362,20 +362,12 @@ invoke_bfs() {
362362
fi
363363
}
364364

365-
if command -v unbuffer &>/dev/null; then
366-
UNBUFFER=unbuffer
367-
elif command -v expect_unbuffer &>/dev/null; then
368-
UNBUFFER=expect_unbuffer
369-
fi
370-
371365
# Run bfs with a pseudo-terminal attached
372366
bfs_pty() {
373-
test -n "${UNBUFFER:-}" || skip
374-
375367
bfs_verbose "$@"
376368

377369
local ret=0
378-
"$UNBUFFER" bash -c 'stty cols 80 rows 24 && "$@" </dev/null' bash "${BFS[@]}" "$@" || ret=$?
370+
"$PTYX" -w80 -h24 -- "${BFS[@]}" "$@" || ret=$?
379371

380372
if ((ret > 125)); then
381373
exit $ret

tests/util.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ ROOT=$(_realpath "$(dirname -- "$TESTS")")
1616
TESTS="$ROOT/tests"
1717
BIN="$ROOT/bin"
1818
MKSOCK="$BIN/tests/mksock"
19+
PTYX="$BIN/tests/ptyx"
1920
XTOUCH="$BIN/tests/xtouch"
2021
UNAME=$(uname)
2122

0 commit comments

Comments
 (0)