Skip to content

Commit

Permalink
generate amalgamated files
Browse files Browse the repository at this point in the history
  • Loading branch information
rkaminsk committed Oct 3, 2022
1 parent 33f5810 commit 0b06a05
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 56 deletions.
49 changes: 42 additions & 7 deletions extras/catch_amalgamated.cpp
Expand Up @@ -6,7 +6,7 @@
// SPDX-License-Identifier: BSL-1.0

// Catch v3.1.0
// Generated: 2022-07-17 20:14:05.885021
// Generated: 2022-10-03 19:41:59.943256
// ----------------------------------------------------------
// This file is an amalgamation of multiple different files.
// You probably shouldn't edit it directly.
Expand All @@ -15,6 +15,28 @@
#include "catch_amalgamated.hpp"


#ifndef CATCH_WINDOWS_H_PROXY_HPP_INCLUDED
#define CATCH_WINDOWS_H_PROXY_HPP_INCLUDED


#if defined(CATCH_PLATFORM_WINDOWS)

// We might end up with the define made globally through the compiler,
// and we don't want to trigger warnings for this
#if !defined(NOMINMAX)
# define NOMINMAX
#endif
#if !defined(WIN32_LEAN_AND_MEAN)
# define WIN32_LEAN_AND_MEAN
#endif

#include <windows.h>

#endif // defined(CATCH_PLATFORM_WINDOWS)

#endif // CATCH_WINDOWS_H_PROXY_HPP_INCLUDED




namespace Catch {
Expand Down Expand Up @@ -488,8 +510,11 @@ namespace Catch {

namespace {
bool provideBazelReporterOutput() {
#ifdef CATCH_CONFIG_BAZEL_SUPPORT
#if defined(CATCH_CONFIG_BAZEL_SUPPORT)
return true;
#elif defined(CATCH_PLATFORM_WINDOWS_UWP)
// UWP does not support environment variables
return false;
#else

# if defined( _MSC_VER )
Expand Down Expand Up @@ -554,6 +579,7 @@ namespace Catch {
} );
}

#if !defined(CATCH_PLATFORM_WINDOWS_UWP)
if(provideBazelReporterOutput()){
// Register a JUnit reporter for Bazel. Bazel sets an environment
// variable with the path to XML output. If this file is written to
Expand All @@ -575,7 +601,7 @@ namespace Catch {
{ "junit", std::string( bazelOutputFilePtr ), {}, {} } );
}
}

#endif

// We now fixup the reporter specs to handle default output spec,
// default colour spec, etc
Expand Down Expand Up @@ -659,6 +685,16 @@ namespace Catch {





namespace Catch {
std::uint32_t getSeed() {
return getCurrentContext().getConfig()->rngSeed();
}
}



#include <cassert>
#include <stack>

Expand Down Expand Up @@ -882,15 +918,13 @@ namespace Catch {
multi->addListener(listener->create(config));
}

std::size_t reporterIdx = 0;
for ( auto const& reporterSpec : config->getProcessedReporterSpecs() ) {
multi->addReporter( createReporter(
reporterSpec.name,
ReporterConfig( config,
makeStream( reporterSpec.outputFilename ),
reporterSpec.colourMode,
reporterSpec.customOptions ) ) );
reporterIdx++;
}

return multi;
Expand Down Expand Up @@ -3957,6 +3991,7 @@ namespace Detail {
FileStream( std::string const& filename ) {
m_ofs.open( filename.c_str() );
CATCH_ENFORCE( !m_ofs.fail(), "Unable to open file: '" << filename << '\'' );
m_ofs << std::unitbuf;
}
~FileStream() override = default;
public: // IStream
Expand Down Expand Up @@ -7878,7 +7913,7 @@ class AssertionPrinter {
<< serializeFilters( m_config->getTestsOrTags() )
<< '\n';
}
m_stream << "RNG seed: " << m_config->rngSeed() << '\n';
m_stream << "RNG seed: " << getSeed() << '\n';
}

void CompactReporter::assertionEnded( AssertionStats const& _assertionStats ) {
Expand Down Expand Up @@ -8399,7 +8434,7 @@ void ConsoleReporter::testRunStarting(TestRunInfo const& _testInfo) {
m_stream << m_colour->guardColour( Colour::BrightYellow ) << "Filters: "
<< serializeFilters( m_config->getTestsOrTags() ) << '\n';
}
m_stream << "Randomness seeded to: " << m_config->rngSeed() << '\n';
m_stream << "Randomness seeded to: " << getSeed() << '\n';
}

void ConsoleReporter::lazyPrint() {
Expand Down

0 comments on commit 0b06a05

Please sign in to comment.