mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-27 15:09:33 +00:00
Context methods are non-static - accessed via interface
This is a move towards allowing multiple contexts - with the concept of a (possibly thread local) "current" context
This commit is contained in:
parent
89d2a3f911
commit
371db8b42f
17 changed files with 304 additions and 260 deletions
|
@ -62,7 +62,9 @@ namespace Catch {
|
|||
config.getReporter()->EndGroup( *it, runner.getTotals() - prevTotals );
|
||||
}
|
||||
}
|
||||
return static_cast<int>( runner.getTotals().assertions.failed );
|
||||
int result = static_cast<int>( runner.getTotals().assertions.failed );
|
||||
Catch::Context::cleanUp();
|
||||
return result;
|
||||
}
|
||||
|
||||
inline void showHelp( std::string exeName ) {
|
||||
|
@ -87,25 +89,25 @@ namespace Catch {
|
|||
|
||||
if( !config.getMessage().empty() ) {
|
||||
std::cerr << config.getMessage() << std::endl;
|
||||
Catch::Context::cleanUp();
|
||||
return (std::numeric_limits<int>::max)();
|
||||
}
|
||||
|
||||
// Handle help
|
||||
if( config.showHelp() ) {
|
||||
showHelp( argv[0] );
|
||||
Catch::Context::cleanUp();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Main( config );
|
||||
}
|
||||
|
||||
inline int Main( int argc, char* const argv[] ) {
|
||||
Config config;
|
||||
// !TBD: This doesn't always work, for some reason
|
||||
// if( isDebuggerActive() )
|
||||
// config.useStream( "debug" );
|
||||
int result = Main( argc, argv, config );
|
||||
Catch::Context::cleanUp();
|
||||
return result;
|
||||
return Main( argc, argv, config );
|
||||
}
|
||||
|
||||
} // end namespace Catch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue