summaryrefslogtreecommitdiff
path: root/init.cfg
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2020-03-01 21:49:16 +0000
committerPádraig Brady <P@draigBrady.com>2020-03-01 22:02:39 +0000
commit04e2b9b1a637ea138331a1b6a6b11849368d3467 (patch)
tree72a36ad0dd5626929a673cd2a444d5a91f74e5fa /init.cfg
parent5cdab9f26b4167d49a9f63dd343c2f8a14aa3070 (diff)
downloadcoreutils-04e2b9b1a637ea138331a1b6a6b11849368d3467.tar.gz
tests: use bash in some scripts to avoid false failures
* init.cfg (require_bash_as_SHELL_): A new function to replace SHELL for the current test, with bash if available. This is useful on OpenIndiana 11 where /bin/sh was seen to have races in handling of SIGPIPE. * tests/misc/seq-epipe.sh: Use the new function to enforce bash. * tests/misc/env-signal-handler.sh: Likewise. Reported by Bruno Haible
Diffstat (limited to 'init.cfg')
-rw-r--r--init.cfg9
1 files changed, 9 insertions, 0 deletions
diff --git a/init.cfg b/init.cfg
index 2009e294e..8385963f4 100644
--- a/init.cfg
+++ b/init.cfg
@@ -629,6 +629,15 @@ trap_sigpipe_or_skip_()
skip_ 'trapping SIGPIPE is not supported'
}
+require_bash_as_SHELL_()
+{
+ if bash --version >/dev/null 2>&1; then
+ SHELL='bash'
+ else
+ skip_ 'bash is required'
+ fi
+}
+
# Disable the current test if the working directory seems to have
# the setgid bit set.
skip_if_setgid_()