1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-20 18:56:39 +02:00

tests: clean up root tests; adapt to new layout

* tests/Makefile.am (root_tests): New list.
(check-root): Add 'SUBDIRS='.
(root-hint): Point to README.
* Makefile.am (check-root): Add 'SUBDIRS=' here, too.
* maint.mk (sc_root_tests): Adapt rule to new syntax used
in tests/Makefile.am.
This commit is contained in:
Jim Meyering
2008-04-18 15:51:18 +02:00
parent 512e111a92
commit b214b51ca0
3 changed files with 25 additions and 34 deletions

View File

@@ -57,7 +57,7 @@ ACLOCAL_AMFLAGS = -I m4
# Some tests always need root privileges, others need them only sometimes.
check-root:
cd tests && $(MAKE) $@
cd tests && $(MAKE) $@ SUBDIRS=
# Just prior to distribution, ...
# transform the automake-generated rule that runs `rm -f rm'.

View File

@@ -266,14 +266,17 @@ sc_prohibit_jm_in_m4:
{ echo '$(ME): do not use jm_ in m4 macro names' \
1>&2; exit 1; } || :
# Ensure that each root-requiring test is run via the "check-root" rule.
sc_root_tests:
@if test -d tests \
&& grep check-root tests/Makefile.am>/dev/null 2>&1; then \
t1=sc-root.expected; t2=sc-root.actual; \
grep -nl '^require_root_$$' \
$$($(VC_LIST) tests) |sed s,tests,., |sort > $$t1; \
sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
$(srcdir)/tests/Makefile.am |sort > $$t2; \
$$($(VC_LIST) tests) |sed s,tests/,, |sort > $$t1; \
sed -n '/^root_tests =[ ]*\\$$/,/[^\]$$/p' \
$(srcdir)/tests/Makefile.am \
| sed 's/^ *//;/^root_tests =/d' \
| tr -s '\012\\' ' ' | fmt -1 | sort > $$t2; \
diff -u $$t1 $$t2 || diff=1; \
rm -f $$t1 $$t2; \
test "$$diff" \

View File

@@ -30,36 +30,24 @@ EXTRA_DIST = \
SUBDIRS = cut head join pr sort tac tail test tr uniq wc
## N O T E :: Please do not add new directories.
all_t = t1 t2 t3 t4 t5 t6 t7 t8 t9 ta tb tc td
.PHONY: check-root $(all_t)
check-root: $(all_t)
root_tests = \
chown/basic \
cp/cp-a-selinux \
cp/preserve-gid \
cp/special-bits \
ls/nameless-uid \
misc/chcon \
mkdir/writable-under-readonly \
mv/sticky-to-xpart \
rm/fail-2eperm \
rm/no-give-up \
rm/one-file-system \
tail-2/append-only \
touch/now-owned-by-other
t1:
$(MAKE) check TESTS=chown/basic
t2:
$(MAKE) check TESTS=cp/special-bits
t3:
$(MAKE) check TESTS=rm/no-give-up
t4:
$(MAKE) check TESTS=rm/fail-2eperm
t5:
$(MAKE) check TESTS=tail-2/append-only
t6:
$(MAKE) check TESTS=rm/one-file-system
t7:
$(MAKE) check TESTS=ls/nameless-uid
t8:
$(MAKE) check TESTS=misc/chcon
t9:
$(MAKE) check TESTS=cp/cp-a-selinux
ta:
$(MAKE) check TESTS=mkdir/writable-under-readonly
tb:
$(MAKE) check TESTS=mv/sticky-to-xpart
tc:
$(MAKE) check TESTS=cp/preserve-gid
td:
$(MAKE) check TESTS=touch/now-owned-by-other
.PHONY: check-root
check-root:
$(MAKE) check TESTS='$(root_tests)' SUBDIRS=
check-recursive: root-hint
@@ -68,7 +56,7 @@ check-recursive: root-hint
root-hint:
@echo '***********************************************************'
@echo "NOTICE: Some tests may be run only as root."
@echo " Do \`make check-root' as \`root' to run these tests."
@echo " See the 'Running tests as root' section in README."
@echo '***********************************************************'
EXTRA_DIST += $(TESTS)