Added ability to break into debugger on Windows and Mac

This commit is contained in:
Phil Nash 2010-12-27 20:49:19 +00:00
parent 0025668584
commit 53da26eef1
6 changed files with 152 additions and 27 deletions

View file

@ -25,6 +25,7 @@ namespace Catch
// -r --report <type>
// -o --output filename to write to
// -s --success report successful cases too
// -b --break breaks into debugger on test failure
class ArgParser : NonCopyable
{
enum Mode
@ -35,6 +36,7 @@ namespace Catch
modeReport,
modeOutput,
modeSuccess,
modeBreak,
modeError
};
@ -59,6 +61,8 @@ namespace Catch
changeMode( cmd, modeOutput );
else if( cmd == "-s" || cmd == "--success" )
changeMode( cmd, modeSuccess );
else if( cmd == "-b" || cmd == "--break" )
changeMode( cmd, modeBreak );
}
else
{
@ -148,6 +152,11 @@ namespace Catch
return setErrorMode( m_command + " does not accept arguments" );
m_config.setIncludeAll( true );
break;
case modeBreak:
if( m_args.size() != 0 )
return setErrorMode( m_command + " does not accept arguments" );
m_config.setShouldDebugBreak( true );
break;
}
m_args.clear();
m_mode = mode;