2
0
mirror of https://github.com/catchorg/Catch2 synced 2026-02-14 13:22:11 +00:00

Implemented more reporter methods and started to fill out Section impl

This commit is contained in:
Phil Nash
2010-11-29 19:40:44 +00:00
parent 3d6fa68970
commit e6b2b0e656
12 changed files with 223 additions and 35 deletions

View File

@@ -14,6 +14,7 @@
#include "../catch_runner.hpp"
// This code runs the meta tests and verifies that the failing ones failed and the successful ones succeeded
/*
int main (int argc, char * const argv[])
{
using namespace Catch;
@@ -22,17 +23,18 @@ int main (int argc, char * const argv[])
if( argc > 1 && ( std::string( argv[1] ) == "-s" || std::string( argv[1] ) == "--success" ) )
showAllResults = true;
std::ostringstream ossSucceeding;
std::ostringstream ossFailing;
ReporterConfig reporterConfig( ReporterConfig::Include::SuccessfulResults );
BasicReporter reporter (reporterConfig );
Runner runner;
runner.setReporter( &reporter );
std::ostringstream ossSucceeding;
Runner runner( &reporter );
reporterConfig.setStreamBuf( ossSucceeding.rdbuf() );
runner.runMatching( "succeeding/*" );
std::string succeedingResults = ossSucceeding.str();
std::ostringstream ossFailing;
reporterConfig.setStreamBuf( ossFailing.rdbuf() );
runner.runMatching( "failing/*" );
std::string failingResults = ossFailing.str();
@@ -56,10 +58,12 @@ int main (int argc, char * const argv[])
{
std::cout << failingResults << "\n\n";
}
if( result == 0 )
{
std::cout << "All " << runner.getSuccessCount() + runner.getFailureCount() << " tests completed successfully" << std::endl;
}
return result;
}
*/
#include "catch_default_main.hpp"