[patch 1/5] [PATCH] acl: add make test target and use make to run tests

brandon
2009-01-08T02:37:18Z

[-- Attachment #1: acl-add-make-test-target-and-use-make-to-run-tests.patch --]
[-- Type: text/plain, Size: 2222 bytes --]

The tests are difficult to run. So, this patch adds a Make target that
sets up the path and runs *.test files in the test/ directory.

nfs specific tests can be ran from the test directory by running
`make nfs`

tests requiring root can be ran from the test directory by running
`make nfs`

Signed-off-by: Brandon Philips <bphilips@suse.de>

---
Makefile | 6 +++++-
test/Makefile | 26 +++++++++++++++++++-------
2 files changed, 24 insertions(+), 8 deletions(-)

Index: acl-2.2.47/test/Makefile
===================================================================
--- acl-2.2.47.orig/test/Makefile
+++ acl-2.2.47/test/Makefile
@@ -2,13 +2,25 @@
# Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved.
#

-TOPDIR = ..
-include $(TOPDIR)/include/builddefs
+TEST = $(wildcard *.test)
+ROOT = $(wildcard root/*.test)
+NFS = $(wildcard nfs/*.test)

-LSRCFILES = run make-tree \
- cp.test getfacl-noacl.test misc.test nfs-dir.test \
- nfsacl.test permissions.test setfacl.test
+PATH := $(abspath ../getfacl/):$(abspath ../setfacl/):$(abspath ../chacl/):$(PATH)

-include $(BUILDRULES)
+all: $(TEST)
+root: $(ROOT)
+nfs: $(NFS)

-default install install-dev install-lib:
+
+$(TEST):
+ @echo "*** $@ ***"; perl run $@
+
+$(NFS):
+ @echo "NFS specific tests"; @echo "*** $@ ***"; perl run $@
+
+$(ROOT):
+ @echo "Note: Tests must run as root"; @echo "*** $@ ***"; perl run $@
+
+.PHONY: $(TEST) $(ROOT) $(NFS) default
+.NOTPARALLEL:
Index: acl-2.2.47/Makefile
===================================================================
--- acl-2.2.47.orig/Makefile
+++ acl-2.2.47/Makefile
@@ -17,7 +17,7 @@ LDIRT = config.log .dep config.status co
Logs/* built .census install.* install-dev.* install-lib.* *.gz

SUBDIRS = include libmisc libacl getfacl setfacl chacl m4 man doc po \
- test examples build debian
+ examples build debian

default: $(CONFIGURE)
ifeq ($(HAVE_BUILDDEFS), no)
@@ -65,3 +65,7 @@ install-lib: default
realclean distclean: clean
rm -f $(LDIRT) $(CONFIGURE)
rm -rf autom4te.cache Logs
+
+.PHONY: test
+test: default
+ $(MAKE) -C test/