From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 22CBE1F463 for ; Sun, 5 Jan 2020 19:59:30 +0000 (UTC) Received: from localhost ([::1]:44880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioC3c-0003ad-6R for normalperson@yhbt.net; Sun, 05 Jan 2020 14:59:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51605) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioC3X-0003aV-5Z for bug-gnulib@gnu.org; Sun, 05 Jan 2020 14:59:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioC3U-0002IC-Fw for bug-gnulib@gnu.org; Sun, 05 Jan 2020 14:59:22 -0500 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::3]:36016) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ioC3T-0002DO-QL for bug-gnulib@gnu.org; Sun, 05 Jan 2020 14:59:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1578254354; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=eqnqD4y5QFba1F7dUxmfFJlzTdRZIZBqTHiANoT11Ck=; b=QQcBZBDIry4UsnCb+940pKKqKoFqPPAhbdqMoNm6kOMxMJ9TaHyiJu3vLHuszo7jpF NFeooSxKtBSKQP7H4UOa/1hsUVODTmru7itXKVUx0HQsopbebxafnNih3zu8mRCiqY84 59sLpYbamPlku6AGHaZJNnFdCJ0OSJ82e8O1pE5Q5ZWrOfds2NUQgY9K2JlJbMTe9brq hibeY9taOgrP11CRsPWAV4UTKTNqpYBMHrV0Mb5HsecNlxErprDPnDxQvXxPw+5YIw2y fB0UQHHz8KyffHpQv+rpYuqmdK+z+UpCFDNzll8tqU80AvG0YJkZIbyoBsrlnEI1uNow ZIPQ== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOH6fzxfs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 46.1.3 DYNA|AUTH) with ESMTPSA id R06a06w05Jx9SUm (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Sun, 5 Jan 2020 20:59:09 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org Subject: Re: [PATCH] tests: skip thread-using tests when threading is disabled Date: Sun, 05 Jan 2020 20:59:06 +0100 Message-ID: <1983893.C1IdX6Mnzd@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-170-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart4156950.F8CL0l4X42" Content-Transfer-Encoding: 7Bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5300::3 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jim Meyering Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" This is a multi-part message in MIME format. --nextPart4156950.F8CL0l4X42 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hi Jim, > sed's configure.ac specifies gl_DISABLE_THREADS, and that caused three > thread-using gnulib tests to fail. Add an #if-guarded exit (77) to each > of those, so they are skipped in this case. Thanks for this. I prefer to move the #if around most of the file, - because the main() function here already is quite complex, - so that there's less trouble if someone wants to use --avoid=thread some day. Pushed the attached patch. Bruno --nextPart4156950.F8CL0l4X42 Content-Disposition: attachment; filename="0001-tests-skip-thread-using-tests-when-threading-is-disa.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="0001-tests-skip-thread-using-tests-when-threading-is-disa.patch" >From a7903da07d3d18c23314aa0815adbb4058fd7cec Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 5 Jan 2020 10:25:27 -0800 Subject: [PATCH] tests: skip thread-using tests when threading is disabled sed's configure.ac specifies gl_DISABLE_THREADS, and that caused three thread-using gnulib tests to fail. Add an #if-guarded exit (77) to each of those, so they are skipped in this case. * tests/test-nl_langinfo-mt.c (main): Exit 77 when threading is disabled. * tests/test-setlocale_null-mt-all.c (main): Likewise. * tests/test-setlocale_null-mt-one.c (main): Likewise. --- ChangeLog | 10 ++++++++++ tests/test-nl_langinfo-mt.c | 17 +++++++++++++++++ tests/test-setlocale_null-mt-all.c | 17 +++++++++++++++++ tests/test-setlocale_null-mt-one.c | 17 +++++++++++++++++ 4 files changed, 61 insertions(+) diff --git a/ChangeLog b/ChangeLog index c8a9dbf..6d5228e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2020-01-05 Jim Meyering + + tests: skip thread-using tests when threading is disabled + sed's configure.ac specifies gl_DISABLE_THREADS, and that caused three + thread-using gnulib tests to fail. Add an #if-guarded exit (77) to each + of those, so they are skipped in this case. + * tests/test-nl_langinfo-mt.c (main): Exit 77 when threading is disabled. + * tests/test-setlocale_null-mt-all.c (main): Likewise. + * tests/test-setlocale_null-mt-one.c (main): Likewise. + 2020-01-05 Bruno Haible tests: Avoid GCC over-optimization caused by _GL_ARG_NONNULL attributes. diff --git a/tests/test-nl_langinfo-mt.c b/tests/test-nl_langinfo-mt.c index 55f9db9..de6cd99 100644 --- a/tests/test-nl_langinfo-mt.c +++ b/tests/test-nl_langinfo-mt.c @@ -18,6 +18,8 @@ #include +#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS + /* Specification. */ #include @@ -236,3 +238,18 @@ main (int argc, char *argv[]) return 0; } + +#else + +/* No multithreading available. */ + +#include + +int +main () +{ + fputs ("Skipping test: multithreading not enabled\n", stderr); + return 77; +} + +#endif diff --git a/tests/test-setlocale_null-mt-all.c b/tests/test-setlocale_null-mt-all.c index a4f91d9..19bdb55 100644 --- a/tests/test-setlocale_null-mt-all.c +++ b/tests/test-setlocale_null-mt-all.c @@ -18,6 +18,8 @@ #include +#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS + /* Specification. */ #include @@ -131,6 +133,21 @@ main (int argc, char *argv[]) return 0; } +#else + +/* No multithreading available. */ + +#include + +int +main () +{ + fputs ("Skipping test: multithreading not enabled\n", stderr); + return 77; +} + +#endif + /* Without locking, the results of this test would be: glibc OK musl libc crash < 10 sec diff --git a/tests/test-setlocale_null-mt-one.c b/tests/test-setlocale_null-mt-one.c index dc9d4aa..fd6083a 100644 --- a/tests/test-setlocale_null-mt-one.c +++ b/tests/test-setlocale_null-mt-one.c @@ -18,6 +18,8 @@ #include +#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS + /* Specification. */ #include @@ -131,6 +133,21 @@ main (int argc, char *argv[]) return 0; } +#else + +/* No multithreading available. */ + +#include + +int +main () +{ + fputs ("Skipping test: multithreading not enabled\n", stderr); + return 77; +} + +#endif + /* Without locking, the results of this test would be: glibc OK musl libc OK -- 2.7.4 --nextPart4156950.F8CL0l4X42--