summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author B. Watson2023-07-06 22:09:00 +0200
committer Willy Sudiarto Raharjo2023-07-08 11:42:08 +0200
commit8159498005364f5c67d8024163d081d2c5be37ef (patch)
tree9aae8e8751e8584f347dc522e370c313065ba6f3
parent49703e7c02f24fcd777f25aaa3557eea334ca2a0 (diff)
downloadslackbuilds-8159498005364f5c67d8024163d081d2c5be37ef.tar.gz
system/mksh: Only run tests if stdin/out are TTYs.
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--system/mksh/mksh.SlackBuild12
1 files changed, 11 insertions, 1 deletions
diff --git a/system/mksh/mksh.SlackBuild b/system/mksh/mksh.SlackBuild
index ac0a66c687..ae3909e33e 100644
--- a/system/mksh/mksh.SlackBuild
+++ b/system/mksh/mksh.SlackBuild
@@ -7,6 +7,9 @@
# Original author: Markus Reichelt, Aachen, DE
# Now maintained by B. Watson <urchlay@slackware.uk>
+# 20230706 bkw:
+# - only run test.sh if both stdin and stdout are TTYs.
+
# 20230102 bkw: BUILD=2
# - take over maintenance.
# - relicense as WTFPL.
@@ -94,6 +97,13 @@ chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+# 20230706 bkw: only run test.sh if stdin and stdout are TTYs, to avoid
+# the test script hanging forever.
+T=no
+[ -t 0 -a -t 1 ] && T=yes
+TESTS=${TESTS:-$T}
+echo "=== run tests? $TESTS"
+
LDFLAGS="$LDFLAGS" \
CPPFLAGS="$CPPFLAGS" \
CFLAGS="$SLKCFLAGS" \
@@ -106,7 +116,7 @@ CC="$CC" \
# thanks alpine maintainers.
# 20230102 bkw: make tests optional with TESTS=no. This is a maintainer-mode
# option (saves me time if I'm repeatedly editing/running the script).
-if [ "${TESTS:-yes}" = "yes" ]; then
+if [ "$TESTS" = "yes" ]; then
sed -i -e '/^name: selftest-tty-absent$/,/^---$/d' check.t
./test.sh -C regress:no-ctty
fi