MCPcopy Create free account
hub / github.com/catchorg/Catch2 / FileRedirect

Method FileRedirect

extras/catch_amalgamated.cpp:5233–5238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5231
5232 public:
5233 FileRedirect():
5234 m_originalOut( dup( fileno( stdout ) ) ),
5235 m_originalErr( dup( fileno( stderr ) ) ) {
5236 CATCH_ENFORCE( m_originalOut >= 0, "Could not dup stdout" );
5237 CATCH_ENFORCE( m_originalErr >= 0, "Could not dup stderr" );
5238 }
5239
5240 std::string getStdout() override { return m_outFile.getContents(); }
5241 std::string getStderr() override { return m_errFile.getContents(); }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected