All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org,
	Kusanagi Kouichi <slash@ac.auone-net.jp>
Subject: Re: [PATCH 2/3] Btrfs-progs: move test tools to tests/ subdir
Date: Tue, 03 Sep 2013 15:53:14 -0500	[thread overview]
Message-ID: <52264C3A.5010202@redhat.com> (raw)
In-Reply-To: <20130902144345.GZ23113@twin.jikos.cz>

On 9/2/13 9:43 AM, David Sterba wrote:
> On Tue, Jun 11, 2013 at 06:15:18PM -0500, Eric Sandeen wrote:
>> Move test tools to tests/
> 
>>  rename btrfs-corrupt-block.c => tests/btrfs-corrupt-block.c (100%)
> 
> IMO this is not a test by itself, so it should stay in the toplevel dir.

Hum, well, it has a main() - ok, not a test, but a tool used for testing?
Ok, fine.  Maybe misc/ someday ;)

> 
>> --- /dev/null
>> +++ b/tests/Makefile
>> @@ -0,0 +1,49 @@
> eg.
> TOPLEVEL = ..
> 
>> +CFLAGS += -I..
> CFLAGS += -I$(TOPLEVEL)
> 
>> +
>> +objects := $(addprefix ../, $(objects))
> 
> etc. s/../$(TOPLEVEL)

Ok, that's probably good.

>> +
>> +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)
>> +
> 
> the default rule belongs here, ie
> all: $(progs)
> 
> Otherwise 'make' in the tests/ subdir will try to execute the first .c
> file it needs to build.
> 
>> +.c.o:
>> +	$(Q)$(check) $<
>> +	@echo "    [CC]     $@"
>> +	$(Q)$(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $<
> 
> Until now we've had only man/ and it does not compile anything, now
> tests/ duplicate the .c.o: rule. The rules are not exported to subdirs,
> we need either to duplicate it in every subdir/Makefile or have
> something like Makefile.rules or builddefs, and each Makefile has to
> keep track back to the toplevel dir. We want to be able to 'make tests'
> but also just 'make' in the tests/ directory -- which does not work
> right now.

*nod* ok.  It's been a while since I did make hacking, sorry.

>> +
>> +all: $(progs)
>> +
> 
>> +clean :
>> +	$(Q)rm -f *.o .*.d $(progs)
>> +
>> +-include .*.d
> 
> This should probably look like the update in the toplevel makefile:
> 
> ifneq ($(MAKECMDGOALS),clean)
> -include $(objects:.o=.o.d) $(cmd-objects:.o=.o.d) $(subst .btrfs,, $(filter-out btrfsck.o.d, $(progs:=.o.d)))
> endif
> 
> and for the clean: rule a minor update: the .d files do not start with '.'.
> (Both introduced in "btrfs-progs: Fix automatic prerequisite generation")
> 
> Let's start with moving just the tests, see how the makefiles work and
> then proceed with cmds/ and the shared kernel files.

Sounds like a plan.

thanks for the review,
-Eric

> 
> david
> 


  reply	other threads:[~2013-09-03 20:53 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 ` [PATCH 2/3] Btrfs-progs: move test tools to tests/ subdir Eric Sandeen
2013-09-02 14:43   ` David Sterba
2013-09-03 20:53     ` Eric Sandeen [this message]
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=52264C3A.5010202@redhat.com \
    --to=sandeen@redhat.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=slash@ac.auone-net.jp \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.