linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 2/3] Btrfs-progs: move test tools to tests/ subdir
Date: Tue, 11 Jun 2013 18:15:18 -0500	[thread overview]
Message-ID: <1370992519-21369-3-git-send-email-sandeen@redhat.com> (raw)
In-Reply-To: <1370992519-21369-1-git-send-email-sandeen@redhat.com>

Move test tools to tests/

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 Makefile                                           |   23 +--------
 tests/Makefile                                     |   49 ++++++++++++++++++++
 .../btrfs-corrupt-block.c                          |    0
 dir-test.c => tests/dir-test.c                     |    0
 ioctl-test.c => tests/ioctl-test.c                 |    0
 quick-test.c => tests/quick-test.c                 |    0
 random-test.c => tests/random-test.c               |    0
 send-test.c => tests/send-test.c                   |    0
 8 files changed, 52 insertions(+), 20 deletions(-)
 create mode 100644 tests/Makefile
 rename btrfs-corrupt-block.c => tests/btrfs-corrupt-block.c (100%)
 rename dir-test.c => tests/dir-test.c (100%)
 rename ioctl-test.c => tests/ioctl-test.c (100%)
 rename quick-test.c => tests/quick-test.c (100%)
 rename random-test.c => tests/random-test.c (100%)
 rename send-test.c => tests/send-test.c (100%)

diff --git a/Makefile b/Makefile
index 5411ad9..01b71ec 100644
--- a/Makefile
+++ b/Makefile
@@ -56,7 +56,7 @@ btrfs_convert_libs = -lext2fs -lcom_err
 btrfs_image_libs = -lpthread
 btrfs_fragment_libs = -lgd -lpng -ljpeg -lfreetype
 
-SUBDIRS = man
+SUBDIRS = man tests
 BUILDDIRS = $(patsubst %,build-%,$(SUBDIRS))
 INSTALLDIRS = $(patsubst %,install-%,$(SUBDIRS))
 CLEANDIRS = $(patsubst %,clean-%,$(SUBDIRS))
@@ -102,7 +102,7 @@ endif
 
 all: version.h $(progs) $(BUILDDIRS)
 $(SUBDIRS): $(BUILDDIRS)
-$(BUILDDIRS):
+$(BUILDDIRS): $(libs)
 	@echo "Making all in $(patsubst build-%,%,$@)"
 	$(Q)$(MAKE) $(MAKEOPTS) -C $(patsubst build-%,%,$@)
 
@@ -178,30 +178,13 @@ btrfstune: $(objects) $(libs) btrfstune.o
 	@echo "    [LD]     $@"
 	$(Q)$(CC) $(CFLAGS) -o btrfstune $(objects) btrfstune.o $(LDFLAGS) $(LIBS)
 
-dir-test: $(objects) $(libs) dir-test.o
-	@echo "    [LD]     $@"
-	$(Q)$(CC) $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS) $(LIBS)
-
-quick-test: $(objects) $(libs) quick-test.o
-	@echo "    [LD]     $@"
-	$(Q)$(CC) $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS)
-
-ioctl-test: $(objects) $(libs) ioctl-test.o
-	@echo "    [LD]     $@"
-	$(Q)$(CC) $(CFLAGS) -o ioctl-test $(objects) ioctl-test.o $(LDFLAGS) $(LIBS)
-
-send-test: $(objects) $(libs) send-test.o
-	@echo "    [LD]     $@"
-	$(Q)$(CC) $(CFLAGS) -o send-test $(objects) send-test.o $(LDFLAGS) $(LIBS) -lpthread
-
 manpages:
 	$(Q)$(MAKE) $(MAKEOPTS) -C man
 
 clean: $(CLEANDIRS)
 	@echo "Cleaning"
 	$(Q)rm -f $(progs) cscope.out *.o .*.d btrfs-convert btrfs-image btrfs-select-super \
-	      btrfs-zero-log btrfstune dir-test ioctl-test quick-test send-test btrfsck \
-	      btrfs.static mkfs.btrfs.static btrfs-calc-size \
+	      btrfs-zero-log btrfstune btrfsck btrfs.static mkfs.btrfs.static btrfs-calc-size \
 	      version.h \
 	      $(libs) $(lib_links)
 
diff --git a/tests/Makefile b/tests/Makefile
new file mode 100644
index 0000000..198de0d
--- /dev/null
+++ b/tests/Makefile
@@ -0,0 +1,49 @@
+CFLAGS += -I..
+
+objects := $(addprefix ../, $(objects))
+
+lib_LIBS = -lblkid -luuid
+LIBS = $(lib_LIBS) $(addprefix ../, $(libs_static))
+
+# These last 2 don't actually build anymore
+progs = btrfs-corrupt-block ioctl-test quick-test send-test # random-test dir-test
+
+libs_static = libbtrfs.a
+libs = $(addprefix ../, $(libs_static))
+headers = $(libbtrfs_headers)
+
+.c.o:
+	$(Q)$(check) $<
+	@echo "    [CC]     $@"
+	$(Q)$(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $<
+
+all: $(progs)
+
+btrfs-corrupt-block: $(objects) $(libs) btrfs-corrupt-block.o
+	@echo "    [LD]     $@"
+	$(Q)$(CC) $(CFLAGS) -o btrfs-corrupt-block $(objects) btrfs-corrupt-block.o $(LDFLAGS) $(LIBS)
+
+dir-test: $(objects) $(libs) dir-test.o
+	@echo "    [LD]     $@"
+	$(Q)$(CC) $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS) $(LIBS)
+
+ioctl-test: $(objects) $(libs) ioctl-test.o
+	@echo "    [LD]     $@"
+	$(Q)$(CC) $(CFLAGS) -o ioctl-test $(objects) ioctl-test.o $(LDFLAGS) $(LIBS)
+
+quick-test: $(objects) $(libs) quick-test.o
+	@echo "    [LD]     $@"
+	$(Q)$(CC) $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS)
+
+random-test: $(objects) $(libs) random-test.o
+	@echo "    [LD]     $@"
+	$(Q)$(CC) $(CFLAGS) -o random-test $(objects) random-test.o $(LDFLAGS) $(LIBS)
+
+send-test: $(objects) $(libs) send-test.o
+	@echo "    [LD]     $@"
+	$(Q)$(CC) $(CFLAGS) -o send-test $(objects) send-test.o $(LDFLAGS) $(LIBS) -lpthread
+
+clean :
+	$(Q)rm -f *.o .*.d $(progs)
+
+-include .*.d
diff --git a/btrfs-corrupt-block.c b/tests/btrfs-corrupt-block.c
similarity index 100%
rename from btrfs-corrupt-block.c
rename to tests/btrfs-corrupt-block.c
diff --git a/dir-test.c b/tests/dir-test.c
similarity index 100%
rename from dir-test.c
rename to tests/dir-test.c
diff --git a/ioctl-test.c b/tests/ioctl-test.c
similarity index 100%
rename from ioctl-test.c
rename to tests/ioctl-test.c
diff --git a/quick-test.c b/tests/quick-test.c
similarity index 100%
rename from quick-test.c
rename to tests/quick-test.c
diff --git a/random-test.c b/tests/random-test.c
similarity index 100%
rename from random-test.c
rename to tests/random-test.c
diff --git a/send-test.c b/tests/send-test.c
similarity index 100%
rename from send-test.c
rename to tests/send-test.c
-- 
1.7.1


  parent reply	other threads:[~2013-06-11 23:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-11 23:15 [PATCH 0/3] Btrfs-progs: make some subdirs Eric Sandeen
2013-06-11 23:15 ` [PATCH 1/3] Btrfs-progs: Add Makefile infrastructure for subdirs Eric Sandeen
2013-09-02 14:26   ` David Sterba
2013-06-11 23:15 ` Eric Sandeen [this message]
2013-09-02 14:43   ` [PATCH 2/3] Btrfs-progs: move test tools to tests/ subdir David Sterba
2013-09-03 20:53     ` Eric Sandeen
2013-06-11 23:15 ` [PATCH 3/3] Btrfs-progs: move btrfs cmd files to cmd/ subdir Eric Sandeen
2013-06-12  0:28   ` Eric Sandeen
2013-06-12  0:38   ` [PATCH 3/3 V2] " Eric Sandeen
2013-09-02 14:45     ` David Sterba
2013-09-03 20:55       ` Eric Sandeen
2013-06-11 23:24 ` [PATCH 0/3] Btrfs-progs: make some subdirs Zach Brown
2013-06-12  0:01   ` Chris Mason
2013-06-12  0:40 ` [PATCH 4/3] Btrfs-progs: fix up .gitignore Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1370992519-21369-3-git-send-email-sandeen@redhat.com \
    --to=sandeen@redhat.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).