Skip to contentSkip to conversation

xfstests: make install support common/ and tests/ dirs

PATCH In review Wang Sheng-Hui 2 participants 4 messages Apr 13, 2013 – Apr 22, 2013 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 xfstests: make install support common/ and tests/ dirs

xfstests have some change on the organization of the testcases and common* files:
* The common* scripts have been reorganized into the common/ dir.
* The testcases have been reorganized into sub test dirs under tests/.
* The run.* scripts have been removed.

This patch uses the simple way to make install support above changes:
Make up one Makefile for each newly created subdirs, which can control 'make install' separately.

v3 introduces the following change compared with v2:
* use the neater way by Dave to get the TESTS_SUBDIRS in tests/Makefile.

v2 introduces the following changes compared with v1:
* Ingore the file 'group' under the topdir, for it's useless in the new structures.
* Remove the redundant comments in the Makefiles.
* Use XXX_DIR instead of XXX_SUBDIR in the Makefiles under common/ and tests/.
* Export TESTS_DIR in teh top level Makefile instead of tests/Makefile.
* Obtain the names of dirs for testcases by interating sub dirs under /tests, not by enumeration in tests/Makefile.

---
 Makefile               | 12 +++++-------
 common/Makefile        | 16 ++++++++++++++++
 tests/Makefile         | 19 +++++++++++++++++++
 tests/btrfs/Makefile   | 20 ++++++++++++++++++++
 tests/ext4/Makefile    | 20 ++++++++++++++++++++
 tests/generic/Makefile | 20 ++++++++++++++++++++
 tests/shared/Makefile  | 20 ++++++++++++++++++++
 tests/udf/Makefile     | 20 ++++++++++++++++++++
 tests/xfs/Makefile     | 20 ++++++++++++++++++++
 9 files changed, 160 insertions(+), 7 deletions(-)
 create mode 100644 common/Makefile
 create mode 100644 tests/Makefile
 create mode 100644 tests/btrfs/Makefile
 create mode 100644 tests/ext4/Makefile
 create mode 100644 tests/generic/Makefile
 create mode 100644 tests/shared/Makefile
 create mode 100644 tests/udf/Makefile
 create mode 100644 tests/xfs/Makefile
Makefile +5 -7
index 6edd55c..611b36d 100644
@@ -52,12 +52,15 @@ LDIRT += $(SRCTAR)
 endif
 
 LIB_SUBDIRS = include lib
-TOOL_SUBDIRS = ltp src m4
+TOOL_SUBDIRS = ltp src m4 common
 ifeq ($(HAVE_DMAPI), true)
 TOOL_SUBDIRS += dmapi
 endif
 
-SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
+TESTS_DIR = tests
+export TESTS_DIR
+
+SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS) $(TESTS_DIR)
 
 default: include/builddefs $(DMAPI_MAKEFILE) $(TESTS)
 ifeq ($(HAVE_BUILDDEFS), no)
@@ -91,12 +94,7 @@ depend: include/builddefs $(addsuffix -depend,$(SUBDIRS))
 install: default $(addsuffix -install,$(SUBDIRS))
 	$(INSTALL) -m 755 -d $(PKG_LIB_DIR)
 	$(INSTALL) -m 755 check $(PKG_LIB_DIR)
-	$(INSTALL) -m 755 [0-9]?? $(PKG_LIB_DIR)
-	$(INSTALL) -m 755 run.* $(PKG_LIB_DIR)
-	$(INSTALL) -m 644 group $(PKG_LIB_DIR)
 	$(INSTALL) -m 644 randomize.awk $(PKG_LIB_DIR)
-	$(INSTALL) -m 644 [0-9]??.* $(PKG_LIB_DIR)
-	$(INSTALL) -m 644 common* $(PKG_LIB_DIR)
 
 # Nothing.
 install-dev install-lib:
common/Makefile new file +16 -0
new file mode 100644
index 0000000..5f91e8c
@@ -0,0 +1,16 @@
+#
+# Copyright (c) 2003-2006 Silicon Graphics, Inc.  All Rights Reserved.
+#
+
+TOPDIR = ..
+include $(TOPDIR)/include/builddefs
+
+COMMON_DIR = common
+
+include $(BUILDRULES)
+
+install:
+	$(INSTALL) -m 755 -d $(PKG_LIB_DIR)/$(COMMON_DIR)
+	$(INSTALL) -m 644 * $(PKG_LIB_DIR)/$(COMMON_DIR)
+
+install-dev install-lib:
tests/Makefile new file +19 -0
new file mode 100644
index 0000000..522df8e
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2003-2005 Silicon Graphics, Inc.  All Rights Reserved.
+#
+
+TOPDIR = ..
+include $(TOPDIR)/include/builddefs
+
+TESTS_SUBDIRS = $(sort $(dir $(wildcard $(PWD)/$(TESTS_DIR)/[a-z]*/)))
+
+include $(BUILDRULES)
+
+install: $(addsuffix -install,$(TESTS_SUBDIRS))
+	$(INSTALL) -m 755 -d $(PKG_LIB_DIR)/$(TESTS_DIR)
+
+# Nothing.
+install-dev install-lib:
+
+%-install:
+	$(MAKE) $(MAKEOPTS) -C $* install
tests/btrfs/Makefile new file +20 -0
new file mode 100644
index 0000000..e1a5be1
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2003-2005 Silicon Graphics, Inc.  All Rights Reserved.
+#
+
+TOPDIR = ../..
+include $(TOPDIR)/include/builddefs
+
+BTRFS_DIR = btrfs
+TARGET_DIR = $(PKG_LIB_DIR)/$(TESTS_DIR)/$(BTRFS_DIR)
+
+include $(BUILDRULES)
+
+install:
+	$(INSTALL) -m 755 -d $(TARGET_DIR)
+	$(INSTALL) -m 755 [0-9]?? $(TARGET_DIR)
+	$(INSTALL) -m 644 group $(TARGET_DIR)
+	$(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+
+# Nothing.
+install-dev install-lib:
tests/ext4/Makefile new file +20 -0
new file mode 100644
index 0000000..7a3c8e1
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2003-2005 Silicon Graphics, Inc.  All Rights Reserved.
+#
+
+TOPDIR = ../..
+include $(TOPDIR)/include/builddefs
+
+EXT4_DIR = ext4
+TARGET_DIR = $(PKG_LIB_DIR)/$(TESTS_DIR)/$(EXT4_DIR)
+
+include $(BUILDRULES)
+
+install:
+	$(INSTALL) -m 755 -d $(TARGET_DIR)
+	$(INSTALL) -m 755 [0-9]?? $(TARGET_DIR)
+	$(INSTALL) -m 644 group $(TARGET_DIR)
+	$(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+
+# Nothing.
+install-dev install-lib:
tests/generic/Makefile new file +20 -0
new file mode 100644
index 0000000..9529fb8
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2003-2005 Silicon Graphics, Inc.  All Rights Reserved.
+#
+
+TOPDIR = ../..
+include $(TOPDIR)/include/builddefs
+
+GENERIC_DIR = generic
+TARGET_DIR = $(PKG_LIB_DIR)/$(TESTS_DIR)/$(GENERIC_DIR)
+
+include $(BUILDRULES)
+
+install:
+	$(INSTALL) -m 755 -d $(TARGET_DIR)
+	$(INSTALL) -m 755 [0-9]?? $(TARGET_DIR)
+	$(INSTALL) -m 644 group $(TARGET_DIR)
+	$(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+
+# Nothing.
+install-dev install-lib:
tests/shared/Makefile new file +20 -0
new file mode 100644
index 0000000..cbd87f9
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2003-2005 Silicon Graphics, Inc.  All Rights Reserved.
+#
+
+TOPDIR = ../..
+include $(TOPDIR)/include/builddefs
+
+SHARED_DIR = shared
+TARGET_DIR = $(PKG_LIB_DIR)/$(TESTS_DIR)/$(SHARED_DIR)
+
+include $(BUILDRULES)
+
+install:
+	$(INSTALL) -m 755 -d $(TARGET_DIR)
+	$(INSTALL) -m 755 [0-9]?? $(TARGET_DIR)
+	$(INSTALL) -m 644 group $(TARGET_DIR)
+	$(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+
+# Nothing.
+install-dev install-lib:
tests/udf/Makefile new file +20 -0
new file mode 100644
index 0000000..1d96658
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2003-2005 Silicon Graphics, Inc.  All Rights Reserved.
+#
+
+TOPDIR = ../..
+include $(TOPDIR)/include/builddefs
+
+UDF_DIR = udf
+TARGET_DIR = $(PKG_LIB_DIR)/$(TESTS_DIR)/$(UDF_DIR)
+
+include $(BUILDRULES)
+
+install:
+	$(INSTALL) -m 755 -d $(TARGET_DIR)
+	$(INSTALL) -m 755 [0-9]?? $(TARGET_DIR)
+	$(INSTALL) -m 644 group $(TARGET_DIR)
+	$(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+
+# Nothing.
+install-dev install-lib:
tests/xfs/Makefile new file +20 -0
new file mode 100644
index 0000000..db94be0
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2003-2005 Silicon Graphics, Inc.  All Rights Reserved.
+#
+
+TOPDIR = ../..
+include $(TOPDIR)/include/builddefs
+
+XFS_DIR = xfs
+TARGET_DIR = $(PKG_LIB_DIR)/$(TESTS_DIR)/$(XFS_DIR)
+
+include $(BUILDRULES)
+
+install:
+	$(INSTALL) -m 755 -d $(TARGET_DIR)
+	$(INSTALL) -m 755 [0-9]?? $(TARGET_DIR)
+	$(INSTALL) -m 644 group $(TARGET_DIR)
+	$(INSTALL) -m 644 [0-9]??.* $(TARGET_DIR)
+
+# Nothing.
+install-dev install-lib:
Signature · 6 lines
1.7.12.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw
Quoted 26 lines · Wang Sheng-Hui
Makefile +5 -3
index 6edd55c..611b36d 100644
@@ -52,12 +52,15 @@ LDIRT += $(SRCTAR)
  endif
 
  LIB_SUBDIRS = include lib
-TOOL_SUBDIRS = ltp src m4
+TOOL_SUBDIRS = ltp src m4 common
  ifeq ($(HAVE_DMAPI), true)
  TOOL_SUBDIRS += dmapi
  endif
 
-SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
+TESTS_DIR = tests
+export TESTS_DIR
+
+SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS) $(TESTS_DIR)
 
  default: include/builddefs $(DMAPI_MAKEFILE) $(TESTS)
  ifeq ($(HAVE_BUILDDEFS), no)
@@ -91,12 +94,7 @@ depend: include/builddefs $(addsuffix
-depend,$(SUBDIRS))
  install: default $(addsuffix -install,$(SUBDIRS))
      $(INSTALL) -m 755 -d $(PKG_LIB_DIR)

Makefile depend: include/builddefs $(addsuffix · line 100

Quoted 10 lines
Makefile +0 -5
      $(INSTALL) -m 755 check $(PKG_LIB_DIR)
-    $(INSTALL) -m 755 [0-9]?? $(PKG_LIB_DIR)
-    $(INSTALL) -m 755 run.* $(PKG_LIB_DIR)
-    $(INSTALL) -m 644 group $(PKG_LIB_DIR)
      $(INSTALL) -m 644 randomize.awk $(PKG_LIB_DIR)
-    $(INSTALL) -m 644 [0-9]??.* $(PKG_LIB_DIR)
-    $(INSTALL) -m 644 common* $(PKG_LIB_DIR)
 
  # Nothing.
  install-dev install-lib:

Not sure why Makefile above would not apply. I did the following:

git reset --hard 2bfce6d3 # Revert to commit before v2 of this patch.

Attemted to apply patch

Applying patch v3-xfstests-make-install-support-common-and-tests-dirs.patch patching file Makefile
Hunk #1 FAILED at 52.
Hunk #2 FAILED at 94.
2 out of 2 hunks FAILED -- rejects in file Makefile

So I replaced your Makefile patch with

Quoted 24 lines
Makefile +4 -2
index 6edd55c..b01491e 100644
@@ -52,12 +52,14 @@ LDIRT += $(SRCTAR)
 endif
 
 LIB_SUBDIRS = include lib
-TOOL_SUBDIRS = ltp src m4
+TOOL_SUBDIRS = ltp src m4 common
 ifeq ($(HAVE_DMAPI), true)
 TOOL_SUBDIRS += dmapi
 endif
 
-SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
+TESTS_DIR = tests
+export TESTS_DIR
+SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS) $(TESTS_DIR)
 
 default: include/builddefs $(DMAPI_MAKEFILE) $(TESTS)
 ifeq ($(HAVE_BUILDDEFS), no)
@@ -91,12 +93,7 @@ depend: include/builddefs $(addsuffix -depend,$(SUBDIRS))
 install: default $(addsuffix -install,$(SUBDIRS))
 	$(INSTALL) -m 755 -d $(PKG_LIB_DIR)

Makefile depend: include/builddefs $(addsuffix -depend,$(SUBDIRS)) · line 99

Quoted 10 lines
Makefile +0 -5
 	$(INSTALL) -m 755 check $(PKG_LIB_DIR)
-	$(INSTALL) -m 755 [0-9]?? $(PKG_LIB_DIR)
-	$(INSTALL) -m 755 run.* $(PKG_LIB_DIR)
-	$(INSTALL) -m 644 group $(PKG_LIB_DIR)
 	$(INSTALL) -m 644 randomize.awk $(PKG_LIB_DIR)
-	$(INSTALL) -m 644 [0-9]??.* $(PKG_LIB_DIR)
-	$(INSTALL) -m 644 common* $(PKG_LIB_DIR)
 
 # Nothing.
 install-dev install-lib:

Will revert v2 (git revert 2519a97d) and commit with this minor change is Dave agrees to your latest version.

Thanks
--Rich

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw
Quoted 86 lines · Rich Johnston
Quoted 26 lines · Wang Sheng-Hui
Makefile +5 -3
index 6edd55c..611b36d 100644
@@ -52,12 +52,15 @@ LDIRT += $(SRCTAR)
  endif
 
  LIB_SUBDIRS = include lib
-TOOL_SUBDIRS = ltp src m4
+TOOL_SUBDIRS = ltp src m4 common
  ifeq ($(HAVE_DMAPI), true)
  TOOL_SUBDIRS += dmapi
  endif
 
-SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
+TESTS_DIR = tests
+export TESTS_DIR
+
+SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS) $(TESTS_DIR)
 
  default: include/builddefs $(DMAPI_MAKEFILE) $(TESTS)
  ifeq ($(HAVE_BUILDDEFS), no)
@@ -91,12 +94,7 @@ depend: include/builddefs $(addsuffix
-depend,$(SUBDIRS))
  install: default $(addsuffix -install,$(SUBDIRS))
      $(INSTALL) -m 755 -d $(PKG_LIB_DIR)

Makefile depend: include/builddefs $(addsuffix · line 100

Quoted 10 lines
Makefile +0 -5
      $(INSTALL) -m 755 check $(PKG_LIB_DIR)
-    $(INSTALL) -m 755 [0-9]?? $(PKG_LIB_DIR)
-    $(INSTALL) -m 755 run.* $(PKG_LIB_DIR)
-    $(INSTALL) -m 644 group $(PKG_LIB_DIR)
      $(INSTALL) -m 644 randomize.awk $(PKG_LIB_DIR)
-    $(INSTALL) -m 644 [0-9]??.* $(PKG_LIB_DIR)
-    $(INSTALL) -m 644 common* $(PKG_LIB_DIR)
 
  # Nothing.
  install-dev install-lib:

Not sure why Makefile above would not apply. I did the following:

git reset --hard 2bfce6d3 # Revert to commit before v2 of this patch.

Attemted to apply patch

Applying patch v3-xfstests-make-install-support-common-and-tests-dirs.patch patching file Makefile
Hunk #1 FAILED at 52.
Hunk #2 FAILED at 94.
2 out of 2 hunks FAILED -- rejects in file Makefile

So I replaced your Makefile patch with

Quoted 32 lines
Makefile +4 -7
index 6edd55c..b01491e 100644
@@ -52,12 +52,14 @@ LDIRT += $(SRCTAR)
 endif
 
 LIB_SUBDIRS = include lib
-TOOL_SUBDIRS = ltp src m4
+TOOL_SUBDIRS = ltp src m4 common
 ifeq ($(HAVE_DMAPI), true)
 TOOL_SUBDIRS += dmapi
 endif
 
-SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
+TESTS_DIR = tests
+export TESTS_DIR
+SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS) $(TESTS_DIR)
 
 default: include/builddefs $(DMAPI_MAKEFILE) $(TESTS)
 ifeq ($(HAVE_BUILDDEFS), no)
@@ -91,12 +93,7 @@ depend: include/builddefs $(addsuffix -depend,$(SUBDIRS))
 install: default $(addsuffix -install,$(SUBDIRS))
     $(INSTALL) -m 755 -d $(PKG_LIB_DIR)
     $(INSTALL) -m 755 check $(PKG_LIB_DIR)
-    $(INSTALL) -m 755 [0-9]?? $(PKG_LIB_DIR)
-    $(INSTALL) -m 755 run.* $(PKG_LIB_DIR)
-    $(INSTALL) -m 644 group $(PKG_LIB_DIR)
     $(INSTALL) -m 644 randomize.awk $(PKG_LIB_DIR)
-    $(INSTALL) -m 644 [0-9]??.* $(PKG_LIB_DIR)
-    $(INSTALL) -m 644 common* $(PKG_LIB_DIR)
 
Quoted 4 lines

Makefile depend: include/builddefs $(addsuffix -depend,$(SUBDIRS)) · line 100

Quoted 2 lines
Makefile +0 -0
 # Nothing.
 install-dev install-lib:

Will revert v2 (git revert 2519a97d) and commit with this minor change is Dave agrees to your latest version.

Thanks, Rich!

Regards,
Sheng-Hui

Quoted 5 lines

Thanks
--Rich

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs