shithub: scc

Download patch

ref: 05f7f88c948840fbfcabc5e8e0e946e705530f80
parent: aec67e43c52fcc1857d00d498d82189bbf0f680a
author: Quentin Rameau <quinq@fifth.space>
date: Mon Sep 3 14:20:50 EDT 2018

[tests] Actually exit after trap catched a signal

--- a/tests/ar/execute/0001-append.sh
+++ b/tests/ar/execute/0001-append.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3
+trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2; exit" 0 2 3
 
 ###########################################################################
 #Append generated files at once to an empty archive
--- a/tests/ar/execute/0002-append.sh
+++ b/tests/ar/execute/0002-append.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3
+trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2; exit" 0 2 3
 
 ###########################################################################
 #Append generated files one by one to an empty file
--- a/tests/ar/execute/0003-append.sh
+++ b/tests/ar/execute/0003-append.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* f1 f2 f3 $tmp1 $tmp2" 0 2 3
+trap "rm -f file* f1 f2 f3 $tmp1 $tmp2; exit" 0 2 3
 
 ###########################################################################
 #Append generated files at once to an existing archive
--- a/tests/ar/execute/0004-append.sh
+++ b/tests/ar/execute/0004-append.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3
+trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2; exit" 0 2 3
 
 ###########################################################################
 #empty file list
--- a/tests/ar/execute/0005-append.sh
+++ b/tests/ar/execute/0005-append.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3
+trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2; exit" 0 2 3
 
 ###########################################################################
 #empty file list
--- a/tests/ar/execute/0006-append.sh
+++ b/tests/ar/execute/0006-append.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3
+trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2; exit" 0 2 3
 
 ###########################################################################
 #empty file list
--- a/tests/ar/execute/0007-delete.sh
+++ b/tests/ar/execute/0007-delete.sh
@@ -3,7 +3,7 @@
 
 set -e
 
-trap "rm -f file.a" 0 2 3
+trap "rm -f file.a; exit" 0 2 3
 
 ############################################################################
 #delete one member
--- a/tests/ar/execute/0008-delete.sh
+++ b/tests/ar/execute/0008-delete.sh
@@ -3,7 +3,7 @@
 
 set -e
 
-trap "rm -f file.a" 0 2 3
+trap "rm -f file.a; exit" 0 2 3
 
 ############################################################################
 #delete two members, 1st and 2nd
--- a/tests/ar/execute/0009-delete.sh
+++ b/tests/ar/execute/0009-delete.sh
@@ -3,7 +3,7 @@
 
 set -e
 
-trap "rm -f file.a" 0 2 3
+trap "rm -f file.a; exit" 0 2 3
 
 ############################################################################
 #delete two members, 2nd and 3rd
--- a/tests/ar/execute/0010-delete.sh
+++ b/tests/ar/execute/0010-delete.sh
@@ -3,7 +3,7 @@
 
 set -e
 
-trap "rm -f file.a" 0 2 3
+trap "rm -f file.a; exit" 0 2 3
 
 ############################################################################
 #remove all the members
--- a/tests/ar/execute/0011-delete.sh
+++ b/tests/ar/execute/0011-delete.sh
@@ -3,7 +3,7 @@
 
 set -e
 
-trap "rm -f file.a" 0 2 3
+trap "rm -f file.a; exit" 0 2 3
 
 ############################################################################
 #no members
--- a/tests/ar/execute/0012-delete.sh
+++ b/tests/ar/execute/0012-delete.sh
@@ -3,7 +3,7 @@
 
 set -e
 
-trap "rm -f file.a" 0 2 3
+trap "rm -f file.a; exit" 0 2 3
 
 ############################################################################
 #delete one member
--- a/tests/ar/execute/0013-print.sh
+++ b/tests/ar/execute/0013-print.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #print 1st member
--- a/tests/ar/execute/0014-print.sh
+++ b/tests/ar/execute/0014-print.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #print 3rd member
--- a/tests/ar/execute/0015-print.sh
+++ b/tests/ar/execute/0015-print.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #print 2nd member with verbose
--- a/tests/ar/execute/0016-print.sh
+++ b/tests/ar/execute/0016-print.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #print all members
--- a/tests/ar/execute/0017-print.sh
+++ b/tests/ar/execute/0017-print.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3
 
 #and now with no members in command line
 
--- a/tests/ar/execute/0018-list.sh
+++ b/tests/ar/execute/0018-list.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #list 1st member
--- a/tests/ar/execute/0019-list.sh
+++ b/tests/ar/execute/0019-list.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #print 3rd member
--- a/tests/ar/execute/0020-list.sh
+++ b/tests/ar/execute/0020-list.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #print 2nd member with verbose
--- a/tests/ar/execute/0021-list.sh
+++ b/tests/ar/execute/0021-list.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #print all members
--- a/tests/ar/execute/0022-list.sh
+++ b/tests/ar/execute/0022-list.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file.a $tmp1 $tmp2" 0 2 3
+trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #list 1st member
--- a/tests/ar/execute/0023-extract.sh
+++ b/tests/ar/execute/0023-extract.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #extract 1st member
--- a/tests/ar/execute/0024-extract.sh
+++ b/tests/ar/execute/0024-extract.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #extract 3rd member
--- a/tests/ar/execute/0025-extract.sh
+++ b/tests/ar/execute/0025-extract.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #extract 3rd member
--- a/tests/ar/execute/0026-extract.sh
+++ b/tests/ar/execute/0026-extract.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #extract all members
--- a/tests/ar/execute/0027-extract.sh
+++ b/tests/ar/execute/0027-extract.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #extract without parameters
--- a/tests/ar/execute/0029-move.sh
+++ b/tests/ar/execute/0029-move.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #move 1st without specifier
--- a/tests/ar/execute/0030-move.sh
+++ b/tests/ar/execute/0030-move.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #move 1st at the end
--- a/tests/ar/execute/0031-move.sh
+++ b/tests/ar/execute/0031-move.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #and now, test without parameters
--- a/tests/ar/execute/0032-update.sh
+++ b/tests/ar/execute/0032-update.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #Update one member that already exist
--- a/tests/ar/execute/0033-update.sh
+++ b/tests/ar/execute/0033-update.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #Update one member that doesn't exist
--- a/tests/ar/execute/0034-update.sh
+++ b/tests/ar/execute/0034-update.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #Update one member that exists and using -a
--- a/tests/ar/execute/0035-update.sh
+++ b/tests/ar/execute/0035-update.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #Update one member that exists and using -b
--- a/tests/ar/execute/0036-update.sh
+++ b/tests/ar/execute/0036-update.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #Update one member that doesn't exist and using -b
--- a/tests/ar/execute/0037-update.sh
+++ b/tests/ar/execute/0037-update.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #Update one member that doesn't exist and using -a
--- a/tests/ar/execute/0038-update.sh
+++ b/tests/ar/execute/0038-update.sh
@@ -5,7 +5,7 @@
 tmp1=`mktemp`
 tmp2=`mktemp`
 
-trap "rm -f file* $tmp1 $tmp2" 0 2 3
+trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3
 
 ############################################################################
 #Update without parameters
--- a/tests/ar/execute/chktest.sh
+++ b/tests/ar/execute/chktest.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-trap "rm -rf file*" 0 2 3 15
+trap "rm -rf file*; exit" 0 2 3 15
 ulimit -c 0
 rm -f test.log
 rm -rf file*
--- a/tests/as/execute/test.sh
+++ b/tests/as/execute/test.sh
@@ -9,7 +9,7 @@
 tmp2=`mktemp`
 file=$cpu.s
 
-trap "rm -f a.out $tmp1 $tmp2" 0 2 3 
+trap "rm -f a.out $tmp1 $tmp2; exit" 0 2 3
 
 as-$cpu $file
 
--- a/tests/libc/execute/chktest.sh
+++ b/tests/libc/execute/chktest.sh
@@ -3,7 +3,7 @@
 file=${1?' empty input file'}
 tmp1=`mktemp`
 tmp2=`mktemp`
-trap "rm -f a.out *.o $tmp1 $tmp2" 0 1 2 3 15
+trap "rm -f a.out *.o $tmp1 $tmp2; exit" 0 1 2 3 15
 ulimit -c 0
 rm -f test.log
 
--- a/tests/nm/execute/0001-z80.sh
+++ b/tests/nm/execute/0001-z80.sh
@@ -4,7 +4,7 @@
 
 tmp1=`mktemp`
 tmp2=`mktemp`
-trap "rm -f $tmp1 $tmp2" 0 2 3
+trap "rm -f $tmp1 $tmp2; exit" 0 2 3
 
 nm z80.out > $tmp1
 
--- a/tests/nm/execute/0002-z80-u.sh
+++ b/tests/nm/execute/0002-z80-u.sh
@@ -4,7 +4,7 @@
 
 tmp1=`mktemp`
 tmp2=`mktemp`
-trap "rm -f $tmp1 $tmp2" 0 2 3
+trap "rm -f $tmp1 $tmp2; exit" 0 2 3
 
 nm -u z80.out > $tmp1
 
--- a/tests/nm/execute/0003-z80-g.sh
+++ b/tests/nm/execute/0003-z80-g.sh
@@ -4,7 +4,7 @@
 
 tmp1=`mktemp`
 tmp2=`mktemp`
-trap "rm -f $tmp1 $tmp2" 0 2 3
+trap "rm -f $tmp1 $tmp2; exit" 0 2 3
 
 nm -g z80.out > $tmp1
 
--- a/tests/nm/execute/0004-z80-v.sh
+++ b/tests/nm/execute/0004-z80-v.sh
@@ -4,7 +4,7 @@
 
 tmp1=`mktemp`
 tmp2=`mktemp`
-trap "rm -f $tmp1 $tmp2" 0 2 3
+trap "rm -f $tmp1 $tmp2; exit" 0 2 3
 
 nm -v z80.out > $tmp1
 
--- a/tests/nm/execute/0005-z80-A.sh
+++ b/tests/nm/execute/0005-z80-A.sh
@@ -4,7 +4,7 @@
 
 tmp1=`mktemp`
 tmp2=`mktemp`
-trap "rm -f f.out f.a $tmp1 $tmp2" 0 2 3
+trap "rm -f f.out f.a $tmp1 $tmp2; exit" 0 2 3
 
 rm -f f.a
 ar -qv f.a z80.out
--- a/tests/nm/execute/0006-z80-o.sh
+++ b/tests/nm/execute/0006-z80-o.sh
@@ -4,7 +4,7 @@
 
 tmp1=`mktemp`
 tmp2=`mktemp`
-trap "rm -f $tmp1 $tmp2" 0 2 3
+trap "rm -f $tmp1 $tmp2; exit" 0 2 3
 
 nm -t o z80.out > $tmp1
 
--- a/tests/nm/execute/0007-z80-d.sh
+++ b/tests/nm/execute/0007-z80-d.sh
@@ -4,7 +4,7 @@
 
 tmp1=`mktemp`
 tmp2=`mktemp`
-trap "rm -f $tmp1 $tmp2" 0 2 3
+trap "rm -f $tmp1 $tmp2; exit" 0 2 3
 
 nm -t d z80.out > $tmp1
 
--- a/tests/nm/execute/0008-z80-x.sh
+++ b/tests/nm/execute/0008-z80-x.sh
@@ -4,7 +4,7 @@
 
 tmp1=`mktemp`
 tmp2=`mktemp`
-trap "rm -f $tmp1 $tmp2" 0 2 3
+trap "rm -f $tmp1 $tmp2; exit" 0 2 3
 
 nm -t x z80.out > $tmp1
 
--- a/tests/nm/execute/0009-z80-P-o.sh
+++ b/tests/nm/execute/0009-z80-P-o.sh
@@ -4,7 +4,7 @@
 
 tmp1=`mktemp`
 tmp2=`mktemp`
-trap "rm -f $tmp1 $tmp2" 0 2 3
+trap "rm -f $tmp1 $tmp2; exit" 0 2 3
 
 nm -P -t o z80.out > $tmp1
 
--- a/tests/nm/execute/0010-z80-P-d.sh
+++ b/tests/nm/execute/0010-z80-P-d.sh
@@ -4,7 +4,7 @@
 
 tmp1=`mktemp`
 tmp2=`mktemp`
-trap "rm -f $tmp1 $tmp2" 0 2 3
+trap "rm -f $tmp1 $tmp2; exit" 0 2 3
 
 nm -P -t x z80.out > $tmp1
 
--- a/tests/nm/execute/0011-z80-P-x.sh
+++ b/tests/nm/execute/0011-z80-P-x.sh
@@ -4,7 +4,7 @@
 
 tmp1=`mktemp`
 tmp2=`mktemp`
-trap "rm -f $tmp1 $tmp2" 0 2 3
+trap "rm -f $tmp1 $tmp2; exit" 0 2 3
 
 nm -P -t x z80.out > $tmp1
 
--- a/tests/nm/execute/chktest.sh
+++ b/tests/nm/execute/chktest.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-trap "rm -f a.out" 0 2 3 15
+trap "rm -f a.out; exit" 0 2 3 15
 ulimit -c 0
 rm -f test.log
 
--- a/tests/scc/error/chktest.sh
+++ b/tests/scc/error/chktest.sh
@@ -4,7 +4,7 @@
 err=/tmp/$$.err
 chk=/tmp/$$.chk
 
-trap "rm -f a.out *.o $chk $err" 0 1 2 3 15
+trap "rm -f a.out *.o $chk $err; exit" 0 1 2 3 15
 ulimit -c 0
 rm -f test.log
 
--- a/tests/scc/execute/chktest.sh
+++ b/tests/scc/execute/chktest.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 file=${1?' empty input file'}
-trap "rm -f a.out" 0 1 2 3 15
+trap "rm -f a.out; exit" 0 1 2 3 15
 ulimit -c 0
 rm -f test.log