Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1702535 > unrolled thread

[PATCH] selftests: futex: fix run_tests target

Started byShuah Khan <shuahkh@osg.samsung.com>
First post2017-08-03 00:40 +0200
Last post2017-08-04 18:50 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] selftests: futex: fix run_tests target Shuah Khan <shuahkh@osg.samsung.com> - 2017-08-03 00:40 +0200
    Re: [PATCH] selftests: futex: fix run_tests target Darren Hart <dvhart@infradead.org> - 2017-08-03 03:00 +0200
      Re: [PATCH] selftests: futex: fix run_tests target Shuah Khan <shuahkh@osg.samsung.com> - 2017-08-03 03:10 +0200
        Re: [PATCH] selftests: futex: fix run_tests target Darren Hart <dvhart@infradead.org> - 2017-08-04 18:50 +0200

#1702535 — [PATCH] selftests: futex: fix run_tests target

FromShuah Khan <shuahkh@osg.samsung.com>
Date2017-08-03 00:40 +0200
Subject[PATCH] selftests: futex: fix run_tests target
Message-ID<uaat4-7J5-11@gated-at.bofh.it>
make -C tools/testing/selftests/futex/ run_tests doesn't run the tests.
Running run_tests target only when $(OUTPUT) is the $(PWD) is incorrect.
When $(OUTPUT) is empty, run_tests will not run. Fix it.

Fixes: a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT")
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/testing/selftests/futex/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/futex/Makefile b/tools/testing/selftests/futex/Makefile
index e2fbb890aef9..7c647f619d63 100644
--- a/tools/testing/selftests/futex/Makefile
+++ b/tools/testing/selftests/futex/Makefile
@@ -14,7 +14,7 @@ all:
 	done
 
 override define RUN_TESTS
-	@if [ `dirname $(OUTPUT)` = $(PWD) ]; then ./run.sh; fi
+	$(OUTPUT)/run.sh
 endef
 
 override define INSTALL_RULE
-- 
2.11.0

[toc] | [next] | [standalone]


#1702594

FromDarren Hart <dvhart@infradead.org>
Date2017-08-03 03:00 +0200
Message-ID<uacEy-Fh-5@gated-at.bofh.it>
In reply to#1702535
On Wed, Aug 02, 2017 at 04:31:42PM -0600, Shuah Khan wrote:
> make -C tools/testing/selftests/futex/ run_tests doesn't run the tests.
> Running run_tests target only when $(OUTPUT) is the $(PWD) is incorrect.
> When $(OUTPUT) is empty, run_tests will not run. Fix it.
> 
> Fixes: a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT")
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>

So this indeed addresses the problem you reported.

I'm curious about why this was changed like it was. I presume to avoid
some issues with relative paths, like the ./run.sh and the "cd
functional" within run.sh.... but I haven't been able to trigger that.

When you say $(OUTPUT) is empty - when does that occur? Because if it
was in fact "" then the change below would attempt to execute /run.sh
... which is surely not what we want.

> ---
>  tools/testing/selftests/futex/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/futex/Makefile b/tools/testing/selftests/futex/Makefile
> index e2fbb890aef9..7c647f619d63 100644
> --- a/tools/testing/selftests/futex/Makefile
> +++ b/tools/testing/selftests/futex/Makefile
> @@ -14,7 +14,7 @@ all:
>  	done
>  
>  override define RUN_TESTS
> -	@if [ `dirname $(OUTPUT)` = $(PWD) ]; then ./run.sh; fi
> +	$(OUTPUT)/run.sh
>  endef
>  
>  override define INSTALL_RULE
> -- 
> 2.11.0
> 
> 

-- 
Darren Hart
VMware Open Source Technology Center

[toc] | [prev] | [next] | [standalone]


#1702601

FromShuah Khan <shuahkh@osg.samsung.com>
Date2017-08-03 03:10 +0200
Message-ID<uacOe-Z0-13@gated-at.bofh.it>
In reply to#1702594
On 08/02/2017 06:52 PM, Darren Hart wrote:
> On Wed, Aug 02, 2017 at 04:31:42PM -0600, Shuah Khan wrote:
>> make -C tools/testing/selftests/futex/ run_tests doesn't run the tests.
>> Running run_tests target only when $(OUTPUT) is the $(PWD) is incorrect.
>> When $(OUTPUT) is empty, run_tests will not run. Fix it.
>>
>> Fixes: a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT")
>> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> 
> So this indeed addresses the problem you reported.
> 
> I'm curious about why this was changed like it was. I presume to avoid
> some issues with relative paths, like the ./run.sh and the "cd
> functional" within run.sh.... but I haven't been able to trigger that.> 
> When you say $(OUTPUT) is empty - when does that occur? Because if it
> was in fact "" then the change below would attempt to execute /run.sh
> ... which is surely not what we want.

This will not happen. At this stage, OUTPUT will not be empty.

I didn't explain the condition correctly in my change log. When OUTPUT
isn't set (which is the usual case when test is run using:

make -C tools/testing/selftests/futex run_tests

lib.mk sets it to OUTPUT := $(shell pwd)

So OUTPUT will be the current directory when run_tests are run.

> 
>> ---
>>  tools/testing/selftests/futex/Makefile | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/futex/Makefile b/tools/testing/selftests/futex/Makefile
>> index e2fbb890aef9..7c647f619d63 100644
>> --- a/tools/testing/selftests/futex/Makefile
>> +++ b/tools/testing/selftests/futex/Makefile
>> @@ -14,7 +14,7 @@ all:
>>  	done
>>  
>>  override define RUN_TESTS
>> -	@if [ `dirname $(OUTPUT)` = $(PWD) ]; then ./run.sh; fi

The above change was made in conjunction with the
a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT")

The above change didn't anticipate failures when tests are run outside
the selftests/Makefile umbrella via make -C tools/testing/selftests/testdir

>> +	$(OUTPUT)/run.sh
>>  endef
>>  
>>  override define INSTALL_RULE
>> -- 
>> 2.11.0
>>
>>
> 

thanks,
-- Shuah

[toc] | [prev] | [next] | [standalone]


#1704105

FromDarren Hart <dvhart@infradead.org>
Date2017-08-04 18:50 +0200
Message-ID<uaNXs-125-19@gated-at.bofh.it>
In reply to#1702601
On Wed, Aug 02, 2017 at 07:06:39PM -0600, Shuah Khan wrote:
> On 08/02/2017 06:52 PM, Darren Hart wrote:
> > On Wed, Aug 02, 2017 at 04:31:42PM -0600, Shuah Khan wrote:
> >> make -C tools/testing/selftests/futex/ run_tests doesn't run the tests.
> >> Running run_tests target only when $(OUTPUT) is the $(PWD) is incorrect.
> >> When $(OUTPUT) is empty, run_tests will not run. Fix it.
> >>
> >> Fixes: a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT")
> >> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> > 
> > So this indeed addresses the problem you reported.
> > 
> > I'm curious about why this was changed like it was. I presume to avoid
> > some issues with relative paths, like the ./run.sh and the "cd
> > functional" within run.sh.... but I haven't been able to trigger that.> 
> > When you say $(OUTPUT) is empty - when does that occur? Because if it
> > was in fact "" then the change below would attempt to execute /run.sh
> > ... which is surely not what we want.
> 
> This will not happen. At this stage, OUTPUT will not be empty.
> 
> I didn't explain the condition correctly in my change log. When OUTPUT
> isn't set (which is the usual case when test is run using:
> 
> make -C tools/testing/selftests/futex run_tests
> 
> lib.mk sets it to OUTPUT := $(shell pwd)
> 
> So OUTPUT will be the current directory when run_tests are run.

Thank you for the clarification.

Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org>

-- 
Darren Hart
VMware Open Source Technology Center

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web