linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: fix prepending $(OUTPUT) to $(TEST_PROGS)
@ 2019-09-03 14:50 Ilya Leoshkevich
  2019-09-06 16:19 ` shuah
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Leoshkevich @ 2019-09-03 14:50 UTC (permalink / raw)
  To: Shuah Khan
  Cc: linux-kselftest, Heiko Carstens, Vasily Gorbik, Ilya Leoshkevich

The current logic prepends $(OUTPUT) only to the first member of
$(TEST_PROGS). Use $(foreach) loop to prepend it to each member.

Fixes: 1a940687e424 ("selftests: lib.mk: copy test scripts and test files for make O=dir run")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
 tools/testing/selftests/lib.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 1c8a1963d03f..857916ebbb9b 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -75,7 +75,8 @@ ifdef building_out_of_srctree
 		@rsync -aq $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(OUTPUT)
 	fi
 	@if [ "X$(TEST_PROGS)" != "X" ]; then
-		$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(OUTPUT)/$(TEST_PROGS))
+		$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) \
+				  $(foreach p,$(TEST_PROGS),$(OUTPUT)$(p)))
 	else
 		$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS))
 	fi
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests: fix prepending $(OUTPUT) to $(TEST_PROGS)
  2019-09-03 14:50 [PATCH] selftests: fix prepending $(OUTPUT) to $(TEST_PROGS) Ilya Leoshkevich
@ 2019-09-06 16:19 ` shuah
  0 siblings, 0 replies; 2+ messages in thread
From: shuah @ 2019-09-06 16:19 UTC (permalink / raw)
  To: Ilya Leoshkevich; +Cc: linux-kselftest, Heiko Carstens, Vasily Gorbik, shuah

On 9/3/19 8:50 AM, Ilya Leoshkevich wrote:
> The current logic prepends $(OUTPUT) only to the first member of
> $(TEST_PROGS). Use $(foreach) loop to prepend it to each member.
> 
> Fixes: 1a940687e424 ("selftests: lib.mk: copy test scripts and test files for make O=dir run")
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
>   tools/testing/selftests/lib.mk | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
> index 1c8a1963d03f..857916ebbb9b 100644
> --- a/tools/testing/selftests/lib.mk
> +++ b/tools/testing/selftests/lib.mk
> @@ -75,7 +75,8 @@ ifdef building_out_of_srctree
>   		@rsync -aq $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(OUTPUT)
>   	fi
>   	@if [ "X$(TEST_PROGS)" != "X" ]; then
> -		$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(OUTPUT)/$(TEST_PROGS))
> +		$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) \
> +				  $(foreach p,$(TEST_PROGS),$(OUTPUT)$(p)))
>   	else
>   		$(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS))
>   	fi
> 

Hmm. with this patch there is a regression:

make kselftest O=/tmp/kselftest TARGETS=splice

fails for me with


TAP version 13
1..1
# selftests: splice: splicedefault_file_splice_read.sh
# Warning: file /tmp/kselftest/splicedefault_file_splice_read.sh is missing!
not ok 1 selftests: splice: splicedefault_file_splice_read.sh
make[1]: Leaving directory '/tmp/kselftest'

Without your patch works just fine:

make kselftest O=/tmp/kselftest TARGETS=splice
make[1]: Entering directory '/tmp/kselftest'
make --no-builtin-rules INSTALL_HDR_PATH=$BUILD/usr \
	ARCH=x86 -C ../../.. headers_install
   INSTALL /tmp/kselftest/usr/include
gcc     default_file_splice_read.c  -o 
/tmp/kselftest/splice/default_file_splice_read
TAP version 13
1..1
# selftests: splice: default_file_splice_read.sh
ok 1 selftests: splice: default_file_splice_read.sh
make[1]: Leaving directory '/tmp/kselftest'


thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-06 16:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03 14:50 [PATCH] selftests: fix prepending $(OUTPUT) to $(TEST_PROGS) Ilya Leoshkevich
2019-09-06 16:19 ` shuah

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).