Skip to content

Commit 0b06a05

Browse files
committed
generate amalgamated files
1 parent 33f5810 commit 0b06a05

File tree

2 files changed

+119
-56
lines changed

2 files changed

+119
-56
lines changed

extras/catch_amalgamated.cpp

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// SPDX-License-Identifier: BSL-1.0
77

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

1717

18+
#ifndef CATCH_WINDOWS_H_PROXY_HPP_INCLUDED
19+
#define CATCH_WINDOWS_H_PROXY_HPP_INCLUDED
20+
21+
22+
#if defined(CATCH_PLATFORM_WINDOWS)
23+
24+
// We might end up with the define made globally through the compiler,
25+
// and we don't want to trigger warnings for this
26+
#if !defined(NOMINMAX)
27+
# define NOMINMAX
28+
#endif
29+
#if !defined(WIN32_LEAN_AND_MEAN)
30+
# define WIN32_LEAN_AND_MEAN
31+
#endif
32+
33+
#include <windows.h>
34+
35+
#endif // defined(CATCH_PLATFORM_WINDOWS)
36+
37+
#endif // CATCH_WINDOWS_H_PROXY_HPP_INCLUDED
38+
39+
1840

1941

2042
namespace Catch {
@@ -488,8 +510,11 @@ namespace Catch {
488510

489511
namespace {
490512
bool provideBazelReporterOutput() {
491-
#ifdef CATCH_CONFIG_BAZEL_SUPPORT
513+
#if defined(CATCH_CONFIG_BAZEL_SUPPORT)
492514
return true;
515+
#elif defined(CATCH_PLATFORM_WINDOWS_UWP)
516+
// UWP does not support environment variables
517+
return false;
493518
#else
494519

495520
# if defined( _MSC_VER )
@@ -554,6 +579,7 @@ namespace Catch {
554579
} );
555580
}
556581

582+
#if !defined(CATCH_PLATFORM_WINDOWS_UWP)
557583
if(provideBazelReporterOutput()){
558584
// Register a JUnit reporter for Bazel. Bazel sets an environment
559585
// variable with the path to XML output. If this file is written to
@@ -575,7 +601,7 @@ namespace Catch {
575601
{ "junit", std::string( bazelOutputFilePtr ), {}, {} } );
576602
}
577603
}
578-
604+
#endif
579605

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

660686

661687

688+
689+
690+
namespace Catch {
691+
std::uint32_t getSeed() {
692+
return getCurrentContext().getConfig()->rngSeed();
693+
}
694+
}
695+
696+
697+
662698
#include <cassert>
663699
#include <stack>
664700

@@ -882,15 +918,13 @@ namespace Catch {
882918
multi->addListener(listener->create(config));
883919
}
884920

885-
std::size_t reporterIdx = 0;
886921
for ( auto const& reporterSpec : config->getProcessedReporterSpecs() ) {
887922
multi->addReporter( createReporter(
888923
reporterSpec.name,
889924
ReporterConfig( config,
890925
makeStream( reporterSpec.outputFilename ),
891926
reporterSpec.colourMode,
892927
reporterSpec.customOptions ) ) );
893-
reporterIdx++;
894928
}
895929

896930
return multi;
@@ -3957,6 +3991,7 @@ namespace Detail {
39573991
FileStream( std::string const& filename ) {
39583992
m_ofs.open( filename.c_str() );
39593993
CATCH_ENFORCE( !m_ofs.fail(), "Unable to open file: '" << filename << '\'' );
3994+
m_ofs << std::unitbuf;
39603995
}
39613996
~FileStream() override = default;
39623997
public: // IStream
@@ -7878,7 +7913,7 @@ class AssertionPrinter {
78787913
<< serializeFilters( m_config->getTestsOrTags() )
78797914
<< '\n';
78807915
}
7881-
m_stream << "RNG seed: " << m_config->rngSeed() << '\n';
7916+
m_stream << "RNG seed: " << getSeed() << '\n';
78827917
}
78837918

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

84058440
void ConsoleReporter::lazyPrint() {

0 commit comments

Comments
 (0)