mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 11:43:29 +01:00
Slightly tweaked docs on supplying your own main
This commit is contained in:
parent
ad7445d33c
commit
54e6f9d471
@ -41,6 +41,7 @@ int main( int argc, char* const argv[] )
|
|||||||
Catch::Session session; // There must be exactly once instance
|
Catch::Session session; // There must be exactly once instance
|
||||||
|
|
||||||
// writing to session.configData() here sets defaults
|
// writing to session.configData() here sets defaults
|
||||||
|
// this is the preferred way to set them
|
||||||
|
|
||||||
int returnCode = session.applyCommandLine( argc, argv );
|
int returnCode = session.applyCommandLine( argc, argv );
|
||||||
if( returnCode != 0 ) // Indicates a command line error
|
if( returnCode != 0 ) // Indicates a command line error
|
||||||
@ -48,6 +49,7 @@ int main( int argc, char* const argv[] )
|
|||||||
|
|
||||||
// writing to session.configData() or session.Config() here
|
// writing to session.configData() or session.Config() here
|
||||||
// overrides command line args
|
// overrides command line args
|
||||||
|
// only do this if you know you need to
|
||||||
|
|
||||||
return session.run();
|
return session.run();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user