Fix output redirection in failing tests (#1525)

Fixes #1514
This commit is contained in:
SimonChh 2019-03-02 15:18:48 -05:00 committed by Martin Hořeňovský
parent 5bf6e47381
commit 7d2451f119
3 changed files with 25 additions and 5 deletions

View file

@ -67,7 +67,6 @@ namespace Catch {
GeneratorTracker::~GeneratorTracker() {}
}
RunContext::RunContext(IConfigPtr const& _config, IStreamingReporterPtr&& reporter)
: m_runInfo(_config->name()),
m_context(getCurrentMutableContext()),
@ -323,13 +322,10 @@ namespace Catch {
CATCH_TRY {
if (m_reporter->getPreferences().shouldRedirectStdOut) {
#if !defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT)
RedirectedStdOut redirectedStdOut;
RedirectedStdErr redirectedStdErr;
RedirectedStreams redirectedStreams(redirectedCout, redirectedCerr);
timer.start();
invokeActiveTestCase();
redirectedCout += redirectedStdOut.str();
redirectedCerr += redirectedStdErr.str();
#else
OutputRedirect r(redirectedCout, redirectedCerr);
timer.start();