Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/extras/catch_amalgamated.cpp
diff options
context:
space:
mode:
authorLeitwolf112026-10-11 02:56:25 +0300
committerLeitwolf112026-10-11 02:56:25 +0300
commit1f78d8903c2fb18afea8c3055f8df83d8c60d9b5 (patch)
treed76f5945311828511e3ea55712487f21fbf8f70f /extras/catch_amalgamated.cpp
parent5633c5c98ec073ae938253bcfc72430d5d9aee89 (diff)
downloadcatch3-1f78d8903c2fb18afea8c3055f8df83d8c60d9b5.tar.gz
Backport Catch2 3.16.1
Review Catch2 devel through 08092139210881f01a34e60c5f2fd6afa0ea4024, the commit of 3.16.1, and apply the eleven changes since the last reviewed revision in upstream order: d7683484 better message when a reporter cannot be initialized ea5020f0 custom argument validation in every first-party reporter aa01559e throwing-reporter test also throws in assertionEnded 45cd3987 noexcept on handleUnexpectedInflightException 6adbd539 MSVC optimizations enabled again after the benchmark headers e87f2882 no quadratic scaling for NTTP test registration 73d546cd REQUIRE expands its arguments fewer times under GCC and Clang b710039a decomposer operators as plain functions f899467b type-erased streaming of reconstructed expressions 8f0e70ca retired macos-14 runner dropped 08092139 version 3.16.1 and its release notes All of them applied to the sources without a conflict. The amalgamated distribution under extras/ conflicted because it is generated; it is generated again from the sources of this repository, which also brings it up to date with fork changes it had not picked up: the list-based stream pool, the Clang diagnostic boundary and the cassert include. No file under src/Progmasoft changes. The fork-owned texts that name the engine version say 3.16.1, and docs/upstream-status.md records the review. Upstream files keep their names, licenses and compiler options. Built with Clang 22 on Windows and tested: 148 of 149 tests pass. The one that fails, Reporters::CrashInJunitReporter, fails the same way on devel without this change with that compiler.
Diffstat (limited to 'extras/catch_amalgamated.cpp')
-rw-r--r--extras/catch_amalgamated.cpp96
1 files changed, 82 insertions, 14 deletions
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp
index c6a8de36..230849f1 100644
--- a/extras/catch_amalgamated.cpp
+++ b/extras/catch_amalgamated.cpp
@@ -6,8 +6,8 @@
// SPDX-License-Identifier: BSL-1.0
-// Catch v3.16.0
-// Generated: 2026-09-28 00:12:28.744397
+// Catch v3.16.1
+// Generated: 2026-10-11 02:09:25.622664
// ----------------------------------------------------------
// This file is an amalgamation of multiple different files.
// You probably shouldn't edit it directly.
@@ -1458,7 +1458,9 @@ namespace Catch {
int err = 0;
std::FILE* const file = openGuardFile( guardFilePath, err );
if ( file == nullptr ) {
+#if defined( _MSC_VER )
char msgBuffer[100] = {};
+#endif
std::string errMsg;
#if defined( _MSC_VER )
if ( !strerror_s( msgBuffer, err ) ) {
@@ -1677,7 +1679,17 @@ namespace Catch {
getCurrentMutableContext().setConfig(m_config.get());
// Create reporter(s) so we can route listings through them
- auto reporter = prepareReporters(m_config.get());
+ IEventListenerPtr reporter;
+ CATCH_TRY {
+ auto reporter_ = prepareReporters( m_config.get() );
+ swap( reporter, reporter_ );
+ }
+#if !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS )
+ catch ( std::exception& ex ) {
+ Catch::cerr() << "Error when creating reporter: " << ex.what() << '\n' << std::flush;
+ return ReporterConstructionErrorExitCode;
+ }
+#endif
auto const& invalidSpecs = m_config->testSpec().getInvalidSpecs();
if ( !invalidSpecs.empty() ) {
@@ -2586,7 +2598,7 @@ namespace Catch {
}
Version const& libraryVersion() {
- static Version version( 3, 16, 0, "", 0 );
+ static Version version( 3, 16, 1, "", 0 );
return version;
}
@@ -2922,7 +2934,7 @@ namespace Catch {
}
}
- void AssertionHandler::handleUnexpectedInflightException() {
+ void AssertionHandler::handleUnexpectedInflightException() noexcept {
m_resultCapture.handleUnexpectedInflightException( m_assertionInfo, Catch::translateActiveException(), m_reaction );
}
@@ -4234,13 +4246,6 @@ namespace Catch {
namespace Catch {
- void ITransientExpression::streamReconstructedExpression(
- std::ostream& os ) const {
- // We can't make this function pure virtual to keep ITransientExpression
- // constexpr, so we write error message instead
- os << "Some class derived from ITransientExpression without overriding streamReconstructedExpression";
- }
-
void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ) {
if( lhs.size() + rhs.size() < 40 &&
lhs.find('\n') == std::string::npos &&
@@ -6056,6 +6061,7 @@ ReporterSpec::ReporterSpec(
#include <cstdio>
+#include <list>
#include <sstream>
#include <tuple>
#include <vector>
@@ -6065,7 +6071,10 @@ namespace Catch {
// This class encapsulates the idea of a pool of ostringstreams that can be reused.
struct StringStreams {
std::vector<Detail::unique_ptr<std::ostringstream>> m_streams;
- std::vector<std::size_t> m_unused;
+ // The library can be linked into ASan-instrumented clients without
+ // instrumenting Catch3 itself. A list avoids mixed-mode libc++ vector
+ // container annotations for the reusable-index pool.
+ std::list<std::size_t> m_unused;
std::ostringstream m_referenceStream; // Used for copy state/ flags from
Detail::Mutex m_mutex;
@@ -9530,12 +9539,20 @@ namespace Catch {
+
#include <ostream>
namespace Catch {
AutomakeReporter::~AutomakeReporter() = default;
+ AutomakeReporter::AutomakeReporter( ReporterConfig&& _config ):
+ StreamingReporterBase( CATCH_MOVE( _config ) ) {
+ rejectSuperfluousConfigKeys( m_customOptions, {} );
+
+ m_preferences.shouldReportAllAssertionStarts = false;
+ }
+
void AutomakeReporter::testCaseEnded(TestCaseStats const& _testCaseStats) {
// Possible values to emit are PASS, XFAIL, SKIP, FAIL, XPASS and ERROR.
m_stream << ":test-result: ";
@@ -9837,6 +9854,13 @@ private:
}
CompactReporter::~CompactReporter() = default;
+ CompactReporter::CompactReporter( ReporterConfig&& _config ):
+ StreamingReporterBase( CATCH_MOVE( _config ) ) {
+ rejectSuperfluousConfigKeys( m_customOptions, {} );
+
+ m_preferences.shouldReportAllAssertionStarts = false;
+ }
+
} // end namespace Catch
@@ -10224,6 +10248,7 @@ ConsoleReporter::ConsoleReporter(ReporterConfig&& config):
};
}
}())) {
+ rejectSuperfluousConfigKeys( m_customOptions, {} );
m_preferences.shouldReportAllAssertionStarts = false;
}
@@ -11037,6 +11062,18 @@ namespace Catch {
printSummaryRow( stream, streamColour, "assertions"_sr, columns, 1 );
}
+ void rejectSuperfluousConfigKeys(
+ std::map<std::string, std::string> const& options,
+ std::initializer_list<StringRef> knownKeys ) {
+ for ( auto const& option : options ) {
+ StringRef key( option.first );
+ CATCH_ENFORCE( std::find( knownKeys.begin(),
+ knownKeys.end(),
+ key ) != knownKeys.end(),
+ "Unknown reporter argument: " << key );
+ }
+ }
+
} // namespace Catch
@@ -11075,6 +11112,7 @@ namespace Catch {
JsonReporter::JsonReporter( ReporterConfig&& config ):
StreamingReporterBase{ CATCH_MOVE( config ) } {
+ rejectSuperfluousConfigKeys( m_customOptions, {} );
m_preferences.shouldRedirectStdOut = true;
// TBD: Do we want to report all assertions? XML reporter does
@@ -11480,11 +11518,13 @@ namespace Catch {
: CumulativeReporterBase( CATCH_MOVE(_config) ),
xml( m_stream )
{
+ rejectSuperfluousConfigKeys( m_customOptions, {} );
+
m_preferences.shouldRedirectStdOut = true;
m_preferences.shouldReportAllAssertions = false;
m_preferences.shouldReportAllAssertionStarts = false;
m_shouldStoreSuccesfulAssertions = false;
- }
+ }
std::string JunitReporter::getDescription() {
return "Reports test results in an XML format that looks like Ant's junitreport target";
@@ -11947,6 +11987,16 @@ namespace Catch {
}
}
+ SonarQubeReporter::SonarQubeReporter( ReporterConfig&& config ):
+ CumulativeReporterBase( CATCH_MOVE( config ) ), xml( m_stream ) {
+ rejectSuperfluousConfigKeys( m_customOptions, {} );
+
+ m_preferences.shouldRedirectStdOut = true;
+ m_preferences.shouldReportAllAssertions = false;
+ m_preferences.shouldReportAllAssertionStarts = false;
+ m_shouldStoreSuccesfulAssertions = false;
+ }
+
void SonarQubeReporter::testRunStarting(TestRunInfo const& testRunInfo) {
CumulativeReporterBase::testRunStarting(testRunInfo);
@@ -12275,6 +12325,14 @@ namespace Catch {
} // End anonymous namespace
+ TAPReporter::TAPReporter( ReporterConfig&& config ):
+ StreamingReporterBase( CATCH_MOVE( config ) ) {
+ rejectSuperfluousConfigKeys( m_customOptions, {} );
+
+ m_preferences.shouldReportAllAssertions = true;
+ m_preferences.shouldReportAllAssertionStarts = false;
+ }
+
void TAPReporter::testRunStarting( TestRunInfo const& ) {
if ( m_config->testSpec().hasFilters() ) {
m_stream << "# filters: " << m_config->testSpec() << '\n';
@@ -12346,6 +12404,14 @@ namespace Catch {
} // end anonymous namespace
+ TeamCityReporter::TeamCityReporter( ReporterConfig&& _config ):
+ StreamingReporterBase( CATCH_MOVE( _config ) ) {
+ rejectSuperfluousConfigKeys( m_customOptions, {} );
+
+ m_preferences.shouldRedirectStdOut = true;
+ m_preferences.shouldReportAllAssertionStarts = false;
+ }
+
TeamCityReporter::~TeamCityReporter() = default;
void TeamCityReporter::testRunStarting( TestRunInfo const& runInfo ) {
@@ -12492,6 +12558,8 @@ namespace Catch {
: StreamingReporterBase( CATCH_MOVE(_config) ),
m_xml(m_stream)
{
+ rejectSuperfluousConfigKeys( m_customOptions, {} );
+
m_preferences.shouldRedirectStdOut = true;
m_preferences.shouldReportAllAssertions = true;
m_preferences.shouldReportAllAssertionStarts = false;