mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-11 16:05:40 +02:00
Compare commits
6 Commits
v1.2.1-dev
...
v1.2.1-dev
Author | SHA1 | Date | |
---|---|---|---|
![]() |
93a842e2f0 | ||
![]() |
85de743d70 | ||
![]() |
5d5ed5a283 | ||
![]() |
57df3ba998 | ||
![]() |
e6b365dc8c | ||
![]() |
02e1966db3 |
@@ -1,6 +1,6 @@
|
|||||||

|

|
||||||
|
|
||||||
*v1.2.1-develop.4*
|
*v1.2.1-develop.6*
|
||||||
|
|
||||||
Build status (on Travis CI) [](https://travis-ci.org/philsquared/Catch)
|
Build status (on Travis CI) [](https://travis-ci.org/philsquared/Catch)
|
||||||
|
|
||||||
|
@@ -28,10 +28,36 @@ The tag expression, ```"[widget]"``` selects A, B & D. ```"[gadget]"``` selects
|
|||||||
|
|
||||||
For more detail on command line selection see [the command line docs](command-line.md#specifying-which-tests-to-run)
|
For more detail on command line selection see [the command line docs](command-line.md#specifying-which-tests-to-run)
|
||||||
|
|
||||||
A special tag name, ```[hide]``` causes test cases to be skipped from the default list (ie when no test cases have been explicitly selected through tag expressions or name wildcards). ```[.]``` is an alias for ```[hide]```.
|
|
||||||
|
|
||||||
Tag names are not case sensitive.
|
Tag names are not case sensitive.
|
||||||
|
|
||||||
|
### Special Tags
|
||||||
|
|
||||||
|
All tag names beginning with non-alphanumeric characters are reserved by Catch. Catch defines a number of "special" tags, which have meaning to the test runner itself. These special tags all begin with a symbol character. Following is a list of currently defined special tags and their meanings.
|
||||||
|
|
||||||
|
* `[!hide]` or `[.]` (or, for legacy reasons, `[hide]`) - causes test cases to be skipped from the default list (ie when no test cases have been explicitly selected through tag expressions or name wildcards). The hide tag is often combined with another, user, tag (for example `[.][integration]` - so all integration tests are excluded from the default run but can be run by passing `[integration]` on the command line). As a short-cut you can combine these by simply prefixing your user tag with a `.` - e.g. `[.integration]`. Because the hide tag has evolved to have several forms, all forms are added as tags if you use one of them.
|
||||||
|
|
||||||
|
* `[!throws]` - lets Catch know that this test is likely to throw an exception even if successful. This causes the test to be exluded when running with `-e` or `--nothrow`.
|
||||||
|
|
||||||
|
* `[!shouldfail]` - reverse the failing logic of the test: if the test is successful if it fails, and vice-versa.
|
||||||
|
|
||||||
|
* `[!mayfail]` - doesn't fail the test if any given assertion fails (but still reports it). This can be useful to flag a work-in-progress, or a known issue that you don't want to immediately fix but still want to track in the your tests.
|
||||||
|
|
||||||
|
* `[#<filename>]` - running with `-#` or `--filenames-as-tags` causes Catch to add the filename, prefixed with `#` (and with any extension stripped) as a tag. e.g. tests in testfile.cpp would all be tagged `[#testfile]`.
|
||||||
|
|
||||||
|
* `[@<alias>]` - tag aliases all begin with `@` (see below).
|
||||||
|
|
||||||
|
## Tag aliases
|
||||||
|
|
||||||
|
Between tag expressions and wildcarded test names (as well as combinations of the two) quite complex patterns can be constructed to direct which test cases are run. If a complex pattern is used often it is convenient to be able to create an alias for the expression. this can be done, in code, using the following form:
|
||||||
|
|
||||||
|
CATCH_REGISTER_TAG_ALIAS( <alias string>, <tag expression> )
|
||||||
|
|
||||||
|
Aliases must begining with the `@` character. An example of a tag alias is:
|
||||||
|
|
||||||
|
CATCH_REGISTER_TAG_ALIAS( "[@nhf]", "[failing]~[.]" )
|
||||||
|
|
||||||
|
Now when `[@nhf]` is used on the command line this matches all tests that are tagged `[failing]`, but which are not also hidden.
|
||||||
|
|
||||||
## BDD-style test cases
|
## BDD-style test cases
|
||||||
|
|
||||||
In addition to Catch's take on the classic style of test cases, Catch supports an alternative syntax that allow tests to be written as "executable specifications" (one of the early goals of [Behaviour Driven Development](http://dannorth.net/introducing-bdd/)). This set of macros map on to ```TEST_CASE```s and ```SECTION```s, with a little internal support to make them smoother to work with.
|
In addition to Catch's take on the classic style of test cases, Catch supports an alternative syntax that allow tests to be written as "executable specifications" (one of the early goals of [Behaviour Driven Development](http://dannorth.net/introducing-bdd/)). This set of macros map on to ```TEST_CASE```s and ```SECTION```s, with a little internal support to make them smoother to work with.
|
||||||
|
@@ -70,8 +70,9 @@
|
|||||||
#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE" )
|
#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE" )
|
||||||
#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "CATCH_REQUIRE_FALSE" )
|
#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "CATCH_REQUIRE_FALSE" )
|
||||||
|
|
||||||
#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS" )
|
#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "", "CATCH_REQUIRE_THROWS" )
|
||||||
#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS_AS" )
|
#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS_AS" )
|
||||||
|
#define CATCH_REQUIRE_THROWS_WITH( expr, expectedMessage ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, expectedMessage, "CATCH_REQUIRE_THROWS_WITH" )
|
||||||
#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" )
|
#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" )
|
||||||
|
|
||||||
#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" )
|
#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" )
|
||||||
@@ -82,6 +83,7 @@
|
|||||||
|
|
||||||
#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" )
|
#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" )
|
||||||
#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS_AS" )
|
#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS_AS" )
|
||||||
|
#define CATCH_CHECK_THROWS_WITH( expr, expectedMessage ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, expectedMessage, "CATCH_CHECK_THROWS_WITH" )
|
||||||
#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" )
|
#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" )
|
||||||
|
|
||||||
#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THAT" )
|
#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THAT" )
|
||||||
@@ -135,8 +137,9 @@
|
|||||||
#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "REQUIRE" )
|
#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "REQUIRE" )
|
||||||
#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "REQUIRE_FALSE" )
|
#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "REQUIRE_FALSE" )
|
||||||
|
|
||||||
#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "REQUIRE_THROWS" )
|
#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "", "REQUIRE_THROWS" )
|
||||||
#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "REQUIRE_THROWS_AS" )
|
#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "REQUIRE_THROWS_AS" )
|
||||||
|
#define REQUIRE_THROWS_WITH( expr, expectedMessage ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, expectedMessage, "REQUIRE_THROWS_WITH" )
|
||||||
#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" )
|
#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" )
|
||||||
|
|
||||||
#define CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK" )
|
#define CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK" )
|
||||||
@@ -145,8 +148,9 @@
|
|||||||
#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" )
|
#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" )
|
||||||
#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" )
|
#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" )
|
||||||
|
|
||||||
#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS" )
|
#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "", "CHECK_THROWS" )
|
||||||
#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS_AS" )
|
#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS_AS" )
|
||||||
|
#define CHECK_THROWS_WITH( expr, expectedMessage ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, expectedMessage, "CHECK_THROWS_WITH" )
|
||||||
#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" )
|
#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" )
|
||||||
|
|
||||||
#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THAT" )
|
#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THAT" )
|
||||||
|
@@ -120,7 +120,7 @@ namespace Catch {
|
|||||||
if( lastDot != std::string::npos )
|
if( lastDot != std::string::npos )
|
||||||
filename = filename.substr( 0, lastDot );
|
filename = filename.substr( 0, lastDot );
|
||||||
|
|
||||||
tags.insert( "@" + filename );
|
tags.insert( "#" + filename );
|
||||||
setTags( test, tags );
|
setTags( test, tags );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -66,16 +66,16 @@
|
|||||||
} while( Catch::alwaysFalse() )
|
} while( Catch::alwaysFalse() )
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
#define INTERNAL_CATCH_THROWS( expr, resultDisposition, macroName ) \
|
#define INTERNAL_CATCH_THROWS( expr, resultDisposition, expectedMessage, macroName ) \
|
||||||
do { \
|
do { \
|
||||||
Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \
|
Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition, expectedMessage ); \
|
||||||
if( __catchResult.allowThrows() ) \
|
if( __catchResult.allowThrows() ) \
|
||||||
try { \
|
try { \
|
||||||
expr; \
|
expr; \
|
||||||
__catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \
|
__catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \
|
||||||
} \
|
} \
|
||||||
catch( ... ) { \
|
catch( ... ) { \
|
||||||
__catchResult.captureResult( Catch::ResultWas::Ok ); \
|
__catchResult.captureExpectedException( expectedMessage ); \
|
||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
__catchResult.captureResult( Catch::ResultWas::Ok ); \
|
__catchResult.captureResult( Catch::ResultWas::Ok ); \
|
||||||
|
@@ -153,6 +153,10 @@ namespace Catch {
|
|||||||
.describe( "load test names to run from a file" )
|
.describe( "load test names to run from a file" )
|
||||||
.bind( &loadTestNamesFromFile, "filename" );
|
.bind( &loadTestNamesFromFile, "filename" );
|
||||||
|
|
||||||
|
cli["-#"]["--filenames-as-tags"]
|
||||||
|
.describe( "adds a tag for the filename" )
|
||||||
|
.bind( &ConfigData::filenamesAsTags );
|
||||||
|
|
||||||
// Less common commands which don't have a short form
|
// Less common commands which don't have a short form
|
||||||
cli["--list-test-names-only"]
|
cli["--list-test-names-only"]
|
||||||
.describe( "list all/matching test cases names only" )
|
.describe( "list all/matching test cases names only" )
|
||||||
@@ -173,10 +177,6 @@ namespace Catch {
|
|||||||
cli["--force-colour"]
|
cli["--force-colour"]
|
||||||
.describe( "force colourised output" )
|
.describe( "force colourised output" )
|
||||||
.bind( &ConfigData::forceColour );
|
.bind( &ConfigData::forceColour );
|
||||||
|
|
||||||
cli["--filenames-as-tags"]
|
|
||||||
.describe( "adds a tag for the filename" )
|
|
||||||
.bind( &ConfigData::filenamesAsTags );
|
|
||||||
|
|
||||||
return cli;
|
return cli;
|
||||||
}
|
}
|
||||||
|
@@ -38,7 +38,8 @@ namespace Catch {
|
|||||||
ResultBuilder( char const* macroName,
|
ResultBuilder( char const* macroName,
|
||||||
SourceLineInfo const& lineInfo,
|
SourceLineInfo const& lineInfo,
|
||||||
char const* capturedExpression,
|
char const* capturedExpression,
|
||||||
ResultDisposition::Flags resultDisposition );
|
ResultDisposition::Flags resultDisposition,
|
||||||
|
char const* secondArg = "" );
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
ExpressionLhs<T const&> operator <= ( T const& operand );
|
ExpressionLhs<T const&> operator <= ( T const& operand );
|
||||||
@@ -67,6 +68,8 @@ namespace Catch {
|
|||||||
void useActiveException( ResultDisposition::Flags resultDisposition = ResultDisposition::Normal );
|
void useActiveException( ResultDisposition::Flags resultDisposition = ResultDisposition::Normal );
|
||||||
void captureResult( ResultWas::OfType resultType );
|
void captureResult( ResultWas::OfType resultType );
|
||||||
void captureExpression();
|
void captureExpression();
|
||||||
|
void captureExpectedException( std::string const& expectedMessage );
|
||||||
|
void handleResult( AssertionResult const& result );
|
||||||
void react();
|
void react();
|
||||||
bool shouldDebugBreak() const;
|
bool shouldDebugBreak() const;
|
||||||
bool allowThrows() const;
|
bool allowThrows() const;
|
||||||
|
@@ -18,11 +18,17 @@
|
|||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
|
std::string capturedExpressionWithSecondArgument( std::string const& capturedExpression, std::string const& secondArg ) {
|
||||||
|
return secondArg.empty()
|
||||||
|
? capturedExpression
|
||||||
|
: capturedExpression + ", \"" + secondArg + "\"";
|
||||||
|
}
|
||||||
ResultBuilder::ResultBuilder( char const* macroName,
|
ResultBuilder::ResultBuilder( char const* macroName,
|
||||||
SourceLineInfo const& lineInfo,
|
SourceLineInfo const& lineInfo,
|
||||||
char const* capturedExpression,
|
char const* capturedExpression,
|
||||||
ResultDisposition::Flags resultDisposition )
|
ResultDisposition::Flags resultDisposition,
|
||||||
: m_assertionInfo( macroName, lineInfo, capturedExpression, resultDisposition ),
|
char const* secondArg )
|
||||||
|
: m_assertionInfo( macroName, lineInfo, capturedExpressionWithSecondArgument( capturedExpression, secondArg ), resultDisposition ),
|
||||||
m_shouldDebugBreak( false ),
|
m_shouldDebugBreak( false ),
|
||||||
m_shouldThrow( false )
|
m_shouldThrow( false )
|
||||||
{}
|
{}
|
||||||
@@ -64,10 +70,31 @@ namespace Catch {
|
|||||||
captureExpression();
|
captureExpression();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ResultBuilder::captureExpectedException( std::string const& expectedMessage ) {
|
||||||
|
assert( m_exprComponents.testFalse == false );
|
||||||
|
AssertionResultData data = m_data;
|
||||||
|
data.resultType = ResultWas::Ok;
|
||||||
|
data.reconstructedExpression = m_assertionInfo.capturedExpression;
|
||||||
|
if( expectedMessage != "" ) {
|
||||||
|
|
||||||
|
std::string actualMessage = Catch::translateActiveException();
|
||||||
|
if( expectedMessage != actualMessage ) {
|
||||||
|
data.resultType = ResultWas::ExpressionFailed;
|
||||||
|
data.reconstructedExpression = actualMessage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
AssertionResult result( m_assertionInfo, data );
|
||||||
|
handleResult( result );
|
||||||
|
}
|
||||||
|
|
||||||
void ResultBuilder::captureExpression() {
|
void ResultBuilder::captureExpression() {
|
||||||
AssertionResult result = build();
|
AssertionResult result = build();
|
||||||
|
handleResult( result );
|
||||||
|
}
|
||||||
|
void ResultBuilder::handleResult( AssertionResult const& result )
|
||||||
|
{
|
||||||
getResultCapture().assertionEnded( result );
|
getResultCapture().assertionEnded( result );
|
||||||
|
|
||||||
if( !result.isOk() ) {
|
if( !result.isOk() ) {
|
||||||
if( getCurrentContext().getConfig()->shouldDebugBreak() )
|
if( getCurrentContext().getConfig()->shouldDebugBreak() )
|
||||||
m_shouldDebugBreak = true;
|
m_shouldDebugBreak = true;
|
||||||
|
@@ -105,6 +105,7 @@ namespace Catch {
|
|||||||
std::vector<TestCase> m_functionsInOrder;
|
std::vector<TestCase> m_functionsInOrder;
|
||||||
std::vector<TestCase> m_nonHiddenFunctions;
|
std::vector<TestCase> m_nonHiddenFunctions;
|
||||||
size_t m_unnamedCount;
|
size_t m_unnamedCount;
|
||||||
|
std::ios_base::Init m_ostreamInit; // Forces cout/ cerr to be initialised
|
||||||
};
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
@@ -37,7 +37,7 @@ namespace Catch {
|
|||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
Version libraryVersion( 1, 2, 1, "develop", 4 );
|
Version libraryVersion( 1, 2, 1, "develop", 6 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -397,6 +397,17 @@ ExceptionTests.cpp:<line number>: FAILED:
|
|||||||
due to unexpected exception with message:
|
due to unexpected exception with message:
|
||||||
3.14
|
3.14
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Exception messages can be tested for
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
ExceptionTests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
ExceptionTests.cpp:<line number>: FAILED:
|
||||||
|
REQUIRE_THROWS_WITH( thisThrows(), "should fail" )
|
||||||
|
with expansion:
|
||||||
|
expected exception
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
INFO and WARN do not abort tests
|
INFO and WARN do not abort tests
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@@ -786,6 +797,6 @@ with expansion:
|
|||||||
"first" == "second"
|
"first" == "second"
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
test cases: 155 | 116 passed | 38 failed | 1 failed as expected
|
test cases: 156 | 116 passed | 39 failed | 1 failed as expected
|
||||||
assertions: 765 | 673 passed | 79 failed | 13 failed as expected
|
assertions: 767 | 674 passed | 80 failed | 13 failed as expected
|
||||||
|
|
||||||
|
@@ -1277,6 +1277,21 @@ ExceptionTests.cpp:<line number>:
|
|||||||
PASSED:
|
PASSED:
|
||||||
REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) )
|
REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) )
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Exception messages can be tested for
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
ExceptionTests.cpp:<line number>
|
||||||
|
...............................................................................
|
||||||
|
|
||||||
|
ExceptionTests.cpp:<line number>:
|
||||||
|
PASSED:
|
||||||
|
REQUIRE_THROWS_WITH( thisThrows(), "expected exception" )
|
||||||
|
|
||||||
|
ExceptionTests.cpp:<line number>: FAILED:
|
||||||
|
REQUIRE_THROWS_WITH( thisThrows(), "should fail" )
|
||||||
|
with expansion:
|
||||||
|
expected exception
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Generators over two ranges
|
Generators over two ranges
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@@ -7944,6 +7959,6 @@ with expansion:
|
|||||||
true
|
true
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
test cases: 155 | 100 passed | 54 failed | 1 failed as expected
|
test cases: 156 | 100 passed | 55 failed | 1 failed as expected
|
||||||
assertions: 785 | 673 passed | 99 failed | 13 failed as expected
|
assertions: 787 | 674 passed | 100 failed | 13 failed as expected
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="all tests" errors="12" failures="87" tests="785" hostname="tbd" time="{duration}" timestamp="tbd">
|
<testsuite name="all tests" errors="12" failures="88" tests="787" hostname="tbd" time="{duration}" timestamp="tbd">
|
||||||
<testcase classname="global" name="toString(enum)" time="{duration}"/>
|
<testcase classname="global" name="toString(enum)" time="{duration}"/>
|
||||||
<testcase classname="global" name="toString(enum w/operator<<)" time="{duration}"/>
|
<testcase classname="global" name="toString(enum w/operator<<)" time="{duration}"/>
|
||||||
<testcase classname="global" name="toString(enum class)" time="{duration}"/>
|
<testcase classname="global" name="toString(enum class)" time="{duration}"/>
|
||||||
@@ -251,6 +251,11 @@ ExceptionTests.cpp:<line number>
|
|||||||
</error>
|
</error>
|
||||||
</testcase>
|
</testcase>
|
||||||
<testcase classname="global" name="NotImplemented exception" time="{duration}"/>
|
<testcase classname="global" name="NotImplemented exception" time="{duration}"/>
|
||||||
|
<testcase classname="global" name="Exception messages can be tested for" time="{duration}">
|
||||||
|
<failure message="expected exception" type="REQUIRE_THROWS_WITH">
|
||||||
|
ExceptionTests.cpp:<line number>
|
||||||
|
</failure>
|
||||||
|
</testcase>
|
||||||
<testcase classname="global" name="Generators over two ranges" time="{duration}"/>
|
<testcase classname="global" name="Generators over two ranges" time="{duration}"/>
|
||||||
<testcase classname="global" name="Generator over a range of pairs" time="{duration}"/>
|
<testcase classname="global" name="Generator over a range of pairs" time="{duration}"/>
|
||||||
<testcase classname="global" name="INFO and WARN do not abort tests" time="{duration}"/>
|
<testcase classname="global" name="INFO and WARN do not abort tests" time="{duration}"/>
|
||||||
|
@@ -1596,6 +1596,25 @@
|
|||||||
</Expression>
|
</Expression>
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="true"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
|
<TestCase name="Exception messages can be tested for">
|
||||||
|
<Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" >
|
||||||
|
<Original>
|
||||||
|
thisThrows(), "expected exception"
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
thisThrows(), "expected exception"
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<Expression success="false" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" >
|
||||||
|
<Original>
|
||||||
|
thisThrows(), "should fail"
|
||||||
|
</Original>
|
||||||
|
<Expanded>
|
||||||
|
expected exception
|
||||||
|
</Expanded>
|
||||||
|
</Expression>
|
||||||
|
<OverallResult success="false"/>
|
||||||
|
</TestCase>
|
||||||
<TestCase name="Generators over two ranges">
|
<TestCase name="Generators over two ranges">
|
||||||
<Expression success="true" type="CATCH_REQUIRE" filename="projects/SelfTest/GeneratorTests.cpp" >
|
<Expression success="true" type="CATCH_REQUIRE" filename="projects/SelfTest/GeneratorTests.cpp" >
|
||||||
<Original>
|
<Original>
|
||||||
@@ -8220,7 +8239,7 @@ there"
|
|||||||
</Section>
|
</Section>
|
||||||
<OverallResult success="true"/>
|
<OverallResult success="true"/>
|
||||||
</TestCase>
|
</TestCase>
|
||||||
<OverallResults successes="673" failures="99" expectedFailures="13"/>
|
<OverallResults successes="674" failures="100" expectedFailures="13"/>
|
||||||
</Group>
|
</Group>
|
||||||
<OverallResults successes="673" failures="99" expectedFailures="13"/>
|
<OverallResults successes="674" failures="100" expectedFailures="13"/>
|
||||||
</Catch>
|
</Catch>
|
||||||
|
@@ -152,3 +152,8 @@ TEST_CASE( "NotImplemented exception", "" )
|
|||||||
{
|
{
|
||||||
REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) );
|
REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE( "Exception messages can be tested for", "[.][failing]" ) {
|
||||||
|
REQUIRE_THROWS_WITH( thisThrows(), "expected exception" );
|
||||||
|
REQUIRE_THROWS_WITH( thisThrows(), "should fail" );
|
||||||
|
}
|
||||||
|
@@ -15,7 +15,8 @@ pathParser = re.compile( r'(.*?)/(.*\..pp)(.*)' )
|
|||||||
lineNumberParser = re.compile( r'(.*)line="[0-9]*"(.*)' )
|
lineNumberParser = re.compile( r'(.*)line="[0-9]*"(.*)' )
|
||||||
hexParser = re.compile( r'(.*)\b(0[xX][0-9a-fA-F]+)\b(.*)' )
|
hexParser = re.compile( r'(.*)\b(0[xX][0-9a-fA-F]+)\b(.*)' )
|
||||||
durationsParser = re.compile( r'(.*)time="[0-9]*\.[0-9]*"(.*)' )
|
durationsParser = re.compile( r'(.*)time="[0-9]*\.[0-9]*"(.*)' )
|
||||||
versionParser = re.compile( r'(.*?)Catch v[0-9]*\.[0-9]*\.[0-9].?( .*)' )
|
versionParser = re.compile( r'(.*?)Catch v[0-9]*\.[0-9]*\.[0-9]*(.*)' )
|
||||||
|
devVersionParser = re.compile( r'(.*?)Catch v[0-9]*\.[0-9]*\.[0-9]*-develop\.[0-9]*(.*)' )
|
||||||
|
|
||||||
if len(sys.argv) == 2:
|
if len(sys.argv) == 2:
|
||||||
cmdPath = sys.argv[1]
|
cmdPath = sys.argv[1]
|
||||||
@@ -41,9 +42,13 @@ def filterLine( line ):
|
|||||||
if path.startswith( catchPath ):
|
if path.startswith( catchPath ):
|
||||||
path = path[1+len(catchPath):]
|
path = path[1+len(catchPath):]
|
||||||
line = m.group(1) + path + m.group(3)
|
line = m.group(1) + path + m.group(3)
|
||||||
m = versionParser.match( line )
|
m = devVersionParser.match( line )
|
||||||
if m:
|
if m:
|
||||||
line = m.group(1) + "<version>" + m.group(2)
|
line = m.group(1) + "<version>" + m.group(2)
|
||||||
|
else:
|
||||||
|
m = versionParser.match( line )
|
||||||
|
if m:
|
||||||
|
line = m.group(1) + "<version>" + m.group(2)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
m = hexParser.match( line )
|
m = hexParser.match( line )
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Catch v1.2.1-develop.4
|
* Catch v1.2.1-develop.6
|
||||||
* Generated: 2015-07-06 06:21:18.816844
|
* Generated: 2015-07-13 06:35:13.441019
|
||||||
* ----------------------------------------------------------
|
* ----------------------------------------------------------
|
||||||
* This file has been merged from multiple headers. Please don't edit it directly
|
* This file has been merged from multiple headers. Please don't edit it directly
|
||||||
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
|
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
|
||||||
@@ -796,7 +796,8 @@ namespace Catch {
|
|||||||
ResultBuilder( char const* macroName,
|
ResultBuilder( char const* macroName,
|
||||||
SourceLineInfo const& lineInfo,
|
SourceLineInfo const& lineInfo,
|
||||||
char const* capturedExpression,
|
char const* capturedExpression,
|
||||||
ResultDisposition::Flags resultDisposition );
|
ResultDisposition::Flags resultDisposition,
|
||||||
|
char const* secondArg = "" );
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
ExpressionLhs<T const&> operator <= ( T const& operand );
|
ExpressionLhs<T const&> operator <= ( T const& operand );
|
||||||
@@ -825,6 +826,8 @@ namespace Catch {
|
|||||||
void useActiveException( ResultDisposition::Flags resultDisposition = ResultDisposition::Normal );
|
void useActiveException( ResultDisposition::Flags resultDisposition = ResultDisposition::Normal );
|
||||||
void captureResult( ResultWas::OfType resultType );
|
void captureResult( ResultWas::OfType resultType );
|
||||||
void captureExpression();
|
void captureExpression();
|
||||||
|
void captureExpectedException( std::string const& expectedMessage );
|
||||||
|
void handleResult( AssertionResult const& result );
|
||||||
void react();
|
void react();
|
||||||
bool shouldDebugBreak() const;
|
bool shouldDebugBreak() const;
|
||||||
bool allowThrows() const;
|
bool allowThrows() const;
|
||||||
@@ -1616,16 +1619,16 @@ namespace Catch {
|
|||||||
} while( Catch::alwaysFalse() )
|
} while( Catch::alwaysFalse() )
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
#define INTERNAL_CATCH_THROWS( expr, resultDisposition, macroName ) \
|
#define INTERNAL_CATCH_THROWS( expr, resultDisposition, expectedMessage, macroName ) \
|
||||||
do { \
|
do { \
|
||||||
Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \
|
Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition, expectedMessage ); \
|
||||||
if( __catchResult.allowThrows() ) \
|
if( __catchResult.allowThrows() ) \
|
||||||
try { \
|
try { \
|
||||||
expr; \
|
expr; \
|
||||||
__catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \
|
__catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \
|
||||||
} \
|
} \
|
||||||
catch( ... ) { \
|
catch( ... ) { \
|
||||||
__catchResult.captureResult( Catch::ResultWas::Ok ); \
|
__catchResult.captureExpectedException( expectedMessage ); \
|
||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
__catchResult.captureResult( Catch::ResultWas::Ok ); \
|
__catchResult.captureResult( Catch::ResultWas::Ok ); \
|
||||||
@@ -4279,6 +4282,10 @@ namespace Catch {
|
|||||||
.describe( "load test names to run from a file" )
|
.describe( "load test names to run from a file" )
|
||||||
.bind( &loadTestNamesFromFile, "filename" );
|
.bind( &loadTestNamesFromFile, "filename" );
|
||||||
|
|
||||||
|
cli["-#"]["--filenames-as-tags"]
|
||||||
|
.describe( "adds a tag for the filename" )
|
||||||
|
.bind( &ConfigData::filenamesAsTags );
|
||||||
|
|
||||||
// Less common commands which don't have a short form
|
// Less common commands which don't have a short form
|
||||||
cli["--list-test-names-only"]
|
cli["--list-test-names-only"]
|
||||||
.describe( "list all/matching test cases names only" )
|
.describe( "list all/matching test cases names only" )
|
||||||
@@ -4300,10 +4307,6 @@ namespace Catch {
|
|||||||
.describe( "force colourised output" )
|
.describe( "force colourised output" )
|
||||||
.bind( &ConfigData::forceColour );
|
.bind( &ConfigData::forceColour );
|
||||||
|
|
||||||
cli["--filenames-as-tags"]
|
|
||||||
.describe( "adds a tag for the filename" )
|
|
||||||
.bind( &ConfigData::filenamesAsTags );
|
|
||||||
|
|
||||||
return cli;
|
return cli;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5626,7 +5629,7 @@ namespace Catch {
|
|||||||
if( lastDot != std::string::npos )
|
if( lastDot != std::string::npos )
|
||||||
filename = filename.substr( 0, lastDot );
|
filename = filename.substr( 0, lastDot );
|
||||||
|
|
||||||
tags.insert( "@" + filename );
|
tags.insert( "#" + filename );
|
||||||
setTags( test, tags );
|
setTags( test, tags );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5844,6 +5847,7 @@ namespace Catch {
|
|||||||
std::vector<TestCase> m_functionsInOrder;
|
std::vector<TestCase> m_functionsInOrder;
|
||||||
std::vector<TestCase> m_nonHiddenFunctions;
|
std::vector<TestCase> m_nonHiddenFunctions;
|
||||||
size_t m_unnamedCount;
|
size_t m_unnamedCount;
|
||||||
|
std::ios_base::Init m_ostreamInit; // Forces cout/ cerr to be initialised
|
||||||
};
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@@ -6823,7 +6827,7 @@ namespace Catch {
|
|||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
Version libraryVersion( 1, 2, 1, "develop", 4 );
|
Version libraryVersion( 1, 2, 1, "develop", 6 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7440,11 +7444,17 @@ std::string toString( std::nullptr_t ) {
|
|||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
|
std::string capturedExpressionWithSecondArgument( std::string const& capturedExpression, std::string const& secondArg ) {
|
||||||
|
return secondArg.empty()
|
||||||
|
? capturedExpression
|
||||||
|
: capturedExpression + ", \"" + secondArg + "\"";
|
||||||
|
}
|
||||||
ResultBuilder::ResultBuilder( char const* macroName,
|
ResultBuilder::ResultBuilder( char const* macroName,
|
||||||
SourceLineInfo const& lineInfo,
|
SourceLineInfo const& lineInfo,
|
||||||
char const* capturedExpression,
|
char const* capturedExpression,
|
||||||
ResultDisposition::Flags resultDisposition )
|
ResultDisposition::Flags resultDisposition,
|
||||||
: m_assertionInfo( macroName, lineInfo, capturedExpression, resultDisposition ),
|
char const* secondArg )
|
||||||
|
: m_assertionInfo( macroName, lineInfo, capturedExpressionWithSecondArgument( capturedExpression, secondArg ), resultDisposition ),
|
||||||
m_shouldDebugBreak( false ),
|
m_shouldDebugBreak( false ),
|
||||||
m_shouldThrow( false )
|
m_shouldThrow( false )
|
||||||
{}
|
{}
|
||||||
@@ -7486,8 +7496,29 @@ namespace Catch {
|
|||||||
captureExpression();
|
captureExpression();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ResultBuilder::captureExpectedException( std::string const& expectedMessage ) {
|
||||||
|
assert( m_exprComponents.testFalse == false );
|
||||||
|
AssertionResultData data = m_data;
|
||||||
|
data.resultType = ResultWas::Ok;
|
||||||
|
data.reconstructedExpression = m_assertionInfo.capturedExpression;
|
||||||
|
if( expectedMessage != "" ) {
|
||||||
|
|
||||||
|
std::string actualMessage = Catch::translateActiveException();
|
||||||
|
if( expectedMessage != actualMessage ) {
|
||||||
|
data.resultType = ResultWas::ExpressionFailed;
|
||||||
|
data.reconstructedExpression = actualMessage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
AssertionResult result( m_assertionInfo, data );
|
||||||
|
handleResult( result );
|
||||||
|
}
|
||||||
|
|
||||||
void ResultBuilder::captureExpression() {
|
void ResultBuilder::captureExpression() {
|
||||||
AssertionResult result = build();
|
AssertionResult result = build();
|
||||||
|
handleResult( result );
|
||||||
|
}
|
||||||
|
void ResultBuilder::handleResult( AssertionResult const& result )
|
||||||
|
{
|
||||||
getResultCapture().assertionEnded( result );
|
getResultCapture().assertionEnded( result );
|
||||||
|
|
||||||
if( !result.isOk() ) {
|
if( !result.isOk() ) {
|
||||||
@@ -9332,8 +9363,9 @@ int main (int argc, char * const argv[]) {
|
|||||||
#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE" )
|
#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE" )
|
||||||
#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "CATCH_REQUIRE_FALSE" )
|
#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "CATCH_REQUIRE_FALSE" )
|
||||||
|
|
||||||
#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS" )
|
#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "", "CATCH_REQUIRE_THROWS" )
|
||||||
#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS_AS" )
|
#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS_AS" )
|
||||||
|
#define CATCH_REQUIRE_THROWS_WITH( expr, expectedMessage ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, expectedMessage, "CATCH_REQUIRE_THROWS_WITH" )
|
||||||
#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" )
|
#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" )
|
||||||
|
|
||||||
#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" )
|
#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" )
|
||||||
@@ -9344,6 +9376,7 @@ int main (int argc, char * const argv[]) {
|
|||||||
|
|
||||||
#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" )
|
#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" )
|
||||||
#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS_AS" )
|
#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS_AS" )
|
||||||
|
#define CATCH_CHECK_THROWS_WITH( expr, expectedMessage ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, expectedMessage, "CATCH_CHECK_THROWS_WITH" )
|
||||||
#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" )
|
#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" )
|
||||||
|
|
||||||
#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THAT" )
|
#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THAT" )
|
||||||
@@ -9397,8 +9430,9 @@ int main (int argc, char * const argv[]) {
|
|||||||
#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "REQUIRE" )
|
#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "REQUIRE" )
|
||||||
#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "REQUIRE_FALSE" )
|
#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "REQUIRE_FALSE" )
|
||||||
|
|
||||||
#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "REQUIRE_THROWS" )
|
#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "", "REQUIRE_THROWS" )
|
||||||
#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "REQUIRE_THROWS_AS" )
|
#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "REQUIRE_THROWS_AS" )
|
||||||
|
#define REQUIRE_THROWS_WITH( expr, expectedMessage ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, expectedMessage, "REQUIRE_THROWS_WITH" )
|
||||||
#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" )
|
#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" )
|
||||||
|
|
||||||
#define CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK" )
|
#define CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK" )
|
||||||
@@ -9407,8 +9441,9 @@ int main (int argc, char * const argv[]) {
|
|||||||
#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" )
|
#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" )
|
||||||
#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" )
|
#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" )
|
||||||
|
|
||||||
#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS" )
|
#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "", "CHECK_THROWS" )
|
||||||
#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS_AS" )
|
#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS_AS" )
|
||||||
|
#define CHECK_THROWS_WITH( expr, expectedMessage ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, expectedMessage, "CHECK_THROWS_WITH" )
|
||||||
#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" )
|
#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" )
|
||||||
|
|
||||||
#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THAT" )
|
#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THAT" )
|
||||||
|
Reference in New Issue
Block a user