Skip to content

Commit de6fe18

Browse files
committed
v2.13.4
1 parent fe3dddc commit de6fe18

File tree

7 files changed

+44
-23
lines changed

7 files changed

+44
-23
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
1414
endif()
1515

1616

17-
project(Catch2 LANGUAGES CXX VERSION 2.13.3)
17+
project(Catch2 LANGUAGES CXX VERSION 2.13.4)
1818

1919
# Provide path for scripts
2020
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[![Join the chat in Discord: https://discord.gg/4CWS9zD](https://img.shields.io/badge/Discord-Chat!-brightgreen.svg)](https://discord.gg/4CWS9zD)
1010

1111

12-
<a href="https://github.com/catchorg/Catch2/releases/download/v2.13.3/catch.hpp">The latest version of the single header can be downloaded directly using this link</a>
12+
<a href="https://github.com/catchorg/Catch2/releases/download/v2.13.4/catch.hpp">The latest version of the single header can be downloaded directly using this link</a>
1313

1414
## Catch2 is released!
1515

docs/cmake-integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ the output file name e.g. ".xml".
177177
### `ParseAndAddCatchTests.cmake`
178178

179179
⚠ This script is [deprecated](https://github.com/catchorg/Catch2/pull/2120)
180-
in Catch X.Y.Z and superseded by the above approach using `catch_discover_tests`.
180+
in Catch 2.13.4 and superseded by the above approach using `catch_discover_tests`.
181181
See [#2092](https://github.com/catchorg/Catch2/issues/2092) for details.
182182

183183
`ParseAndAddCatchTests` works by parsing all implementation files

docs/release-notes.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Release notes
44
**Contents**<br>
5+
[2.13.4](#2134)<br>
56
[2.13.3](#2133)<br>
67
[2.13.2](#2132)<br>
78
[2.13.1](#2131)<br>
@@ -44,6 +45,22 @@
4445
[Even Older versions](#even-older-versions)<br>
4546

4647

48+
## 2.13.4
49+
50+
### Improvements
51+
* Improved the hashing algorithm used for shuffling test cases (#2070)
52+
* `TEST_CASE`s that differ only in the last character should be properly shuffled
53+
* Note that this means that v2.13.4 gives you a different order of test cases than 2.13.3, even given the same seed.
54+
55+
### Miscellaneous
56+
* Deprecated `ParseAndAddCatchTests` CMake integration (#2092)
57+
* It is impossible to implement it properly for all the different test case variants Catch2 provides, and there are better options provided.
58+
* Use `catch_discover_tests` instead, which uses runtime information about available tests.
59+
* Fixed bug in `catch_discover_tests` that would cause it to fail when used in specific project structures (#2119)
60+
* Added Bazel build file
61+
* Added an experimental static library target to CMake
62+
63+
4764
## 2.13.3
4865

4966
### Fixes

include/catch.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#define CATCH_VERSION_MAJOR 2
1313
#define CATCH_VERSION_MINOR 13
14-
#define CATCH_VERSION_PATCH 3
14+
#define CATCH_VERSION_PATCH 4
1515

1616
#ifdef __clang__
1717
# pragma clang system_header

include/internal/catch_version.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace Catch {
3737
}
3838

3939
Version const& libraryVersion() {
40-
static Version version( 2, 13, 3, "", 0 );
40+
static Version version( 2, 13, 4, "", 0 );
4141
return version;
4242
}
4343

single_include/catch2/catch.hpp

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Catch v2.13.3
3-
* Generated: 2020-10-31 18:20:31.045274
2+
* Catch v2.13.4
3+
* Generated: 2020-12-29 14:48:00.116107
44
* ----------------------------------------------------------
55
* This file has been merged from multiple headers. Please don't edit it directly
66
* Copyright (c) 2020 Two Blue Cubes Ltd. All rights reserved.
@@ -15,7 +15,7 @@
1515

1616
#define CATCH_VERSION_MAJOR 2
1717
#define CATCH_VERSION_MINOR 13
18-
#define CATCH_VERSION_PATCH 3
18+
#define CATCH_VERSION_PATCH 4
1919

2020
#ifdef __clang__
2121
# pragma clang system_header
@@ -14126,24 +14126,28 @@ namespace Catch {
1412614126

1412714127
namespace {
1412814128
struct TestHasher {
14129-
explicit TestHasher(Catch::SimplePcg32& rng_instance) {
14130-
basis = rng_instance();
14131-
basis <<= 32;
14132-
basis |= rng_instance();
14133-
}
14129+
using hash_t = uint64_t;
1413414130

14135-
uint64_t basis;
14131+
explicit TestHasher( hash_t hashSuffix ):
14132+
m_hashSuffix{ hashSuffix } {}
1413614133

14137-
uint64_t operator()(TestCase const& t) const {
14138-
// Modified FNV-1a hash
14139-
static constexpr uint64_t prime = 1099511628211;
14140-
uint64_t hash = basis;
14141-
for (const char c : t.name) {
14134+
uint32_t operator()( TestCase const& t ) const {
14135+
// FNV-1a hash with multiplication fold.
14136+
const hash_t prime = 1099511628211u;
14137+
hash_t hash = 14695981039346656037u;
14138+
for ( const char c : t.name ) {
1414214139
hash ^= c;
1414314140
hash *= prime;
1414414141
}
14145-
return hash;
14142+
hash ^= m_hashSuffix;
14143+
hash *= prime;
14144+
const uint32_t low{ static_cast<uint32_t>( hash ) };
14145+
const uint32_t high{ static_cast<uint32_t>( hash >> 32 ) };
14146+
return low * high;
1414614147
}
14148+
14149+
private:
14150+
hash_t m_hashSuffix;
1414714151
};
1414814152
} // end unnamed namespace
1414914153

@@ -14161,9 +14165,9 @@ namespace Catch {
1416114165

1416214166
case RunTests::InRandomOrder: {
1416314167
seedRng( config );
14164-
TestHasher h( rng() );
14168+
TestHasher h{ config.rngSeed() };
1416514169

14166-
using hashedTest = std::pair<uint64_t, TestCase const*>;
14170+
using hashedTest = std::pair<TestHasher::hash_t, TestCase const*>;
1416714171
std::vector<hashedTest> indexed_tests;
1416814172
indexed_tests.reserve( unsortedTestCases.size() );
1416914173

@@ -15316,7 +15320,7 @@ namespace Catch {
1531615320
}
1531715321

1531815322
Version const& libraryVersion() {
15319-
static Version version( 2, 13, 3, "", 0 );
15323+
static Version version( 2, 13, 4, "", 0 );
1532015324
return version;
1532115325
}
1532215326

0 commit comments

Comments
 (0)