From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by sourceware.org (Postfix) with ESMTP id 2CCBB3858D34 for ; Thu, 9 Jul 2020 17:12:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2CCBB3858D34 Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-213-MEeF7-Q_MMWaVkz_v5Oi6Q-1; Thu, 09 Jul 2020 13:12:13 -0400 X-MC-Unique: MEeF7-Q_MMWaVkz_v5Oi6Q-1 Received: by mail-qk1-f199.google.com with SMTP id h4so2253713qkl.23 for ; Thu, 09 Jul 2020 10:12:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=z3Cxa+Fyp3dRfCpYWNbhHQmxQXOZAUHwLNsZQr7GxIk=; b=Pv9a6CsoT8o26GjRJBQ4SHl9NIbx4+biveJwihP5a4QHiuJ0e0iFJRQvXuwQVc7G2y uvPnk3cWR4Q81IoupYS1AGeQOSJRJN/5+gyU2T52uaxFFO9vJ7RzReEdjfnezAIz3nZN j1hUPWeDDiaByEPIkUOqI6yUFfRzgOawRx58CnToVaJWUIURtxZvvwewlHjxiTBbpaDf UDfTePJsZcudHFuRnH202dumk9K9zUtM2E738EuIQoCUtzRtU9thYqDqwurXXS3uMZgN 8+OlC25MbMBK5c4J8VrluwT7/rK6CCLMvbsiYA6lcebFOXCdMhYnOsC3AgBCAhw0A6P9 sD2Q== X-Gm-Message-State: AOAM5327+gT8LtJhVqsoYuQo5txoz24Mcc9HBXnb+6AFVwrvz5/BN9fj 1rSpWJbpHNhzFBaj3FO4zTITBFY3c5dWyXHUW+ta99JVNX49at19adtTglmVzvHd3EPL1BsqLCV MSo+MfGM8Ek933bS43b1F X-Received: by 2002:a05:6214:4c4:: with SMTP id ck4mr62543520qvb.202.1594314732845; Thu, 09 Jul 2020 10:12:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGr1PESmpLBBOj23uVUrB1RXYXOjwB1FJl/iFxA2c9wDESLvnwMX5Ohw9ux2X82sbLE93pUw== X-Received: by 2002:a05:6214:4c4:: with SMTP id ck4mr62543504qvb.202.1594314732618; Thu, 09 Jul 2020 10:12:12 -0700 (PDT) Received: from [192.168.1.4] (198-84-170-103.cpe.teksavvy.com. [198.84.170.103]) by smtp.gmail.com with ESMTPSA id u22sm4600122qtb.23.2020.07.09.10.12.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Jul 2020 10:12:11 -0700 (PDT) Subject: Re: [PATCH] string: Do not run tst-strerror/tst-strsignal if msgfmt is not installed To: Adhemerval Zanella , libc-alpha@sourceware.org References: <20200709163753.3357365-1-adhemerval.zanella@linaro.org> From: Carlos O'Donell Organization: Red Hat Message-ID: Date: Thu, 9 Jul 2020 13:12:10 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200709163753.3357365-1-adhemerval.zanella@linaro.org> Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2020 17:12:18 -0000 On 7/9/20 12:37 PM, Adhemerval Zanella 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. Please use tests-unsupported. > --- > string/Makefile | 3 +++ > string/tst-strerror.c | 3 +++ > string/tst-strsignal.c | 3 +++ > 3 files changed, 9 insertions(+) > > diff --git a/string/Makefile b/string/Makefile > index 206c9b103c..6d4f88ef36 100644 > --- a/string/Makefile > +++ b/string/Makefile > @@ -65,7 +65,10 @@ tests := tester inl-tester noinl-tester testcopy test-ffs \ > test-endian-sign-conversion tst-memmove-overflow \ > test-sig_np > > +# Both tests requires the .mo translation files generated by msgfmt. > +ifneq ($(MSGFMT),:) All tests should always be present in all configurations. > tests-container += tst-strsignal tst-strerror > +endif You need to use tests-unsupported to mark the tests as unsupported. > > # This test allocates a lot of memory and can run for a long time. > xtests = tst-strcoll-overflow > diff --git a/string/tst-strerror.c b/string/tst-strerror.c > index 3af51236d7..1fc202e4ea 100644 > --- a/string/tst-strerror.c > +++ b/string/tst-strerror.c > @@ -19,6 +19,7 @@ > > #include > #include > +#include > #include > #include > #include > @@ -29,6 +30,8 @@ > static int > do_test (void) > { > + unsetenv ("LANGUAGE"); > + > xsetlocale (LC_ALL, "C"); > > TEST_COMPARE_STRING (strerror (EINVAL), "Invalid argument"); > diff --git a/string/tst-strsignal.c b/string/tst-strsignal.c > index 3f6764989f..2c549f4620 100644 > --- a/string/tst-strsignal.c > +++ b/string/tst-strsignal.c > @@ -20,6 +20,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -29,6 +30,8 @@ > static int > do_test (void) > { > + unsetenv ("LANGUAGE"); > + > xsetlocale (LC_ALL, "C"); > > TEST_COMPARE_STRING (strsignal (SIGINT), "Interrupt"); > -- Cheers, Carlos.