]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
build: Fix installation for extended names
authorJan Tulak <jtulak@redhat.com>
Mon, 11 Jul 2016 09:26:06 +0000 (11:26 +0200)
committerEryu Guan <eguan@redhat.com>
Mon, 18 Jul 2016 08:55:04 +0000 (16:55 +0800)
xfstests supports extended test names like 314-foo-bar, but
installation of these tests was skipped (not matching a regexp). So
this patch fixes the makefiles in tests/*/

The include/buildrules change was written by Dave Chinner.

Signed-off-by: Jan Tulak <jtulak@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
include/buildrules
tests/btrfs/Makefile
tests/cifs/Makefile
tests/ext4/Makefile
tests/f2fs/Makefile
tests/generic/Makefile
tests/overlay/Makefile
tests/shared/Makefile
tests/udf/Makefile
tests/xfs/Makefile

index c8a7c474726e2cbf8816e4b6949c8acee4fc24e3..76b755e88fdf4e42e4c2360aaa58ce1f4dba54c6 100644 (file)
@@ -100,3 +100,35 @@ MAKEDEP := $(MAKEDEPEND) $(CFLAGS)
            cp /dev/null .dep; \
        fi
 
+# Gather files for installing into two lists:
+# TESTS with executable scripts and OUTFILES with all the test outputs.
+# Makefile has a very small matching, so we have to go this long way.
+
+# Start with all test related files:
+ALLFILES = $(wildcard [0-9]??*)
+
+# Now build a list of known output files.  Unfortunately, the
+# multiple output test files are poorly handled as makefiles don't
+# handle wildcarded multi-suffix matching. Hence we separate the
+# processing of these right now.
+EXTENDED_OUTFILES = $(wildcard [0-9]??*.out.*)
+EXTENDED_OUTFILE_CFGS = $(wildcard [0-9]??.cfg)
+BASIC_OUTFILES = $(wildcard [0-9]??*.out)
+OUTFILES = $(EXTENDED_OUTFILES) $(EXTENDED_OUTFILE_CFGS) $(BASIC_OUTFILES)
+
+# Strip suffix to get matching tests. We want to strip from the
+# first "." to the end, but makefiles don't have a built in
+# operative for that. So:
+#
+# Hack: strip the multiple segments after .out with repeated basename calls.
+EXTFILTER1 = $(basename $(EXTENDED_OUTFILES))
+EXTFILTER2 = $(basename $(EXTFILTER1))
+EXTFILTER3 = $(basename $(EXTFILTER2))
+EXTFILTER4 = $(basename $(EXTFILTER3))
+
+# final filter list
+FILTER = $(basename $(EXTFILTER4) $(BASIC_OUTFILES))
+
+# finally, select the test files by filtering against against the
+# stripped output files and sort them to remove duplicates.
+TESTS = $(sort $(filter $(ALLFILES), $(FILTER)))
index e1a5be1d563a77bf20285ef566039397d49aaa98..2d936421b01a247e7fd9b19f66aed43e08029405 100644 (file)
@@ -12,9 +12,9 @@ include $(BUILDRULES)
 
 install:
        $(INSTALL) -m 755 -d $(TARGET_DIR)
-       $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR)
+       $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR)
        $(INSTALL) -m 644 group $(TARGET_DIR)
-       $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+       $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR)
 
 # Nothing.
 install-dev install-lib:
index 9176e5c8603aea701bca8e17183908878f59430c..0c5cf3be26dd81574053f569e81f1eccf33571d9 100644 (file)
@@ -12,9 +12,9 @@ include $(BUILDRULES)
 
 install:
        $(INSTALL) -m 755 -d $(TARGET_DIR)
-       $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR)
+       $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR)
        $(INSTALL) -m 644 group $(TARGET_DIR)
-       $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+       $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR)
 
 # Nothing.
 install-dev install-lib:
index 7a3c8e1f45f128166797ba1ea2f736304a8aba87..beb1541f415c89bede34b0aa634becc5b1572957 100644 (file)
@@ -12,9 +12,9 @@ include $(BUILDRULES)
 
 install:
        $(INSTALL) -m 755 -d $(TARGET_DIR)
-       $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR)
+       $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR)
        $(INSTALL) -m 644 group $(TARGET_DIR)
-       $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+       $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR)
 
 # Nothing.
 install-dev install-lib:
index 4d00e9ee54c4306eddbd3ad50e26be3b018ae460..d13bca3f59781e29bd3f24c26eefd014a4451cc8 100644 (file)
@@ -13,9 +13,9 @@ include $(BUILDRULES)
 
 install:
        $(INSTALL) -m 755 -d $(TARGET_DIR)
-       $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR)
+       $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR)
        $(INSTALL) -m 644 group $(TARGET_DIR)
-       $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+       $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR)
 
 # Nothing.
 install-dev install-lib:
index 9529fb86685702d9ec6ce88c5082f63bc554d227..3878d05cbbab0a23b9a0d479b6dd31c76759746d 100644 (file)
@@ -12,9 +12,9 @@ include $(BUILDRULES)
 
 install:
        $(INSTALL) -m 755 -d $(TARGET_DIR)
-       $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR)
+       $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR)
        $(INSTALL) -m 644 group $(TARGET_DIR)
-       $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+       $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR)
 
 # Nothing.
 install-dev install-lib:
index 63c987869318e50247a255f23230349d6bc6910b..b07f89254e479f3f9e223eaddef57712f085c85e 100644 (file)
@@ -12,9 +12,9 @@ include $(BUILDRULES)
 
 install:
        $(INSTALL) -m 755 -d $(TARGET_DIR)
-       $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR)
+       $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR)
        $(INSTALL) -m 644 group $(TARGET_DIR)
-       $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+       $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR)
 
 # Nothing.
 install-dev install-lib:
index cbd87f94ad0d2b2d2a25137f5b572c987388ab7d..8a83278235f798bd0b991ed8217fa338957d15ce 100644 (file)
@@ -12,9 +12,9 @@ include $(BUILDRULES)
 
 install:
        $(INSTALL) -m 755 -d $(TARGET_DIR)
-       $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR)
+       $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR)
        $(INSTALL) -m 644 group $(TARGET_DIR)
-       $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+       $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR)
 
 # Nothing.
 install-dev install-lib:
index 1d966589496d281513a306800a48ec3533ea02b2..c9c9f1bd195e290d2838987e4e8bc24a7865347b 100644 (file)
@@ -12,9 +12,9 @@ include $(BUILDRULES)
 
 install:
        $(INSTALL) -m 755 -d $(TARGET_DIR)
-       $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR)
+       $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR)
        $(INSTALL) -m 644 group $(TARGET_DIR)
-       $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+       $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR)
 
 # Nothing.
 install-dev install-lib:
index db94be09bbbaa5b8f29661e44572d6b0608a23dc..d64800ea8cb7d50157969282e20cff3853c2fa87 100644 (file)
@@ -12,9 +12,9 @@ include $(BUILDRULES)
 
 install:
        $(INSTALL) -m 755 -d $(TARGET_DIR)
-       $(INSTALL) -m 755 [0-9]?? $(TARGET_DIR)
+       $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR)
        $(INSTALL) -m 644 group $(TARGET_DIR)
-       $(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+       $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR)
 
 # Nothing.
 install-dev install-lib: