tests: Remove cleanup functions

This commit is contained in:
Roberto E. Vargas Caballero 2025-12-08 17:30:50 +01:00
parent ae50e31d53
commit c63dd6d499
6 changed files with 12 additions and 48 deletions

View File

@ -4,14 +4,8 @@ set -e
tmp=tmp1.$$
cleanup()
{
st=$?
rm -f $tmp
exit $st
}
trap cleanup EXIT
trap 'rm -f $tmp' EXIT
trap 'rm -f $tmp; kill -KILL $$' HUP INT TERM
../echo -n --hello-- --world--! > $tmp

View File

@ -5,14 +5,8 @@ set -e
res1=tmp1.$$
res2=tmp2.$$
cleanup()
{
st=$?
rm -f $res1 $res2
exit $st
}
trap cleanup EXIT
trap 'rm -f $res1 $res2' EXIT
trap 'rm -f $res1 $res2; kill -KILL $$' HUP INT TERM
(
../printf '123\n'

View File

@ -5,14 +5,8 @@ set -e
tmp1=tmp1.$$
tmp2=tmp2.$$
cleanup()
{
st=$?
rm -f $tmp1 $tmp2
exit $st
}
trap cleanup EXIT
trap 'rm -f $tmp1 $tmp2' EXIT
trap 'rm -f $tmp1 $tmp2; kill -KILL $$' HUP INT TERM
cat <<EOF >$tmp1
foo

View File

@ -5,14 +5,8 @@ set -e
tmp1=tmp1.$$
tmp2=tmp2.$$
cleanup()
{
st=$?
rm -f $tmp1 $tmp2
exit $st
}
trap cleanup EXIT
trap 'rm -f $tmp1 $tmp2' EXIT
trap 'rm -f $tmp1 $tmp2; kill -KILL $$' HUP INT TERM
printf foo >$tmp1
../ed $tmp1 <<EOF >$tmp2

View File

@ -4,14 +4,8 @@ set -e
tmp1=tmp1.$$
cleanup()
{
st=$?
rm -f $tmp1
exit $st
}
trap cleanup EXIT
trap 'rm -f $tmp1' EXIT
trap 'rm -f $tmp1; kill -KILL $$' HUP INT TERM
../ed <<EOF >$tmp1
i

View File

@ -2,14 +2,8 @@
export TZ=UTC
cleanup()
{
st=$?
rm -f test.res
exit $st
}
trap cleanup EXIT HUP INT TERM
trap 'rm -f test.res' EXIT HUP INT TERM
trap 'rm -f test.res' HUP INT TERM
for i in *-*.sh
do