Parcourir la source

tests: ensure sponge-files are cleaned up properly

Git-Dch: Ignore
David Kalnischkies il y a 10 ans
Parent
commit
3685f84d8c
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      test/integration/run-tests

+ 2 - 0
test/integration/run-tests

@@ -47,6 +47,8 @@ fi
 if [ -n "$TESTTORUN" ]; then
 	# collecting the output of one test to have it together
 	OUTPUT="$(mktemp)"
+	CURRENTTRAP="rm -f \"$OUTPUT\"; $CURRENTTRAP"
+	trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
 	{
 		if [ "$MSGLEVEL" -le 2 ]; then
 			printf "${CTEST}Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}: "