Fixed Junit issue with REQUIRE_THROWS

- As mentioned by @SebDyn in GitHub issue #5
This commit is contained in:
Phil Nash 2013-04-08 12:05:32 +01:00
parent 8764177c0e
commit 3bd4241795
3 changed files with 9 additions and 13 deletions

View File

@ -155,18 +155,10 @@ namespace Catch {
if( _stats.infoMessages.size() > 1 ) if( _stats.infoMessages.size() > 1 )
messageLabel = "explicitly with messages"; messageLabel = "explicitly with messages";
break; break;
case ResultWas::Exception:
passOrFail = "FAILED";
colour = Colour::Error;
if( _stats.infoMessages.size() == 1 )
messageLabel = "with message";
if( _stats.infoMessages.size() > 1 )
messageLabel = "with messages";
break;
// These cases are here to prevent compiler warnings // These cases are here to prevent compiler warnings
case ResultWas::Unknown: case ResultWas::Unknown:
case ResultWas::FailureBit: case ResultWas::FailureBit:
case ResultWas::Exception:
passOrFail = "** internal error **"; passOrFail = "** internal error **";
colour = Colour::Error; colour = Colour::Error;
break; break;

View File

@ -143,10 +143,14 @@ namespace Catch {
case ResultWas::Ok: case ResultWas::Ok:
stats.m_element = "success"; stats.m_element = "success";
break; break;
case ResultWas::DidntThrowException:
stats.m_element = "failure";
m_currentStats->m_failuresCount++;
break;
case ResultWas::Unknown: case ResultWas::Unknown:
case ResultWas::FailureBit: case ResultWas::FailureBit:
case ResultWas::Exception: case ResultWas::Exception:
case ResultWas::DidntThrowException: stats.m_element = "* internal error *";
break; break;
} }
testCaseStats.m_testStats.push_back( stats ); testCaseStats.m_testStats.push_back( stats );

View File

@ -5769,7 +5769,7 @@ with expansion:
13 test cases - 3 failed (40 assertions - 4 failed) 13 test cases - 3 failed (40 assertions - 4 failed)
<testsuites> <testsuites>
<testsuite name="~dummy" errors="9" failures="77" tests="699" hostname="tbd" time="tbd" timestamp="tbd"> <testsuite name="~dummy" errors="9" failures="78" tests="699" hostname="tbd" time="tbd" timestamp="tbd">
<testcase classname="global" name="./succeeding/Approx/simple" time="tbd"/> <testcase classname="global" name="./succeeding/Approx/simple" time="tbd"/>
<testcase classname="global" name="./succeeding/Approx/epsilon" time="tbd"/> <testcase classname="global" name="./succeeding/Approx/epsilon" time="tbd"/>
<testcase classname="global" name="./succeeding/Approx/float" time="tbd"/> <testcase classname="global" name="./succeeding/Approx/float" time="tbd"/>
@ -5947,9 +5947,9 @@ ConditionTests.cpp:346
<error message="thisThrows()" type="CHECK_THROWS_AS"> <error message="thisThrows()" type="CHECK_THROWS_AS">
ExceptionTests.cpp:43 ExceptionTests.cpp:43
</error> </error>
< message="thisDoesntThrow()" type="CHECK_THROWS_AS"> <failure message="thisDoesntThrow()" type="CHECK_THROWS_AS">
ExceptionTests.cpp:44 ExceptionTests.cpp:44
</> </failure>
<error message="thisThrows()" type="CHECK_NOTHROW"> <error message="thisThrows()" type="CHECK_NOTHROW">
ExceptionTests.cpp:45 ExceptionTests.cpp:45
</error> </error>