From: Dodji Seketeli <dodji@seketeli.org>
To: libabigail@sourceware.org
Subject: [PATCH] tests: Update to catch.hpp v2.13.4 and fix #2178
Date: Wed, 24 Feb 2021 10:26:02 +0100 [thread overview]
Message-ID: <87mtvt24wl.fsf@seketeli.org> (raw)
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 <dodji@redhat.com>
Applied to master.
---
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<uint32_t>( hash ) };
+ const uint32_t high{ static_cast<uint32_t>( 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<uint64_t, TestCase const*>;
+ using hashedTest = std::pair<TestHasher::hash_t, TestCase const*>;
std::vector<hashedTest> 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;
}
--
2.30.0
--
Dodji
next reply other threads:[~2021-02-24 9:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-24 9:26 Dodji Seketeli [this message]
2021-02-24 9:41 ` Mark Wielaard
2021-03-08 10:42 ` Dodji Seketeli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mtvt24wl.fsf@seketeli.org \
--to=dodji@seketeli.org \
--cc=libabigail@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).