[Top] [All Lists]

Re: [PATCH v2] xfstests: make install support common/ and tests/ dirs

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH v2] xfstests: make install support common/ and tests/ dirs
From: Wang Sheng-Hui <shhuiw@xxxxxxxxx>
Date: Sat, 13 Apr 2013 18:37:29 +0800
Cc: Dave Chinner <dchinner@xxxxxxxxxx>, Rich Johnston <rjohnston@xxxxxxx>, xfstests <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=kDLR1tA+SN6qj/+A31ZY1KfTgxjb0u4diJQQ8GaevqI=; b=QX2+yMqV+MkLpKkxeBM8m/ajp7qbFAPWxBp53si2OXAOHvdDciKAX8RL2c+HxODdYB MsTUmk4xYFA0RAKXUHjzIhlX/1ZGIqPmWeNvKRzhVvl+d+jsMny0RWXKs5BMOSYFsjrY cKyAceLOisfzIfuMYMJaY/LtiZeedXe8UJvXwnTY2V2hRTcL4XwMiCW5D1R25/W6nQDt bu2xazb6s0kO+KPKfrS9eot1OMdt+34Eex5CWam1ft14LOCcaXkrQHnfBDsq9aXhofPq wghjpjmzunxLo0EXbcUDcbl2XwxxfNAHm/tdgyrgXSYMCZSYaYjefm2tGER45xbcvdAQ 6noA==
In-reply-to: <51693104.2020707@xxxxxxxxx>
References: <51678D0D.1070002@xxxxxxxxx> <20130412074034.GC30622@dastard> <5168396C.6020801@xxxxxxxxx> <20130413003222.GG30622@dastard> <51693104.2020707@xxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0
On 2013å04æ13æ 18:18, Wang Sheng-Hui wrote:
On 2013å04æ13æ 08:32, Dave Chinner wrote:
On Sat, Apr 13, 2013 at 12:42:20AM +0800, Wang Sheng-Hui wrote:
On 2013å04æ12æ 15:40, Dave Chinner wrote:
On Fri, Apr 12, 2013 at 12:26:53PM +0800, Wang Sheng-Hui wrote:
+TOPDIR = ..
+include $(TOPDIR)/include/builddefs
+TESTS_SUBDIRS = $(shell find . -maxdepth 1 -type d | sed -n -e 's/\.\///gp')

This is much neater:

TESTS_SUBDIRS = $(sort $(dir $(wildcard  $(PWD)/*/)))

Hi Dave,

I introduces Makefile under tests/, which would return to TESTS_SUBDIRS with the
$(dir function. By running find in $(shell, TEST_SUBDIRS will only get the dir 
and no Makefile.

I think you misunderstand. The wildcard above only returns

$ pwd
  0  ~/src/xfstests-dev/tests
$ cat ~/tmp/Makefile
foo=$(sort $(dir $(wildcard  $(PWD)/*/)))

         @echo $(foo)
$ make -f ~/tmp/Makefile
/home/dave/src/xfstests-dev/tests/udf/ /home/dave/src/xfstests-dev/tests/xfs/


The output on my box is different with yours.

# pwd
# cat /tmp/Makefile
foo=$(sort $(dir $(wildcard  $(PWD)/*/)))
     @echo $(foo)
# make -f /tmp/Makefile foo
/root/workspace/xfstests/tests/ /root/workspace/xfstests/tests/btrfs/ 
/root/workspace/xfstests/tests/ext4/ /root/workspace/xfstests/tests/generic/ 
/root/workspace/xfstests/tests/shared/ /root/workspace/xfstests/tests/udf/ 

It always output the tests/ dir itself. If I used this for xfstests
'make install', it will fall into endless loop, for it will rerun
Makefile under /tests.



Seems it's the $(PWD) introduces the loop.
When make install under xfstests, $(PWD) will refer to the path to xfstests 
of xfstests/tests, even if is defined in xfstests/tests/Makefile.

Will send out the v3 patch later.


<Prev in Thread] Current Thread [Next in Thread>