commit 73eaa8badc9c987348ad6e739bc424ef959d9cb3 parent f7dc4baf7faaa0f70d7f6406c298e97c7323e776 Author: Roberto E. Vargas Caballero <k0ga@shike2.com> Date: Wed, 16 Oct 2024 17:00:25 +0200 tests/ar: Don't use exit in the trap Using exit in the trap was overwriting the actual return value from the shell script making that the tests were always returning passing tests. Diffstat:
38 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/tests/ar/execute/0001-append.sh b/tests/ar/execute/0001-append.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3 15 ########################################################################### #Append generated files at once to an empty archive diff --git a/tests/ar/execute/0002-append.sh b/tests/ar/execute/0002-append.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3 15 ########################################################################### #Append generated files one by one to an empty file diff --git a/tests/ar/execute/0003-append.sh b/tests/ar/execute/0003-append.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* f1 f2 f3 $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* f1 f2 f3 $tmp1 $tmp2" 0 2 3 15 ########################################################################### #Append generated files at once to an existing archive diff --git a/tests/ar/execute/0004-append.sh b/tests/ar/execute/0004-append.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3 15 ########################################################################### #empty file list diff --git a/tests/ar/execute/0005-append.sh b/tests/ar/execute/0005-append.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3 15 ########################################################################### #empty file list diff --git a/tests/ar/execute/0006-append.sh b/tests/ar/execute/0006-append.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file.a f1 f2 f3 $tmp1 $tmp2" 0 2 3 15 ########################################################################### #empty file list diff --git 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; exit" 0 2 3 +trap "rm -f file.a" 0 2 3 15 ############################################################################ #delete one member diff --git 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; exit" 0 2 3 +trap "rm -f file.a" 0 2 3 15 ############################################################################ #delete two members, 1st and 2nd diff --git 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; exit" 0 2 3 +trap "rm -f file.a" 0 2 3 15 ############################################################################ #delete two members, 2nd and 3rd diff --git 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; exit" 0 2 3 +trap "rm -f file.a" 0 2 3 15 ############################################################################ #remove all the members diff --git 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; exit" 0 2 3 +trap "rm -f file.a" 0 2 3 15 ############################################################################ #no members diff --git 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; exit" 0 2 3 +trap "rm -f file.a" 0 2 3 15 ############################################################################ #delete one member diff --git a/tests/ar/execute/0013-print.sh b/tests/ar/execute/0013-print.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file.a $tmp1 $tmp2" 0 2 3 15 ############################################################################ #print 1st member diff --git a/tests/ar/execute/0014-print.sh b/tests/ar/execute/0014-print.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file.a $tmp1 $tmp2" 0 2 3 15 ############################################################################ #print 3rd member diff --git a/tests/ar/execute/0015-print.sh b/tests/ar/execute/0015-print.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file.a $tmp1 $tmp2" 0 2 3 15 ############################################################################ #print 2nd member with verbose diff --git a/tests/ar/execute/0016-print.sh b/tests/ar/execute/0016-print.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file.a $tmp1 $tmp2" 0 2 3 15 ############################################################################ #print all members diff --git a/tests/ar/execute/0017-print.sh b/tests/ar/execute/0017-print.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file.a $tmp1 $tmp2" 0 2 3 15 #and now with no members in command line diff --git a/tests/ar/execute/0018-list.sh b/tests/ar/execute/0018-list.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file.a $tmp1 $tmp2" 0 2 3 15 ############################################################################ #list 1st member diff --git a/tests/ar/execute/0019-list.sh b/tests/ar/execute/0019-list.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file.a $tmp1 $tmp2" 0 2 3 15 ############################################################################ #print 3rd member diff --git a/tests/ar/execute/0020-list.sh b/tests/ar/execute/0020-list.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file.a $tmp1 $tmp2" 0 2 3 15 ############################################################################ #print 2nd member with verbose diff --git a/tests/ar/execute/0021-list.sh b/tests/ar/execute/0021-list.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file.a $tmp1 $tmp2" 0 2 3 15 ############################################################################ #print all members diff --git a/tests/ar/execute/0022-list.sh b/tests/ar/execute/0022-list.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file.a $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file.a $tmp1 $tmp2" 0 2 3 15 ############################################################################ #list 1st member diff --git a/tests/ar/execute/0023-extract.sh b/tests/ar/execute/0023-extract.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #extract 1st member diff --git a/tests/ar/execute/0024-extract.sh b/tests/ar/execute/0024-extract.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #extract 3rd member diff --git a/tests/ar/execute/0025-extract.sh b/tests/ar/execute/0025-extract.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #extract 3rd member diff --git a/tests/ar/execute/0026-extract.sh b/tests/ar/execute/0026-extract.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #extract all members diff --git a/tests/ar/execute/0027-extract.sh b/tests/ar/execute/0027-extract.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #extract without parameters diff --git a/tests/ar/execute/0029-move.sh b/tests/ar/execute/0029-move.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #move 1st without specifier diff --git a/tests/ar/execute/0030-move.sh b/tests/ar/execute/0030-move.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #move 1st at the end diff --git a/tests/ar/execute/0031-move.sh b/tests/ar/execute/0031-move.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #and now, test without parameters diff --git a/tests/ar/execute/0032-update.sh b/tests/ar/execute/0032-update.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #Update one member that already exist diff --git a/tests/ar/execute/0033-update.sh b/tests/ar/execute/0033-update.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #Update one member that doesn't exist diff --git a/tests/ar/execute/0034-update.sh b/tests/ar/execute/0034-update.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #Update one member that exists and using -a diff --git a/tests/ar/execute/0035-update.sh b/tests/ar/execute/0035-update.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #Update one member that exists and using -b diff --git a/tests/ar/execute/0036-update.sh b/tests/ar/execute/0036-update.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #Update one member that doesn't exist and using -b diff --git a/tests/ar/execute/0037-update.sh b/tests/ar/execute/0037-update.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #Update one member that doesn't exist and using -a diff --git a/tests/ar/execute/0038-update.sh b/tests/ar/execute/0038-update.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #Update without parameters diff --git a/tests/ar/execute/0039-update.sh b/tests/ar/execute/0039-update.sh @@ -5,7 +5,7 @@ set -e tmp1=`mktemp` tmp2=`mktemp` -trap "rm -f file* $tmp1 $tmp2; exit" 0 2 3 +trap "rm -f file* $tmp1 $tmp2" 0 2 3 15 ############################################################################ #Update one member that already exist