summaryrefslogtreecommitdiff
path: root/maint.mk
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 /maint.mk
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>
Diffstat (limited to 'maint.mk')
-rw-r--r--maint.mk20
1 files changed, 18 insertions, 2 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]' \