Skip to content

Commit

Permalink
always create $tmpdir in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kyz committed Feb 19, 2023
1 parent e315591 commit 526df93
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
9 changes: 0 additions & 9 deletions cabextract/test/large-files.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@
# because it takes a long time and needs 12GB of temporary space
. test/testcase

tmpdir=`mktemp -d`

trap cleanup2 0 1 2
cleanup2() {
cd /
rm -rf $tmpdir
cleanup
}

# extract large-files.cab
"$cabextract" -q -d $tmpdir cabs/large-files-cab.cab

Expand Down
9 changes: 1 addition & 8 deletions cabextract/test/symlinks.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@

set -e # every command is a test!

tmpdir=`mktemp -d`
trap cleanup2 0 1 2
cleanup2() {
rm -rf $tmpdir
cleanup
}

# set up a symlinked file and symlinked directory
# extract $tmpdir/plain.c and $tmpdir/1/2/3/4.c
# check they did NOT get written to $tmpdir/other.c and $tmpdir/other/4.c
Expand Down Expand Up @@ -60,4 +53,4 @@ read H < $tmpdir/fake/dest/plain.c
read W < $tmpdir/fake/dest/1/2/3/4.c
[ "$H" = "hello" -a "$W" = "world" ]

exit 0
exit 0
5 changes: 3 additions & 2 deletions cabextract/test/testcase.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
cabextract="@abs_top_builddir@/cabextract@EXEEXT@"
cd "@abs_srcdir@"

status=`mktemp`
tmpdir=`mktemp -d`
status=$tmpdir/status
expected=$status.expected
actual=$status.actual
echo success >$status
echo success >$status || exit 1

trap cleanup 0 1 2
cleanup() {
Expand Down

0 comments on commit 526df93

Please sign in to comment.