[Spice-devel] [vdagent-linux PATCH v1] Makefile.am: define check_PROGRAMS once

Uri Lublin uril at redhat.com
Tue Feb 19 18:32:07 UTC 2019


On 2/19/19 7:39 PM, Frediano Ziglio wrote:
>>
>> Also define TESTS once
>>
>> autoreconf complains when there are multiple definitions of
>> a variable. In this case (partial error message follows):
>>      warning: check_PROGRAMS multiply defined
>>
>> Signed-off-by: Uri Lublin <uril at redhat.com>
>> ---
>>   Makefile.am | 13 ++++++-------
>>   1 file changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/Makefile.am b/Makefile.am
>> index c2e9668..d1afae2 100644
>> --- a/Makefile.am
>> +++ b/Makefile.am
>> @@ -3,7 +3,12 @@ NULL =
>>   
>>   bin_PROGRAMS = src/spice-vdagent
>>   sbin_PROGRAMS = src/spice-vdagentd
>> -check_PROGRAMS = tests/test-file-xfers
>> +
>> +check_PROGRAMS = 				\
>> +	tests/test-file-xfers			\
>> +	tests/test-device-info			\
>> +	$(NULL)
>> +
> 
> Why instead using += on the others so to keep the future changes
> together? See below
> 
>>   TESTS = $(check_PROGRAMS)
>>   
>>   common_sources =				\
>> @@ -167,9 +172,3 @@ DISTCHECK_CONFIGURE_FLAGS =			\
>>   tests_test_device_info_LDADD = $(src_spice_vdagent_LDADD)
>>   tests_test_device_info_CFLAGS = $(src_spice_vdagent_CFLAGS)
>>   
>> -check_PROGRAMS = 					\
>> -	tests/test-device-info			\
>> -	$(NULL)
> 
> Here it would be just
> 
> check_PROGRAMS += tests/test-device-info

Of course that's also possible.
We can do it that way.

> 
>> -
>> -TESTS = $(check_PROGRAMS)
> 
> Surely this must go, no reason to define it again
> 
> This has the advantage that to add a test you just need to
> add some lines like:
> 
> tests_test_xxx_LDADD = $(src_spice_vdagent_LDADD)
> tests_test_xxx_CFLAGS = $(src_spice_vdagent_CFLAGS)
> check_PROGRAMS += tests/test-xxx
> 
> The difference is that this change is contained in one
> diff hunk while having to add the test on the top
> check_PROGRAMS macro would need 2 hunks

OK, I'll send a V2.
Maybe I'll keep the TESTS at the bottom, since check_PROGRAMS
keeps changing (not sure it makes a difference - I can check
but for sure keeping it at the bottom is "safe").

Thanks,
     Uri.


More information about the Spice-devel mailing list