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

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2012-08-20 19:11:14 +0100
committerPhil Nash2012-08-20 19:11:14 +0100
commita760772f779dadd1bcd497b9cf0328382a05876f (patch)
tree2cccebc2accc5a9a8d7f8a30e1391ac2afa8b84a /include
parentd5fbe2ec5dcc2382afcd44a09cd4cb93c7464dd0 (diff)
downloadcatch3-a760772f779dadd1bcd497b9cf0328382a05876f.tar.gz
Moved ofstream back out to Main - to address #112
Diffstat (limited to 'include')
-rw-r--r--include/catch_runner.hpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp
index eed0fca7..6a4dca07 100644
--- a/include/catch_runner.hpp
+++ b/include/catch_runner.hpp
@@ -8,10 +8,6 @@
#ifndef TWOBLUECUBES_CATCH_RUNNER_HPP_INCLUDED
#define TWOBLUECUBES_CATCH_RUNNER_HPP_INCLUDED
-#include "reporters/catch_reporter_basic.hpp"
-#include "reporters/catch_reporter_xml.hpp"
-#include "reporters/catch_reporter_junit.hpp"
-
#include "internal/catch_commandline.hpp"
#include "internal/catch_list.hpp"
#include "internal/catch_runner_impl.hpp"
@@ -22,11 +18,7 @@
namespace Catch {
- INTERNAL_CATCH_REGISTER_REPORTER( "basic", BasicReporter )
- INTERNAL_CATCH_REGISTER_REPORTER( "xml", XmlReporter )
- INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter )
-
- inline int resolveStream( Config& configWrapper ) {
+ inline int resolveStream( std::ofstream& ofs, Config& configWrapper ) {
const ConfigData& config = configWrapper.data();
if( !config.stream.empty() ) {
@@ -36,7 +28,6 @@ namespace Catch {
configWrapper.setFilename( config.stream );
}
// Open output file, if specified
- std::ofstream ofs;
if( !config.outputFilename.empty() ) {
ofs.open( config.outputFilename.c_str() );
if( ofs.fail() ) {
@@ -65,7 +56,8 @@ namespace Catch {
inline int Main( Config& configWrapper ) {
- int result = resolveStream( configWrapper );
+ std::ofstream ofs;
+ int result = resolveStream( ofs, configWrapper );
if( result != 0 )
return result;