diff mbox

[1/2] selftests/lib.mk: fix INSTALL_RULE

Message ID 1431467947-29847-2-git-send-email-tyler.baker@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Tyler Baker May 12, 2015, 9:59 p.m. UTC
From: Tyler Baker <tyler.baker@linaro.org>

This patch fixes the INSTALL_RULE to gracefully handle the case where
TEST_PROGS and TEST_PROGS_EXTENDED and TEST_FILES are not set. In this case,
install is called without any SOURCE arguments causing make install to fail.
The proposed fix is to loop over the items in these variables and only call
install if there is a test artifact present.

Signed-off-by: Tyler Baker <tyler.baker@linaro.org>
---
 tools/testing/selftests/lib.mk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Shuah Khan May 12, 2015, 10:02 p.m. UTC | #1
On 05/12/2015 03:59 PM, tyler.baker@linaro.org wrote:
> From: Tyler Baker <tyler.baker@linaro.org>

This is odd. Did you use git send-email to send the patches?

-- Shuah
> 
> This patch fixes the INSTALL_RULE to gracefully handle the case where
> TEST_PROGS and TEST_PROGS_EXTENDED and TEST_FILES are not set. In this case,
> install is called without any SOURCE arguments causing make install to fail.
> The proposed fix is to loop over the items in these variables and only call
> install if there is a test artifact present.
> 
> Signed-off-by: Tyler Baker <tyler.baker@linaro.org>
> ---
>  tools/testing/selftests/lib.mk | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
> index ee412ba..89dd785f 100644
> --- a/tools/testing/selftests/lib.mk
> +++ b/tools/testing/selftests/lib.mk
> @@ -13,10 +13,12 @@ run_tests: all
>  
>  define INSTALL_RULE
>  	mkdir -p $(INSTALL_PATH)
> -	@for TEST_DIR in $(TEST_DIRS); do\
> +	@for TEST_DIR in $(TEST_DIRS); do \
>  		cp -r $$TEST_DIR $(INSTALL_PATH); \
>  	done;
> -	install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
> +	@for ARTIFACT in $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES); do \
> +		install -t $(INSTALL_PATH) $$ARTIFACT; \
> +	done;
>  endef
>  
>  install: all
>
Tyler Baker May 12, 2015, 10:04 p.m. UTC | #2
On 12 May 2015 at 15:02, Shuah Khan <shuahkh@osg.samsung.com> wrote:
> On 05/12/2015 03:59 PM, tyler.baker@linaro.org wrote:
>> From: Tyler Baker <tyler.baker@linaro.org>
>
> This is odd. Did you use git send-email to send the patches?

Yes I did.

>
> -- Shuah
>>
>> This patch fixes the INSTALL_RULE to gracefully handle the case where
>> TEST_PROGS and TEST_PROGS_EXTENDED and TEST_FILES are not set. In this case,
>> install is called without any SOURCE arguments causing make install to fail.
>> The proposed fix is to loop over the items in these variables and only call
>> install if there is a test artifact present.
>>
>> Signed-off-by: Tyler Baker <tyler.baker@linaro.org>
>> ---
>>  tools/testing/selftests/lib.mk | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
>> index ee412ba..89dd785f 100644
>> --- a/tools/testing/selftests/lib.mk
>> +++ b/tools/testing/selftests/lib.mk
>> @@ -13,10 +13,12 @@ run_tests: all
>>
>>  define INSTALL_RULE
>>       mkdir -p $(INSTALL_PATH)
>> -     @for TEST_DIR in $(TEST_DIRS); do\
>> +     @for TEST_DIR in $(TEST_DIRS); do \
>>               cp -r $$TEST_DIR $(INSTALL_PATH); \
>>       done;
>> -     install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
>> +     @for ARTIFACT in $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES); do \
>> +             install -t $(INSTALL_PATH) $$ARTIFACT; \
>> +     done;
>>  endef
>>
>>  install: all
>>
>
>
> --
> Shuah Khan
> Sr. Linux Kernel Developer
> Open Source Innovation Group
> Samsung Research America (Silicon Valley)
> shuahkh@osg.samsung.com | (970) 217-8978
Shuah Khan May 12, 2015, 10:07 p.m. UTC | #3
On 05/12/2015 04:04 PM, Tyler Baker wrote:
> On 12 May 2015 at 15:02, Shuah Khan <shuahkh@osg.samsung.com> wrote:
>> On 05/12/2015 03:59 PM, tyler.baker@linaro.org wrote:
>>> From: Tyler Baker <tyler.baker@linaro.org>
>>
>> This is odd. Did you use git send-email to send the patches?
> 
> Yes I did.
> 

No need to resend. I will try to apply them. Check your .gitconfig.
The extra From is odd.

-- Shuah
Tyler Baker May 12, 2015, 10:41 p.m. UTC | #4
On 12 May 2015 at 15:07, Shuah Khan <shuahkh@osg.samsung.com> wrote:
> On 05/12/2015 04:04 PM, Tyler Baker wrote:
>> On 12 May 2015 at 15:02, Shuah Khan <shuahkh@osg.samsung.com> wrote:
>>> On 05/12/2015 03:59 PM, tyler.baker@linaro.org wrote:
>>>> From: Tyler Baker <tyler.baker@linaro.org>
>>>
>>> This is odd. Did you use git send-email to send the patches?
>>
>> Yes I did.
>>
>
> No need to resend. I will try to apply them. Check your .gitconfig.
> The extra From is odd.

Sorry about that, not sure why this has happened. I'll investigate on
my end. Thanks.

>
> -- Shuah
>
> --
> Shuah Khan
> Sr. Linux Kernel Developer
> Open Source Innovation Group
> Samsung Research America (Silicon Valley)
> shuahkh@osg.samsung.com | (970) 217-8978
diff mbox

Patch

diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index ee412ba..89dd785f 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -13,10 +13,12 @@  run_tests: all
 
 define INSTALL_RULE
 	mkdir -p $(INSTALL_PATH)
-	@for TEST_DIR in $(TEST_DIRS); do\
+	@for TEST_DIR in $(TEST_DIRS); do \
 		cp -r $$TEST_DIR $(INSTALL_PATH); \
 	done;
-	install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
+	@for ARTIFACT in $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES); do \
+		install -t $(INSTALL_PATH) $$ARTIFACT; \
+	done;
 endef
 
 install: all