SHA256
3
0
forked from pool/acl
acl/acl-add-make-test-target-and-use-make-to-run-tests.patch

71 lines
1.9 KiB
Diff
Raw Normal View History

From: Brandon Philips <bphilips@suse.de>
Subject: [PATCH] acl: add make tests target and use make to run tests
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`
tests requiring root can be ran from the test directory by running
`make root-tests`
Signed-off-by: Brandon Philips <bphilips@suse.de>
---
Makefile | 4 ++++
test/Makefile | 27 ++++++++++++++++++++++++---
2 files changed, 28 insertions(+), 3 deletions(-)
Index: acl-2.2.47/test/Makefile
===================================================================
--- acl-2.2.47.orig/test/Makefile
+++ acl-2.2.47/test/Makefile
@@ -5,10 +5,31 @@
TOPDIR = ..
include $(TOPDIR)/include/builddefs
-LSRCFILES = run make-tree \
- cp.test getfacl-noacl.test misc.test nfs-dir.test \
- nfsacl.test permissions.test setfacl.test
+TESTS = $(wildcard *.test)
+ROOT = $(wildcard root/*.test)
+NFS = $(wildcard nfs/*.test)
+LSRCFILES = run make-tree $(TESTS) $(ROOT) $(NFS)
include $(BUILDRULES)
default install install-dev install-lib:
+
+PATH := $(abspath ../getfacl/):$(abspath ../setfacl/):$(abspath ../chacl/):$(PATH)
+
+tests: $(TESTS)
+root-tests: $(ROOT)
+nfs-tests: $(NFS)
+
+$(TESTS):
+ @echo "*** $@ ***"; perl run $@
+
+$(NFS):
+ @echo "NFS specific tests"; @echo "*** $@ ***"; perl run $@
+
+$(ROOT):
+ @echo "Note: Tests must run as root"; @echo "*** $@ ***"; perl run $@
+
+.PHONY: $(TESTS) $(NFS) $(ROOT)
+.NOTPARALLEL:
+
+
Index: acl-2.2.47/Makefile
===================================================================
--- acl-2.2.47.orig/Makefile
+++ acl-2.2.47/Makefile
@@ -65,3 +65,7 @@ install-lib: default
realclean distclean: clean
rm -f $(LDIRT) $(CONFIGURE)
rm -rf autom4te.cache Logs
+
+.PHONY: tests
+tests: default
+ $(MAKE) -C test/ tests