From patchwork Thu Jul 9 16:37:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 39997 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4DB0D3840C36; Thu, 9 Jul 2020 16:38:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DB0D3840C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594312684; bh=8IFBZvxGLR0hpnGVqXo9BDiRhm6Vx2Fox3Ur7DMfj6w=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Pn62q/baZ3yaBN4RkohRabgksmDP0+mq+meivcfa8dfjbMacjXdLdSwNtlf6D+VFM 5PauKtgSLHnFxs7BdhOYECsIVvVGZkW1mgYvBAulPhI9W5Kla9Zj+iknWnIwOwSR7r wYVxDT9ik+2ub1oJEtW0iD/ljzR2UcwVi3I/LnFs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by sourceware.org (Postfix) with ESMTPS id EF9C13840C2B for ; Thu, 9 Jul 2020 16:37:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EF9C13840C2B Received: by mail-qk1-x741.google.com with SMTP id l6so2390973qkc.6 for ; Thu, 09 Jul 2020 09:37:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8IFBZvxGLR0hpnGVqXo9BDiRhm6Vx2Fox3Ur7DMfj6w=; b=hBvSxOJ9ysUvFUt5ANvYFPJck2GjLo/b36y6W62RYAjRM2+sMP/4PxDS/ZJd66DeMP 327TDuufnZ6k4KYAGdAyyt7fB4G2EcGDzK1TSub2HYW788a1LtQc1KYpup0EDJYs2Ex5 OxaN45DiQrAxiE5aIgj36d0j0hIqyeTvUKQjGPdQVDteXSmDBa4k5HCpC+i3CkRfeuUc 0e41weWUojofakTpYxuRlIYmvAZcLDHviJP9Xvujt+qvGAnsZZxA3VUzhhfCpi583+IB 3TVYauP6rljpd839Jur4/LtlQVTWLtj9JQj7noLbwxZq8Zjpis5eZLA/Yad1QLyM6hmB J5rw== X-Gm-Message-State: AOAM533ZL8E0Cdu9At+TSwazXNtCXmeqpSckX2PraR6hab8Ufc9VyYCT j0DHnbb4qX3DyyHD+CU0Z6olJP/BxAg= X-Google-Smtp-Source: ABdhPJyCrnlakAKdDbfEhOV3Mww2+ca2lJZMaUirUPBsW9ZM93+JOXSdaJV7dS63sLAorPAW9W2FJQ== X-Received: by 2002:a37:5c04:: with SMTP id q4mr65526770qkb.192.1594312679334; Thu, 09 Jul 2020 09:37:59 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id u27sm4357285qkm.121.2020.07.09.09.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2020 09:37:58 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH] string: Do not run tst-strerror/tst-strsignal if msgfmt is not installed Date: Thu, 9 Jul 2020 13:37:53 -0300 Message-Id: <20200709163753.3357365-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-14.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" 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 | 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),:) tests-container += tst-strsignal tst-strerror +endif # 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");