ref: 7bc42d468b43529ccefec1eb813ee11cfa8176e7
parent: 097999cad3c5c565c4e15695e691e603476bed00
author: ISSOtm <[email protected]>
date: Sat Dec 26 09:38:04 EST 2020
Clean up temp test files even if interrupted Avoids "tmp.*" piling up in /tmp
--- a/test/asm/test.sh
+++ b/test/asm/test.sh
@@ -9,6 +9,8 @@
errput="$(mktemp)"
rc=0
+trap "rm -f '$o' '$gb' '$input' '$output' '$errput'" EXIT
+
bold="$(tput bold)"
resbold="$(tput sgr0)"
red="$(tput setaf 1)"
@@ -93,5 +95,4 @@
done
done
-rm -f $o $gb $input $output
exit $rc
--- a/test/link/test.sh
+++ b/test/link/test.sh
@@ -7,6 +7,8 @@
outtemp=$(mktemp)
rc=0
+trap "rm -f '$otemp' '$gbtemp' '$gbtemp2' '$outtemp'" EXIT
+
bold=$(tput bold)
resbold=$(tput sgr0)
red=$(tput setaf 1)
@@ -112,5 +114,4 @@
rc=$(($? || $rc))
done
-rm -f $otemp $gbtemp $gbtemp2 $outtemp
exit $rc