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

76 lines
2.1 KiB
Diff

Subject: [PATCH] attr: 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.
ext specific tests can be ran from the test directory by running
`make ext-tests`
Signed-off-by: Brandon Philips <bphilips@suse.de>
---
Makefile | 4 ++++
test/Makefile | 22 ++++++++++++++++++----
test/README | 4 ++++
3 files changed, 26 insertions(+), 4 deletions(-)
Index: attr-2.4.43/test/README
===================================================================
--- attr-2.4.43.orig/test/README
+++ attr-2.4.43/test/README
@@ -1,3 +1,7 @@
+Run `make test` in the root source tree to build the tree and run
+FS-independent tests.
+
+Run `cd test; make ext` to run ext specific tests.
Andreas Gruenbacher's tests for the ext2 filesystem extended attributes
support. Most of these tests should work for any filesystem type, and
Index: attr-2.4.43/test/Makefile
===================================================================
--- attr-2.4.43.orig/test/Makefile
+++ attr-2.4.43/test/Makefile
@@ -5,12 +5,26 @@
TOPDIR = ..
include $(TOPDIR)/include/builddefs
+TEST = $(wildcard *.test)
+EXT = $(wildcard ext/*.test)
+
# ensure we pick these up in the source tarball
-LSRCFILES = attr.test run README
+LSRCFILES = $(TEST) $(EXT) run README
-default:
+default install install-dev install-lib:
include $(BUILDRULES)
-install:
-install-dev install-lib:
+PATH := $(abspath ../getfattr/):$(abspath ../setfattr):$(abspath ../chattr):$(PATH)
+
+tests: $(TEST)
+ext-tests: $(EXT)
+
+$(TEST):
+ @echo "*** $@ ***"; perl run $@
+
+$(EXT):
+ @echo "EXT specific tests"; @echo "*** $@ ***"; perl run $@
+
+.PHONY: $(TEST) $(EXT)
+.NOTPARALLEL:
Index: attr-2.4.43/Makefile
===================================================================
--- attr-2.4.43.orig/Makefile
+++ attr-2.4.43/Makefile
@@ -62,3 +62,7 @@ install-dev install-lib: default
realclean distclean: clean
rm -f $(LDIRT) $(CONFIGURE)
rm -rf autom4te.cache Logs
+
+.PHONY: tests
+tests: default
+ $(MAKE) -C test/ tests