summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-03-28 14:14:04 +0100
committerJim Meyering <meyering@redhat.com>2008-03-28 14:21:28 +0100
commit17720c10cd73b71230f309137c437bf3aad7b6f5 (patch)
treef5df1dac6af0eedd44cc94f3c065f67d4147aa17
parent818dbee8dc1a50f6dbc1ba85f7f25a47ded09930 (diff)
downloadcoreutils-17720c10cd73b71230f309137c437bf3aad7b6f5.tar.xz
Require that "(exit $fail); exit $fail" be last line of each test.
* maint.mk (sc_require_test_exit_idiom): New rule to enforce policy. * tests/cp/acl: Adhere to the new policy. * tests/cp/preserve-gid: Likewise. * tests/dd/misc: * tests/install/create-leading: * tests/ln/sf-1: * tests/ls/symlink-slash: * tests/misc/help-version: * tests/misc/ls-time: * tests/misc/nice: * tests/misc/shred-remove: * tests/misc/stty: * tests/misc/stty-row-col: * tests/mkdir/p-1: * tests/mkdir/p-2: * tests/mkdir/p-3: * tests/mkdir/p-v: * tests/mkdir/special-1: * tests/mkdir/writable-under-readonly: * tests/mv/acl: * tests/mv/backup-is-src: * tests/mv/diag: * tests/mv/dir-file: * tests/mv/force: * tests/mv/hard-link-1: * tests/mv/i-2: * tests/mv/i-4: * tests/mv/into-self: * tests/mv/into-self-2: * tests/mv/into-self-3: * tests/mv/partition-perm: * tests/mv/to-symlink: * tests/rmdir/ignore: * tests/tail-2/assert: * tests/tail-2/assert-2: * tests/touch/dangling-symlink: * tests/touch/dir-1: * tests/touch/empty-file: * tests/touch/fifo: * tests/touch/no-rights: Likewise. Signed-off-by: Jim Meyering <meyering@redhat.com>
-rw-r--r--maint.mk20
-rwxr-xr-xtests/cp/acl2
-rwxr-xr-xtests/cp/preserve-gid3
-rwxr-xr-xtests/dd/misc5
-rwxr-xr-xtests/install/create-leading4
-rwxr-xr-xtests/ln/sf-14
-rwxr-xr-xtests/ls/symlink-slash4
-rwxr-xr-xtests/misc/help-version4
-rwxr-xr-xtests/misc/ls-time5
-rwxr-xr-xtests/misc/nice4
-rwxr-xr-xtests/misc/shred-remove4
-rwxr-xr-xtests/misc/stty4
-rwxr-xr-xtests/misc/stty-row-col4
-rwxr-xr-xtests/mkdir/p-14
-rwxr-xr-xtests/mkdir/p-24
-rwxr-xr-xtests/mkdir/p-34
-rwxr-xr-xtests/mkdir/p-v5
-rwxr-xr-xtests/mkdir/special-14
-rwxr-xr-xtests/mkdir/writable-under-readonly5
-rwxr-xr-xtests/mv/acl2
-rwxr-xr-xtests/mv/backup-is-src4
-rwxr-xr-xtests/mv/diag5
-rwxr-xr-xtests/mv/dir-file4
-rwxr-xr-xtests/mv/force4
-rwxr-xr-xtests/mv/hard-link-14
-rwxr-xr-xtests/mv/i-24
-rwxr-xr-xtests/mv/i-44
-rwxr-xr-xtests/mv/into-self4
-rwxr-xr-xtests/mv/into-self-22
-rwxr-xr-xtests/mv/into-self-34
-rwxr-xr-xtests/mv/partition-perm4
-rwxr-xr-xtests/mv/to-symlink4
-rwxr-xr-xtests/rmdir/ignore4
-rwxr-xr-xtests/tail-2/assert4
-rwxr-xr-xtests/tail-2/assert-24
-rwxr-xr-xtests/touch/dangling-symlink4
-rwxr-xr-xtests/touch/dir-12
-rwxr-xr-xtests/touch/empty-file4
-rwxr-xr-xtests/touch/fifo4
-rwxr-xr-xtests/touch/no-rights4
40 files changed, 97 insertions, 75 deletions
diff --git a/maint.mk b/maint.mk
index 0371ee98f..6933a3c0f 100644
--- a/maint.mk
+++ b/maint.mk
@@ -1,6 +1,6 @@
# -*-Makefile-*-
-# This Makefile fragment is shared between the coreutils,
-# CPPI, Bison, and Autoconf.
+# This Makefile fragment tries to be general-purpose enough to be
+# used by at least coreutils, idutils, CPPI, Bison, and Autoconf.
## Copyright (C) 2001-2008 Free Software Foundation, Inc.
##
@@ -336,6 +336,22 @@ sc_system_h_headers: .re-list
1>&2; exit 1; } || :; \
fi
+# Require that the final line of each test-lib.sh-using test be this one:
+# (exit $fail); exit $fail
+# Note: this test requires GNU grep's --label= option.
+sc_require_test_exit_idiom:
+ @if test -f $(srcdir)/tests/test-lib.sh; then \
+ die=0; \
+ for i in $$(grep -l -F /../test-lib.sh $$($(VC_LIST) tests)); do \
+ tail -n1 $$i | grep '^(exit \$$fail); exit \$$fail$$' > /dev/null \
+ && : || { die=1; echo $$i; } \
+ done; \
+ test $$die = 1 && \
+ { echo 1>&2 '$(ME): the final line in each of the above is not:'; \
+ echo 1>&2 '(exit $$fail); exit $$fail'; \
+ exit 1; } || :; \
+ fi
+
sc_sun_os_names:
@grep -nEi \
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
diff --git a/tests/cp/acl b/tests/cp/acl
index 05b4ec676..a7f6a844f 100755
--- a/tests/cp/acl
+++ b/tests/cp/acl
@@ -61,4 +61,4 @@ cp -p a/file b/ || fail=1
acl2=`cd b && getfacl file` || framework_failure
test "$acl1" = "$acl2" || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/cp/preserve-gid b/tests/cp/preserve-gid
index da0005612..d78582942 100755
--- a/tests/cp/preserve-gid
+++ b/tests/cp/preserve-gid
@@ -99,4 +99,5 @@ t1 b1 "$nameless_uid" "$nameless_gid2" cp -p
t1 c0 "$nameless_uid" "$nameless_gid1" cp -p
t1 c1 "$nameless_uid" "$nameless_gid2" cp -p
-(exit 0); exit 0
+fail=0
+(exit $fail); exit $fail
diff --git a/tests/dd/misc b/tests/dd/misc
index 76183b3f8..917258236 100755
--- a/tests/dd/misc
+++ b/tests/dd/misc
@@ -2,7 +2,7 @@
# Ensure dd treats `--' properly.
# Also test some flag values.
-# Copyright (C) 1999, 2004-2007 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2004-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -82,4 +82,5 @@ outbytes=`echo x | dd bs=3 ibs=10 obs=10 conv=sync 2>/dev/null | wc -c`
test "$outbytes" -eq 3 || fail=1
test $fail -eq 0 && fail=$warn
-exit $fail
+
+(exit $fail); exit $fail
diff --git a/tests/install/create-leading b/tests/install/create-leading
index c639dc554..66c3995b5 100755
--- a/tests/install/create-leading
+++ b/tests/install/create-leading
@@ -1,7 +1,7 @@
#! /bin/sh
# Test -D option.
-# Copyright (C) 2000, 2001, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -37,4 +37,4 @@ ginstall -D $file no-dir1/no-dir2/dest || fail=1
test -d no-dir1/no-dir2 || fail=1
test -r no-dir1/no-dir2/dest || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/ln/sf-1 b/tests/ln/sf-1
index 1532b622e..4d6989382 100755
--- a/tests/ln/sf-1
+++ b/tests/ln/sf-1
@@ -1,7 +1,7 @@
#!/bin/sh
# Test "ln -sf".
-# Copyright (C) 1997-2000, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1997-2000, 2007-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -35,4 +35,4 @@ case `cat err` in
*) fail=1 ;;
esac
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/ls/symlink-slash b/tests/ls/symlink-slash
index 8deba0511..3d89bd42b 100755
--- a/tests/ls/symlink-slash
+++ b/tests/ls/symlink-slash
@@ -1,7 +1,7 @@
#!/bin/sh
# Do dereference a symlink arg if its name is written with a trailing slash.
-# Copyright (C) 1999, 2000, 2004, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1999-2000, 2004, 2007-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -33,4 +33,4 @@ set `ls -l symlink/`
# Prior to fileutils-4.0k, the following would have output `... symlink -> dir'.
test "$*" = 'total 0' && : || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/misc/help-version b/tests/misc/help-version
index b54a7d8f4..3696736a9 100755
--- a/tests/misc/help-version
+++ b/tests/misc/help-version
@@ -2,7 +2,7 @@
# Make sure all these programs work properly
# when invoked with --help or --version.
-# Copyright (C) 2000-2007 Free Software Foundation, Inc.
+# Copyright (C) 2000-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -197,4 +197,4 @@ for i in $built_programs; do
rm -rf $tmp_in $tmp_in2 $tmp_out $tmp_dir
done
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/misc/ls-time b/tests/misc/ls-time
index 7aee5809f..b3f0ca2e5 100755
--- a/tests/misc/ls-time
+++ b/tests/misc/ls-time
@@ -1,8 +1,7 @@
#!/bin/sh
# Test some of ls's sorting options.
-# Copyright (C) 1998, 1999, 2000, 2001, 2004, 2007 Free Software Foundation,
-# Inc.
+# Copyright (C) 1998-2001, 2004, 2007-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -124,4 +123,4 @@ EOF
fail=1
fi
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/misc/nice b/tests/misc/nice
index 2e9d3c14c..00227293a 100755
--- a/tests/misc/nice
+++ b/tests/misc/nice
@@ -1,7 +1,7 @@
#! /bin/sh
# Test "nice".
-# Copyright (C) 2002, 2003, 2005-2007 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -80,4 +80,4 @@ while :; do
shift; shift; shift
done
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/misc/shred-remove b/tests/misc/shred-remove
index f09c6f3e8..38013d3d8 100755
--- a/tests/misc/shred-remove
+++ b/tests/misc/shred-remove
@@ -1,7 +1,7 @@
#!/bin/sh
# Exercise a bug that was fixed in shred-4.0l
-# Copyright (C) 1999, 2000, 2003, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1999-2000, 2003, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -38,4 +38,4 @@ fail=0
# When the command completes, expect it to fail.
shred -u $file > /dev/null 2>&1 && fail=1 || :
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/misc/stty b/tests/misc/stty
index c9fd67d14..6ec67be01 100755
--- a/tests/misc/stty
+++ b/tests/misc/stty
@@ -1,7 +1,7 @@
#! /bin/sh
# Make sure stty can parse most of its options.
-# Copyright (C) 1998-2004, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 1998-2004, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -100,4 +100,4 @@ fi
stty `cat $saved_state`
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/misc/stty-row-col b/tests/misc/stty-row-col
index eb84499ed..c7e49675d 100755
--- a/tests/misc/stty-row-col
+++ b/tests/misc/stty-row-col
@@ -1,7 +1,7 @@
#! /bin/sh
# Test "stty" with rows and columns.
-# Copyright (C) 1998-2001, 2003-2007 Free Software Foundation, Inc.
+# Copyright (C) 1998-2001, 2003-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -82,4 +82,4 @@ done
set x $saved_size
stty rows $2 columns $3 || exit 1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mkdir/p-1 b/tests/mkdir/p-1
index 7ef63be52..a5672743a 100755
--- a/tests/mkdir/p-1
+++ b/tests/mkdir/p-1
@@ -1,7 +1,7 @@
#!/bin/sh
# Test "mkdir -p".
-# Copyright (C) 1997, 2000, 2002, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1997, 2000, 2002, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,4 +27,4 @@ fail=0
mkdir --parents "`pwd`/t" || fail=1
test -d t || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mkdir/p-2 b/tests/mkdir/p-2
index f19a50cde..0659a8e35 100755
--- a/tests/mkdir/p-2
+++ b/tests/mkdir/p-2
@@ -1,7 +1,7 @@
#!/bin/sh
# Just like p-1, but with an absolute path.
-# Copyright (C) 1997, 2000, 2002, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1997, 2000, 2002, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,4 +27,4 @@ fail=0
mkdir --parents "`pwd`/t/u" || fail=1
test -d t/u || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mkdir/p-3 b/tests/mkdir/p-3
index 401091131..e868b520f 100755
--- a/tests/mkdir/p-3
+++ b/tests/mkdir/p-3
@@ -3,7 +3,7 @@
# causes immediate failure. Also, ensure that we don't create
# subsequent, relative command-line arguments in the wrong place.
-# Copyright (C) 2005-2007 Free Software Foundation, Inc.
+# Copyright (C) 2005-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -52,4 +52,4 @@ b=`ls "$p/a" | tr -d '\n'`
# With coreutils-5.3.0, this would fail with $b=bu.
test "x$b" = xb || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mkdir/p-v b/tests/mkdir/p-v
index 569e9b072..316c1e939 100755
--- a/tests/mkdir/p-v
+++ b/tests/mkdir/p-v
@@ -24,7 +24,8 @@ fi
. $srcdir/../lang-default
. $srcdir/../test-lib.sh
-mkdir -pv foo/a/b/c/d >out || exit
+fail=0
+mkdir -pv foo/a/b/c/d >out || fail=1
diff - out <<\EOF
mkdir: created directory `foo'
@@ -33,3 +34,5 @@ mkdir: created directory `foo/a/b'
mkdir: created directory `foo/a/b/c'
mkdir: created directory `foo/a/b/c/d'
EOF
+
+(exit $fail); exit $fail
diff --git a/tests/mkdir/special-1 b/tests/mkdir/special-1
index f65d2ae01..800d51065 100755
--- a/tests/mkdir/special-1
+++ b/tests/mkdir/special-1
@@ -1,7 +1,7 @@
#!/bin/sh
# verify that mkdir honors special bits in MODE
-# Copyright (C) 2000, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -52,4 +52,4 @@ case "$mode" in
*) fail=1 ;;
esac
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mkdir/writable-under-readonly b/tests/mkdir/writable-under-readonly
index bf2c2ad37..92d87ab5a 100755
--- a/tests/mkdir/writable-under-readonly
+++ b/tests/mkdir/writable-under-readonly
@@ -1,7 +1,7 @@
#!/bin/sh
# FIXME: convert this to a root-only test.
-# Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2007-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -37,6 +37,7 @@ skip_test_ temporarily disabled
# FIXME: define cleanup_ to do the umount
+fail=0
# FIXME: use mktemp
cd /tmp \
&& dd if=/dev/zero of=1 bs=8192 count=50 \
@@ -52,3 +53,5 @@ mkdir -p mnt-ro/rw/sub || fail=1
# To clean up
umount /tmp/2
umount /tmp/1
+
+(exit $fail); exit $fail
diff --git a/tests/mv/acl b/tests/mv/acl
index 8f9d565be..4fc6350b1 100755
--- a/tests/mv/acl
+++ b/tests/mv/acl
@@ -70,4 +70,4 @@ mv dir2 $other_partition_tmpdir || fail=1
acl2=`cd $other_partition_tmpdir && getfacl dir2` || framework_failure
test "$acl1" = "$acl2" || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mv/backup-is-src b/tests/mv/backup-is-src
index f8be007a8..9315d15a0 100755
--- a/tests/mv/backup-is-src
+++ b/tests/mv/backup-is-src
@@ -1,7 +1,7 @@
#!/bin/sh
# Force mv to use the copying code.
-# Copyright (C) 1998, 1999, 2000, 2004, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1998-2000, 2004, 2007-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -48,4 +48,4 @@ EOF
compare out2 exp || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mv/diag b/tests/mv/diag
index d7e70f3d6..3393606c3 100755
--- a/tests/mv/diag
+++ b/tests/mv/diag
@@ -1,7 +1,7 @@
#!/bin/sh
# make sure we get proper diagnostics: e.g., with --target-dir=d but no args
-# Copyright (C) 2000, 2004, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2004, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -51,5 +51,4 @@ EOF
compare out exp || fail=1
-(exit $fail)
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mv/dir-file b/tests/mv/dir-file
index 61b7deaea..069524964 100755
--- a/tests/mv/dir-file
+++ b/tests/mv/dir-file
@@ -1,7 +1,7 @@
#!/bin/sh
# mv must fail when src and dest are mismatched directory/non-directory.
-# Copyright (C) 2000, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -32,4 +32,4 @@ fail=0
mv dir file > /dev/null 2>&1 && fail=1
mv file dir > /dev/null 2>&1 && fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mv/force b/tests/mv/force
index bc2603ecf..ad64c2290 100755
--- a/tests/mv/force
+++ b/tests/mv/force
@@ -1,7 +1,7 @@
#!/bin/sh
# move a file onto itself
-# Copyright (C) 1999, 2000, 2002, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2002, 2007-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -44,4 +44,4 @@ test `cat $ff` = force-contents || fail=1
# device and inodes are the same.
mv $ff $ff2 || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mv/hard-link-1 b/tests/mv/hard-link-1
index 558cfac04..b82f2526d 100755
--- a/tests/mv/hard-link-1
+++ b/tests/mv/hard-link-1
@@ -2,7 +2,7 @@
# move a directory containing hard-linked files and
# make sure the links are preserved
-# Copyright (C) 1998, 1999, 2000, 2004, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 1998, 1999, 2000, 2004, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -43,4 +43,4 @@ a=`sed -n 's/ a$//p' out`
b=`sed -n 's/ b$//p' out`
test "$a" = "$b" || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mv/i-2 b/tests/mv/i-2
index 49f9d985f..eb0181e1a 100755
--- a/tests/mv/i-2
+++ b/tests/mv/i-2
@@ -2,7 +2,7 @@
# Test both cp and mv for their behavior with -if and -fi
# The standards (POSIX and SuS) dictate annoyingly inconsistent behavior.
-# Copyright (C) 2000, 2001, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -58,4 +58,4 @@ test -f g || fail=1
test -f h || fail=1
compare g h || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mv/i-4 b/tests/mv/i-4
index 288c42830..db61aab86 100755
--- a/tests/mv/i-4
+++ b/tests/mv/i-4
@@ -1,7 +1,7 @@
#!/bin/sh
# make sure `mv -i a b' does its job with a positive response
-# Copyright (C) 2001, 2005-2007 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2005-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -52,4 +52,4 @@ mv -i a b < y >/dev/null 2>&1 || fail=1
test -r a && fail=1
test -r b || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mv/into-self b/tests/mv/into-self
index 7c2636ee9..cbe7df9c5 100755
--- a/tests/mv/into-self
+++ b/tests/mv/into-self
@@ -1,7 +1,7 @@
#! /bin/sh
# Demonstrate how mv fails when it tries to move a directory into itself.
-# Copyright (C) 1998, 1999, 2000, 2002, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1998-2000, 2002, 2007-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -56,4 +56,4 @@ test -d $dir/$dir && fail=1
# Make sure the file has been moved to the right place.
test -f $dir/$file || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mv/into-self-2 b/tests/mv/into-self-2
index 7866e6952..ad00cb787 100755
--- a/tests/mv/into-self-2
+++ b/tests/mv/into-self-2
@@ -55,4 +55,4 @@ EOF
compare out2 exp || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mv/into-self-3 b/tests/mv/into-self-3
index c8b31ff3d..ce858a234 100755
--- a/tests/mv/into-self-3
+++ b/tests/mv/into-self-3
@@ -1,7 +1,7 @@
#!/bin/sh
# move a directory into itself, with a twist
-# Copyright (C) 1998, 1999, 2000, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1998, 1999, 2000, 2007-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -43,4 +43,4 @@ EOF
compare out2 exp || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mv/partition-perm b/tests/mv/partition-perm
index 7c7849947..8df9571d9 100755
--- a/tests/mv/partition-perm
+++ b/tests/mv/partition-perm
@@ -1,7 +1,7 @@
#!/bin/sh
# Make sure permissions are preserved when moving from one partition to another.
-# Copyright (C) 1999, 2000, 2001, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -40,4 +40,4 @@ test -f $other_partition_tmpdir/file || fail=1
mode=`ls -l $other_partition_tmpdir/file|cut -b-10`
test "$mode" = "-rwxrwxrwx" || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/mv/to-symlink b/tests/mv/to-symlink
index 0b25ff92c..80e1d138f 100755
--- a/tests/mv/to-symlink
+++ b/tests/mv/to-symlink
@@ -2,7 +2,7 @@
# Make sure that the copying code used in an inter-partition
# move unlinks a destination symlink before opening it.
-# Copyright (C) 1999, 2000, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2007-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -47,4 +47,4 @@ test -f $file && fail=1
# Make sure $rem_file is unmodified.
test `cat $rem_file` = remote || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/rmdir/ignore b/tests/rmdir/ignore
index bb3f62f2e..2555613dd 100755
--- a/tests/rmdir/ignore
+++ b/tests/rmdir/ignore
@@ -1,7 +1,7 @@
#!/bin/sh
# make sure rmdir's --ignore-fail-on-non-empty option works
-# Copyright (C) 1999, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2007-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -34,4 +34,4 @@ test -d "$cwd/a/x" || fail=1
test -d "$cwd/a/b" && fail=1
test -d "$cwd/a/b/c" && fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/tail-2/assert b/tests/tail-2/assert
index 2ab617e77..78e0082b4 100755
--- a/tests/tail-2/assert
+++ b/tests/tail-2/assert
@@ -1,7 +1,7 @@
#!/bin/sh
# Test for assertion failure in "test".
-# Copyright (C) 1999, 2000, 2004, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2004, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -61,4 +61,4 @@ esac
test $fail = 1 && cat err
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/tail-2/assert-2 b/tests/tail-2/assert-2
index 2911878a1..6d30a665a 100755
--- a/tests/tail-2/assert-2
+++ b/tests/tail-2/assert-2
@@ -3,7 +3,7 @@
# Due to a race condition in the test, the `assert' script would get
# the UMR on Solaris only some of the time, and not at all on Linux/GNU.
-# Copyright (C) 2000, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -49,4 +49,4 @@ esac
test $fail = 1 && cat err
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/touch/dangling-symlink b/tests/touch/dangling-symlink
index 3c5cbdcec..c69f9d9bc 100755
--- a/tests/touch/dangling-symlink
+++ b/tests/touch/dangling-symlink
@@ -2,7 +2,7 @@
# Make sure touch can create a file through a dangling symlink.
# This was broken in the 4.0[e-i] test releases.
-# Copyright (C) 1999, 2000, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2007-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -51,4 +51,4 @@ when operating on dangling symlinks.
esac
fi
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/touch/dir-1 b/tests/touch/dir-1
index 383e00df4..5b7a86c19 100755
--- a/tests/touch/dir-1
+++ b/tests/touch/dir-1
@@ -11,4 +11,4 @@ fi
fail=0
touch . || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/touch/empty-file b/tests/touch/empty-file
index 296faae27..5368629b4 100755
--- a/tests/touch/empty-file
+++ b/tests/touch/empty-file
@@ -1,7 +1,7 @@
#!/bin/sh
# Make sure touch can set the mtime on an empty file.
-# Copyright (C) 1998, 1999, 2000, 2005-2007 Free Software Foundation, Inc.
+# Copyright (C) 1998, 1999, 2000, 2005-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -82,4 +82,4 @@ if test $fail != 0; then
EOF
fi
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/touch/fifo b/tests/touch/fifo
index 400c922c8..00b46f5c5 100755
--- a/tests/touch/fifo
+++ b/tests/touch/fifo
@@ -1,7 +1,7 @@
#!/bin/sh
# Make sure touch works on fifos without hanging.
-# Copyright (C) 2000, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2007-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -35,4 +35,4 @@ fail=0
touch fifo || fail=1
-exit $fail
+(exit $fail); exit $fail
diff --git a/tests/touch/no-rights b/tests/touch/no-rights
index 7fe9d29c6..e90fcac50 100755
--- a/tests/touch/no-rights
+++ b/tests/touch/no-rights
@@ -2,7 +2,7 @@
# Make sure touch can update the times on a file that is neither
# readable nor writable.
-# Copyright (C) 1999, 2000, 2002, 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2002, 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -42,4 +42,4 @@ test "$*" = "x t1 t2" || fail=1
# Also test the combination of --no-create and -a.
touch -a --no-create t1 || fail=1
-exit $fail
+(exit $fail); exit $fail