Beispiel #1
0
 void operator()( const TestCase& testCase ) {
     std::string name;
     Totals totals;
     {
         EmbeddedRunner runner;
         name = testCase.getTestCaseInfo().name;
         totals = runner.runMatching( name, m_groupIndex, m_groupsCount );
     }
     switch( m_expectedResult ) {
         case Expected::ToSucceed:
             if( totals.assertions.failed > 0 ) {
                 FAIL( "Expected test case '"
                      << name
                      << "' to succeed but there was/ were " 
                      << totals.assertions.failed << " failure(s)" );
             }
             else {
                 SUCCEED( "Tests passed, as expected" );
             }
             break;
         case Expected::ToFail:
             if( totals.assertions.failed == 0 ) {
                 FAIL( "Expected test case '"
                      << name
                      << "' to fail but there was/ were " 
                      << totals.assertions.passed << " success(es)" );
             }
             else {
                 SUCCEED( "Tests failed, as expected" );
             }
             break;
     }        
 }
Beispiel #2
0
 void operator()( const TestCaseInfo& testCase ) {
     EmbeddedRunner runner;
     runner.runMatching( testCase.getName() );
     Totals totals = runner.getTotals();
     switch( m_expectedResult ) {
         case Expected::ToSucceed:
             if( totals.assertions.failed > 0 ) {
                 INFO( runner.getOutput() );
                 FAIL( "Expected test case '" 
                      << testCase.getName() 
                      << "' to succeed but there was/ were " 
                      << totals.assertions.failed << " failure(s)" );
             }
             break;
         case Expected::ToFail:
             if( totals.assertions.passed > 0 ) {
                 INFO( runner.getOutput() );
                 FAIL( "Expected test case '" 
                      << testCase.getName() 
                      << "' to fail but there was/ were " 
                      << totals.assertions.passed << " success(es)" );
             }
             break;
     }        
 };