1
0
kill-child-jobs/test/test-all.sh

47 lines
1002 B
Bash
Executable File

#!/bin/sh
set -e
DIR="$(dirname "$0")"
SHELLS="bash sh ash dash zsh ksh"
echo "Legend:"
echo " ∞=script does not halt (after 1 second timeout)"
echo " X=disown unsupported by shell"
echo " ☠=all children killed"
echo " 🏃=all children still running"
echo " ✔️=expected result (job killed, disowned child alive)"
echo
printf '\t'
for shell in $SHELLS
do
if ! command -v "$shell" >/dev/null
then
>&2 echo "Shell $shell not found."
exit 1
fi
printf '\t%s' "$shell"
done
printf '\n'
for script in "$DIR"/../*.sh
do
if [ -x "$script" ] && grep -qF 'kill_child_jobs()' "$script" && ! grep -qF 'wait' "$script"
then
name="$(basename "$script")"
printf '%s' "$name"
if [ ${#name} -lt 8 ]
then
printf '\t'
fi
for shell in $SHELLS
do
printf '\t'
"$DIR/test-kill-child-jobs.sh" "$script" "$shell" || true
done
printf '\n'
fi
done