[PATCH v2] string: Make tst-strerror/tst-strsignal unsupported if msgfmt is not installed

Adhemerval Zanella adhemerval.zanella@linaro.org
Thu Jul 9 18:38:27 GMT 2020



On 09/07/2020 15:35, Carlos O'Donell wrote:
> On 7/9/20 2:28 PM, Adhemerval Zanella via Libc-alpha wrote:
>> Without msgfmt libc.mo files are not generated and its loading failure
>> is silent ignored with xsetlocale.
>>
>> Also unset LANGUAGE environment variable to avoid it taking precedence
>> when loading the message catalog.  Although not strictly required
>> (since the test is issued with test-container and it sets a strict
>> environment variable) it follows other tests that deal with
>> translation.
>>
>> Checked on x86_64-linux-gnu.
>> ---
>>  string/Makefile        | 11 ++++++++++-
>>  string/tst-strerror.c  |  3 +++
>>  string/tst-strsignal.c |  3 +++
>>  3 files changed, 16 insertions(+), 1 deletion(-)
>>
>> diff --git a/string/Makefile b/string/Makefile
>> index 206c9b103c..e958431f60 100644
>> --- a/string/Makefile
>> +++ b/string/Makefile
>> @@ -65,7 +65,16 @@ tests		:= tester inl-tester noinl-tester testcopy test-ffs	\
>>  		   test-endian-sign-conversion tst-memmove-overflow	\
>>  		   test-sig_np
>>  
>> -tests-container += tst-strsignal tst-strerror
>> +# Both tests require the .mo translation files generated by msgfmt.
>> +tests-translation := tst-strsignal					\
>> +		     tst-strerror
>> +
>> +ifneq ($(MSGFMT),:)
>> +tests-container   += $(tests-translation)
>> +else
>> +tests             += $(tests-translation)
>> +tests-unsupported += $(tests-translation)
>> +endif
> 
> Does it work if we do this?
> 
> # Both tests require the .mo translation files generated by msgfmt.
> tests-container += tst-strsignal tst-strerror
> ifeq ($(MSGFMT),:)
> tests-unsupported += $(tests-translation)
> endif
> 
> Shorter and easier to read and understand.

It does and it is indeed simpler, thanks.


More information about the Libc-alpha mailing list