From patchwork Wed Feb 24 09:26:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 42135 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 D3864385482D; Wed, 24 Feb 2021 09:26:07 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by sourceware.org (Postfix) with ESMTPS id 4D339385482D for ; Wed, 24 Feb 2021 09:26:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4D339385482D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dodji@seketeli.org X-Originating-IP: 88.120.130.27 Received: from localhost (unknown [88.120.130.27]) (Authenticated sender: dodji@seketeli.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id CAFB42000C for ; Wed, 24 Feb 2021 09:26:02 +0000 (UTC) Received: by localhost (Postfix, from userid 1000) id 42FE158000E; Wed, 24 Feb 2021 10:26:02 +0100 (CET) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH] tests: Update to catch.hpp v2.13.4 and fix #2178 Organization: Me, myself and I X-Operating-System: Fedora 34 X-URL: http://www.seketeli.net/~dodji Date: Wed, 24 Feb 2021 10:26:02 +0100 Message-ID: <87mtvt24wl.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, 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: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , Errors-To: libabigail-bounces@sourceware.org Sender: "Libabigail" Hello, This patch is about fixing a compilation error that we are seeing on Fedora Rawhide with glibc 2.33.9000, which makes MINSIGSTKSZ not be a constant value anymore. Thus, the sigStackSize variable that is declared constexpr cannot use that MINSIGSTKSZ as initializer anymore. So as suggested in the issue https://github.com/catchorg/Catch2/issues/2178 filed against 'catchorg' for this purpose, I am hardwiring the initialization value of sigStackSize for now. * tests/lib/catch.hpp: Update to v2.13.4 and initialize sigStackSize to 32768 for now, as suggested by https://github.com/catchorg/Catch2/issues/2178. Signed-off-by: Dodji Seketeli Applied to master. Signed-off-by: Dodji Seketeli --- tests/lib/catch.hpp | 47 ++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/tests/lib/catch.hpp b/tests/lib/catch.hpp index 31745154..8bbc0a5b 100644 --- a/tests/lib/catch.hpp +++ b/tests/lib/catch.hpp @@ -1,7 +1,6 @@ -// SPDX-License-Identifier: BSL-1.0 /* - * Catch v2.13.3 - * Generated: 2020-10-31 18:20:31.045274 + * Catch v2.13.4 + * Generated: 2020-12-29 14:48:00.116107 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2020 Two Blue Cubes Ltd. All rights reserved. @@ -16,7 +15,7 @@ #define CATCH_VERSION_MAJOR 2 #define CATCH_VERSION_MINOR 13 -#define CATCH_VERSION_PATCH 3 +#define CATCH_VERSION_PATCH 4 #ifdef __clang__ # pragma clang system_header @@ -10820,8 +10819,12 @@ namespace Catch { // 32kb for the alternate stack seems to be sufficient. However, this value // is experimentally determined, so that's not guaranteed. - static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ; + //static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ; + // Since glibc 2.33.9000 MINSIGSTKSZ is no more a constant. So, + // let's hardwire this for now as suggested by + // https://github.com/catchorg/Catch2/issues/2178. + static constexpr std::size_t sigStackSize = 32768; static SignalDefs signalDefs[] = { { SIGINT, "SIGINT - Terminal interrupt signal" }, { SIGILL, "SIGILL - Illegal instruction signal" }, @@ -14127,24 +14130,28 @@ namespace Catch { namespace { struct TestHasher { - explicit TestHasher(Catch::SimplePcg32& rng_instance) { - basis = rng_instance(); - basis <<= 32; - basis |= rng_instance(); - } + using hash_t = uint64_t; - uint64_t basis; + explicit TestHasher( hash_t hashSuffix ): + m_hashSuffix{ hashSuffix } {} - uint64_t operator()(TestCase const& t) const { - // Modified FNV-1a hash - static constexpr uint64_t prime = 1099511628211; - uint64_t hash = basis; - for (const char c : t.name) { + uint32_t operator()( TestCase const& t ) const { + // FNV-1a hash with multiplication fold. + const hash_t prime = 1099511628211u; + hash_t hash = 14695981039346656037u; + for ( const char c : t.name ) { hash ^= c; hash *= prime; } - return hash; + hash ^= m_hashSuffix; + hash *= prime; + const uint32_t low{ static_cast( hash ) }; + const uint32_t high{ static_cast( hash >> 32 ) }; + return low * high; } + + private: + hash_t m_hashSuffix; }; } // end unnamed namespace @@ -14162,9 +14169,9 @@ namespace Catch { case RunTests::InRandomOrder: { seedRng( config ); - TestHasher h( rng() ); + TestHasher h{ config.rngSeed() }; - using hashedTest = std::pair; + using hashedTest = std::pair; std::vector indexed_tests; indexed_tests.reserve( unsortedTestCases.size() ); @@ -15317,7 +15324,7 @@ namespace Catch { } Version const& libraryVersion() { - static Version version( 2, 13, 3, "", 0 ); + static Version version( 2, 13, 4, "", 0 ); return version; }