mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-17 11:12:25 +01:00
Make merge easier
This commit is contained in:
parent
2a14dffe97
commit
37b057187d
@ -8,13 +8,11 @@
|
|||||||
|
|
||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
|
|
||||||
namespace ClassTests
|
class TestClass
|
||||||
{
|
{
|
||||||
class TestClass
|
|
||||||
{
|
|
||||||
std::string s;
|
std::string s;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TestClass()
|
TestClass()
|
||||||
: s( "hello" )
|
: s( "hello" )
|
||||||
{}
|
{}
|
||||||
@ -27,13 +25,11 @@ namespace ClassTests
|
|||||||
{
|
{
|
||||||
REQUIRE( s == "world" );
|
REQUIRE( s == "world" );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Note: TestClass conflicts with template class with same name in VS2012 native tests
|
// Note: TestClass conflicts with template class with same name in VS2012 native tests
|
||||||
METHOD_AS_TEST_CASE( ClassTests::TestClass::succeedingCase, "./succeeding/TestClass/succeedingCase", "A method based test run that succeeds [class]" )
|
METHOD_AS_TEST_CASE( TestClass::succeedingCase, "./succeeding/TestClass/succeedingCase", "A method based test run that succeeds [class]" )
|
||||||
METHOD_AS_TEST_CASE( ClassTests::TestClass::failingCase, "./failing/TestClass/failingCase", "A method based test run that fails [class]" )
|
METHOD_AS_TEST_CASE( TestClass::failingCase, "./failing/TestClass/failingCase", "A method based test run that fails [class]" )
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
struct Fixture
|
struct Fixture
|
||||||
{
|
{
|
||||||
|
@ -42,12 +42,10 @@ struct TestDef {
|
|||||||
// The "failing" tests all use the CHECK macro, which continues if the specific test fails.
|
// The "failing" tests all use the CHECK macro, which continues if the specific test fails.
|
||||||
// This allows us to see all results, even if an earlier check fails
|
// This allows us to see all results, even if an earlier check fails
|
||||||
|
|
||||||
namespace ConditionTests {
|
// Equality tests
|
||||||
|
TEST_CASE( "./succeeding/conditions/equality",
|
||||||
// Equality tests
|
|
||||||
TEST_CASE( "./succeeding/conditions/equality",
|
|
||||||
"Equality checks that should succeed" )
|
"Equality checks that should succeed" )
|
||||||
{
|
{
|
||||||
|
|
||||||
TestDef td;
|
TestDef td;
|
||||||
td + "hello" + "hello";
|
td + "hello" + "hello";
|
||||||
@ -63,11 +61,11 @@ namespace ConditionTests {
|
|||||||
|
|
||||||
double x = 1.1 + 0.1 + 0.1;
|
double x = 1.1 + 0.1 + 0.1;
|
||||||
REQUIRE( x == Approx( 1.3 ) );
|
REQUIRE( x == Approx( 1.3 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/conditions/equality",
|
TEST_CASE( "./failing/conditions/equality",
|
||||||
"Equality checks that should fail" )
|
"Equality checks that should fail" )
|
||||||
{
|
{
|
||||||
TestData data;
|
TestData data;
|
||||||
|
|
||||||
CHECK( data.int_seven == 6 );
|
CHECK( data.int_seven == 6 );
|
||||||
@ -85,11 +83,11 @@ namespace ConditionTests {
|
|||||||
|
|
||||||
double x = 1.1 + 0.1 + 0.1;
|
double x = 1.1 + 0.1 + 0.1;
|
||||||
CHECK( x == Approx( 1.301 ) );
|
CHECK( x == Approx( 1.301 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/conditions/inequality",
|
TEST_CASE( "./succeeding/conditions/inequality",
|
||||||
"Inequality checks that should succeed" )
|
"Inequality checks that should succeed" )
|
||||||
{
|
{
|
||||||
TestData data;
|
TestData data;
|
||||||
|
|
||||||
REQUIRE( data.int_seven != 6 );
|
REQUIRE( data.int_seven != 6 );
|
||||||
@ -103,11 +101,11 @@ namespace ConditionTests {
|
|||||||
REQUIRE( data.str_hello != "hell" );
|
REQUIRE( data.str_hello != "hell" );
|
||||||
REQUIRE( data.str_hello != "hello1" );
|
REQUIRE( data.str_hello != "hello1" );
|
||||||
REQUIRE( data.str_hello.size() != 6 );
|
REQUIRE( data.str_hello.size() != 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/conditions/inequality",
|
TEST_CASE( "./failing/conditions/inequality",
|
||||||
"Inequality checks that should fails" )
|
"Inequality checks that should fails" )
|
||||||
{
|
{
|
||||||
TestData data;
|
TestData data;
|
||||||
|
|
||||||
CHECK( data.int_seven != 7 );
|
CHECK( data.int_seven != 7 );
|
||||||
@ -115,12 +113,12 @@ namespace ConditionTests {
|
|||||||
CHECK( data.double_pi != Approx( 3.1415926535 ) );
|
CHECK( data.double_pi != Approx( 3.1415926535 ) );
|
||||||
CHECK( data.str_hello != "hello" );
|
CHECK( data.str_hello != "hello" );
|
||||||
CHECK( data.str_hello.size() != 5 );
|
CHECK( data.str_hello.size() != 5 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ordering comparison tests
|
// Ordering comparison tests
|
||||||
TEST_CASE( "./succeeding/conditions/ordered",
|
TEST_CASE( "./succeeding/conditions/ordered",
|
||||||
"Ordering comparison checks that should succeed" )
|
"Ordering comparison checks that should succeed" )
|
||||||
{
|
{
|
||||||
TestData data;
|
TestData data;
|
||||||
|
|
||||||
REQUIRE( data.int_seven < 8 );
|
REQUIRE( data.int_seven < 8 );
|
||||||
@ -144,11 +142,11 @@ namespace ConditionTests {
|
|||||||
REQUIRE( data.str_hello < "zebra" );
|
REQUIRE( data.str_hello < "zebra" );
|
||||||
REQUIRE( data.str_hello > "hellm" );
|
REQUIRE( data.str_hello > "hellm" );
|
||||||
REQUIRE( data.str_hello > "a" );
|
REQUIRE( data.str_hello > "a" );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/conditions/ordered",
|
TEST_CASE( "./failing/conditions/ordered",
|
||||||
"Ordering comparison checks that should fail" )
|
"Ordering comparison checks that should fail" )
|
||||||
{
|
{
|
||||||
TestData data;
|
TestData data;
|
||||||
|
|
||||||
CHECK( data.int_seven > 7 );
|
CHECK( data.int_seven > 7 );
|
||||||
@ -174,12 +172,12 @@ namespace ConditionTests {
|
|||||||
|
|
||||||
CHECK( data.str_hello >= "z" );
|
CHECK( data.str_hello >= "z" );
|
||||||
CHECK( data.str_hello <= "a" );
|
CHECK( data.str_hello <= "a" );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comparisons with int literals
|
// Comparisons with int literals
|
||||||
TEST_CASE( "./succeeding/conditions/int literals",
|
TEST_CASE( "./succeeding/conditions/int literals",
|
||||||
"Comparisons with int literals don't warn when mixing signed/ unsigned" )
|
"Comparisons with int literals don't warn when mixing signed/ unsigned" )
|
||||||
{
|
{
|
||||||
int i = 1;
|
int i = 1;
|
||||||
unsigned int ui = 2;
|
unsigned int ui = 2;
|
||||||
long l = 3;
|
long l = 3;
|
||||||
@ -202,7 +200,7 @@ namespace ConditionTests {
|
|||||||
REQUIRE( 6 == uc );
|
REQUIRE( 6 == uc );
|
||||||
|
|
||||||
REQUIRE( (std::numeric_limits<unsigned long>::max)() > ul );
|
REQUIRE( (std::numeric_limits<unsigned long>::max)() > ul );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable warnings about sign conversions for the next two tests
|
// Disable warnings about sign conversions for the next two tests
|
||||||
// (as we are deliberately invoking them)
|
// (as we are deliberately invoking them)
|
||||||
@ -216,9 +214,9 @@ namespace ConditionTests {
|
|||||||
#pragma warning(disable:4389) // '==' : signed/unsigned mismatch
|
#pragma warning(disable:4389) // '==' : signed/unsigned mismatch
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/conditions//long_to_unsigned_x",
|
TEST_CASE( "./succeeding/conditions//long_to_unsigned_x",
|
||||||
"comparisons between int variables" )
|
"comparisons between int variables" )
|
||||||
{
|
{
|
||||||
long long_var = 1L;
|
long long_var = 1L;
|
||||||
unsigned char unsigned_char_var = 1;
|
unsigned char unsigned_char_var = 1;
|
||||||
unsigned short unsigned_short_var = 1;
|
unsigned short unsigned_short_var = 1;
|
||||||
@ -229,11 +227,11 @@ namespace ConditionTests {
|
|||||||
REQUIRE( long_var == unsigned_short_var );
|
REQUIRE( long_var == unsigned_short_var );
|
||||||
REQUIRE( long_var == unsigned_int_var );
|
REQUIRE( long_var == unsigned_int_var );
|
||||||
REQUIRE( long_var == unsigned_long_var );
|
REQUIRE( long_var == unsigned_long_var );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/conditions/const ints to int literal",
|
TEST_CASE( "./succeeding/conditions/const ints to int literal",
|
||||||
"comparisons between const int variables" )
|
"comparisons between const int variables" )
|
||||||
{
|
{
|
||||||
const unsigned char unsigned_char_var = 1;
|
const unsigned char unsigned_char_var = 1;
|
||||||
const unsigned short unsigned_short_var = 1;
|
const unsigned short unsigned_short_var = 1;
|
||||||
const unsigned int unsigned_int_var = 1;
|
const unsigned int unsigned_int_var = 1;
|
||||||
@ -243,11 +241,11 @@ namespace ConditionTests {
|
|||||||
REQUIRE( unsigned_short_var == 1 );
|
REQUIRE( unsigned_short_var == 1 );
|
||||||
REQUIRE( unsigned_int_var == 1 );
|
REQUIRE( unsigned_int_var == 1 );
|
||||||
REQUIRE( unsigned_long_var == 1 );
|
REQUIRE( unsigned_long_var == 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/conditions/negative ints",
|
TEST_CASE( "./succeeding/conditions/negative ints",
|
||||||
"Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" )
|
"Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" )
|
||||||
{
|
{
|
||||||
CHECK( ( -1 > 2u ) );
|
CHECK( ( -1 > 2u ) );
|
||||||
CHECK( -1 > 2u );
|
CHECK( -1 > 2u );
|
||||||
|
|
||||||
@ -257,22 +255,22 @@ namespace ConditionTests {
|
|||||||
const int minInt = (std::numeric_limits<int>::min)();
|
const int minInt = (std::numeric_limits<int>::min)();
|
||||||
CHECK( ( minInt > 2u ) );
|
CHECK( ( minInt > 2u ) );
|
||||||
CHECK( minInt > 2u );
|
CHECK( minInt > 2u );
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct Ex
|
struct Ex
|
||||||
{
|
{
|
||||||
Ex( T ){}
|
Ex( T ){}
|
||||||
|
|
||||||
bool operator == ( const T& ) const { return true; }
|
bool operator == ( const T& ) const { return true; }
|
||||||
T operator * ( const T& ) const { return T(); }
|
T operator * ( const T& ) const { return T(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/conditions/computed ints",
|
TEST_CASE( "./succeeding/conditions/computed ints",
|
||||||
"Comparisons between ints where one side is computed" )
|
"Comparisons between ints where one side is computed" )
|
||||||
{
|
{
|
||||||
CHECK( 54 == 6*9 );
|
CHECK( 54 == 6*9 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
@ -281,9 +279,9 @@ namespace ConditionTests {
|
|||||||
inline const char* returnsConstNull(){ return NULL; }
|
inline const char* returnsConstNull(){ return NULL; }
|
||||||
inline char* returnsNull(){ return NULL; }
|
inline char* returnsNull(){ return NULL; }
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/conditions/ptr",
|
TEST_CASE( "./succeeding/conditions/ptr",
|
||||||
"Pointers can be compared to null" )
|
"Pointers can be compared to null" )
|
||||||
{
|
{
|
||||||
TestData* p = NULL;
|
TestData* p = NULL;
|
||||||
TestData* pNULL = NULL;
|
TestData* pNULL = NULL;
|
||||||
|
|
||||||
@ -305,18 +303,18 @@ inline char* returnsNull(){ return NULL; }
|
|||||||
REQUIRE( returnsConstNull() == NULL );
|
REQUIRE( returnsConstNull() == NULL );
|
||||||
|
|
||||||
REQUIRE( NULL != p );
|
REQUIRE( NULL != p );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not (!) tests
|
// Not (!) tests
|
||||||
// The problem with the ! operator is that it has right-to-left associativity.
|
// The problem with the ! operator is that it has right-to-left associativity.
|
||||||
// This means we can't isolate it when we decompose. The simple REQUIRE( !false ) form, therefore,
|
// This means we can't isolate it when we decompose. The simple REQUIRE( !false ) form, therefore,
|
||||||
// cannot have the operand value extracted. The test will work correctly, and the situation
|
// cannot have the operand value extracted. The test will work correctly, and the situation
|
||||||
// is detected and a warning issued.
|
// is detected and a warning issued.
|
||||||
// An alternative form of the macros (CHECK_FALSE and REQUIRE_FALSE) can be used instead to capture
|
// An alternative form of the macros (CHECK_FALSE and REQUIRE_FALSE) can be used instead to capture
|
||||||
// the operand value.
|
// the operand value.
|
||||||
TEST_CASE( "./succeeding/conditions/not",
|
TEST_CASE( "./succeeding/conditions/not",
|
||||||
"'Not' checks that should succeed" )
|
"'Not' checks that should succeed" )
|
||||||
{
|
{
|
||||||
bool falseValue = false;
|
bool falseValue = false;
|
||||||
|
|
||||||
REQUIRE( false == false );
|
REQUIRE( false == false );
|
||||||
@ -329,11 +327,11 @@ inline char* returnsNull(){ return NULL; }
|
|||||||
|
|
||||||
REQUIRE( !(1 == 2) );
|
REQUIRE( !(1 == 2) );
|
||||||
REQUIRE_FALSE( 1 == 2 );
|
REQUIRE_FALSE( 1 == 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/conditions/not",
|
TEST_CASE( "./failing/conditions/not",
|
||||||
"'Not' checks that should fail" )
|
"'Not' checks that should fail" )
|
||||||
{
|
{
|
||||||
bool trueValue = true;
|
bool trueValue = true;
|
||||||
|
|
||||||
CHECK( false != false );
|
CHECK( false != false );
|
||||||
@ -346,5 +344,4 @@ inline char* returnsNull(){ return NULL; }
|
|||||||
|
|
||||||
CHECK( !(1 == 1) );
|
CHECK( !(1 == 1) );
|
||||||
CHECK_FALSE( 1 == 1 );
|
CHECK_FALSE( 1 == 1 );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -28,51 +28,48 @@ namespace
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ExceptionTests
|
TEST_CASE( "./succeeding/exceptions/explicit", "When checked exceptions are thrown they can be expected or unexpected" )
|
||||||
{
|
{
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/exceptions/explicit", "When checked exceptions are thrown they can be expected or unexpected" )
|
|
||||||
{
|
|
||||||
REQUIRE_THROWS_AS( thisThrows(), std::domain_error );
|
REQUIRE_THROWS_AS( thisThrows(), std::domain_error );
|
||||||
REQUIRE_NOTHROW( thisDoesntThrow() );
|
REQUIRE_NOTHROW( thisDoesntThrow() );
|
||||||
REQUIRE_THROWS( thisThrows() );
|
REQUIRE_THROWS( thisThrows() );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/exceptions/explicit", "When checked exceptions are thrown they can be expected or unexpected" )
|
TEST_CASE( "./failing/exceptions/explicit", "When checked exceptions are thrown they can be expected or unexpected" )
|
||||||
{
|
{
|
||||||
CHECK_THROWS_AS( thisThrows(), std::string );
|
CHECK_THROWS_AS( thisThrows(), std::string );
|
||||||
CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error );
|
CHECK_THROWS_AS( thisDoesntThrow(), std::domain_error );
|
||||||
CHECK_NOTHROW( thisThrows() );
|
CHECK_NOTHROW( thisThrows() );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/exceptions/implicit", "When unchecked exceptions are thrown they are always failures" )
|
TEST_CASE( "./failing/exceptions/implicit", "When unchecked exceptions are thrown they are always failures" )
|
||||||
{
|
{
|
||||||
if( Catch::isTrue( true ) )
|
if( Catch::isTrue( true ) )
|
||||||
throw std::domain_error( "unexpected exception" );
|
throw std::domain_error( "unexpected exception" );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/exceptions/implicit/2", "An unchecked exception reports the line of the last assertion" )
|
TEST_CASE( "./failing/exceptions/implicit/2", "An unchecked exception reports the line of the last assertion" )
|
||||||
{
|
{
|
||||||
CHECK( 1 == 1 );
|
CHECK( 1 == 1 );
|
||||||
if( Catch::isTrue( true ) )
|
if( Catch::isTrue( true ) )
|
||||||
throw std::domain_error( "unexpected exception" );
|
throw std::domain_error( "unexpected exception" );
|
||||||
}
|
}
|
||||||
TEST_CASE( "./failing/exceptions/implicit/3", "When unchecked exceptions are thrown they are always failures" )
|
TEST_CASE( "./failing/exceptions/implicit/3", "When unchecked exceptions are thrown they are always failures" )
|
||||||
{
|
{
|
||||||
SECTION( "section name", "" )
|
SECTION( "section name", "" )
|
||||||
{
|
{
|
||||||
if( Catch::isTrue( true ) )
|
if( Catch::isTrue( true ) )
|
||||||
throw std::domain_error( "unexpected exception" );
|
throw std::domain_error( "unexpected exception" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/exceptions/implicit/4", "When unchecked exceptions are thrown they are always failures" )
|
TEST_CASE( "./failing/exceptions/implicit/4", "When unchecked exceptions are thrown they are always failures" )
|
||||||
{
|
{
|
||||||
CHECK( thisThrows() == 0 );
|
CHECK( thisThrows() == 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/exceptions/implicit", "When unchecked exceptions are thrown, but caught, they do not affect the test" )
|
TEST_CASE( "./succeeding/exceptions/implicit", "When unchecked exceptions are thrown, but caught, they do not affect the test" )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
throw std::domain_error( "unexpected exception" );
|
throw std::domain_error( "unexpected exception" );
|
||||||
@ -80,11 +77,11 @@ namespace ExceptionTests
|
|||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CustomException
|
class CustomException
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CustomException( const std::string& msg )
|
CustomException( const std::string& msg )
|
||||||
: m_msg( msg )
|
: m_msg( msg )
|
||||||
{}
|
{}
|
||||||
@ -94,54 +91,53 @@ namespace ExceptionTests
|
|||||||
return m_msg;
|
return m_msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_msg;
|
std::string m_msg;
|
||||||
};
|
};
|
||||||
|
|
||||||
CATCH_TRANSLATE_EXCEPTION( CustomException& ex )
|
CATCH_TRANSLATE_EXCEPTION( CustomException& ex )
|
||||||
{
|
{
|
||||||
return ex.getMessage();
|
return ex.getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
CATCH_TRANSLATE_EXCEPTION( double& ex )
|
CATCH_TRANSLATE_EXCEPTION( double& ex )
|
||||||
{
|
{
|
||||||
return Catch::toString( ex );
|
return Catch::toString( ex );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/exceptions/custom", "Unexpected custom exceptions can be translated" )
|
TEST_CASE( "./failing/exceptions/custom", "Unexpected custom exceptions can be translated" )
|
||||||
{
|
{
|
||||||
if( Catch::isTrue( true ) )
|
if( Catch::isTrue( true ) )
|
||||||
throw CustomException( "custom exception" );
|
throw CustomException( "custom exception" );
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void throwCustom() {
|
inline void throwCustom() {
|
||||||
if( Catch::isTrue( true ) )
|
if( Catch::isTrue( true ) )
|
||||||
throw CustomException( "custom exception - not std" );
|
throw CustomException( "custom exception - not std" );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/exceptions/custom/nothrow", "Custom exceptions can be translated when testing for nothrow" )
|
TEST_CASE( "./failing/exceptions/custom/nothrow", "Custom exceptions can be translated when testing for nothrow" )
|
||||||
{
|
{
|
||||||
REQUIRE_NOTHROW( throwCustom() );
|
REQUIRE_NOTHROW( throwCustom() );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/exceptions/custom/throw", "Custom exceptions can be translated when testing for throwing as something else" )
|
TEST_CASE( "./failing/exceptions/custom/throw", "Custom exceptions can be translated when testing for throwing as something else" )
|
||||||
{
|
{
|
||||||
REQUIRE_THROWS_AS( throwCustom(), std::exception );
|
REQUIRE_THROWS_AS( throwCustom(), std::exception );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE( "./failing/exceptions/custom/double", "Unexpected custom exceptions can be translated" )
|
TEST_CASE( "./failing/exceptions/custom/double", "Unexpected custom exceptions can be translated" )
|
||||||
{
|
{
|
||||||
if( Catch::isTrue( true ) )
|
if( Catch::isTrue( true ) )
|
||||||
throw double( 3.14 );
|
throw double( 3.14 );
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int thisFunctionNotImplemented( int ) {
|
inline int thisFunctionNotImplemented( int ) {
|
||||||
CATCH_NOT_IMPLEMENTED;
|
CATCH_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/exceptions/notimplemented", "" )
|
TEST_CASE( "./succeeding/exceptions/notimplemented", "" )
|
||||||
{
|
{
|
||||||
REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) );
|
REQUIRE_THROWS( thisFunctionNotImplemented( 7 ) );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -8,29 +8,26 @@
|
|||||||
|
|
||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
|
|
||||||
namespace MessageTests
|
TEST_CASE( "./succeeding/message", "INFO and WARN do not abort tests" )
|
||||||
{
|
{
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/message", "INFO and WARN do not abort tests" )
|
|
||||||
{
|
|
||||||
INFO( "this is a " << "message" ); // This should output the message if a failure occurs
|
INFO( "this is a " << "message" ); // This should output the message if a failure occurs
|
||||||
WARN( "this is a " << "warning" ); // This should always output the message but then continue
|
WARN( "this is a " << "warning" ); // This should always output the message but then continue
|
||||||
}
|
}
|
||||||
TEST_CASE( "./succeeding/succeed", "SUCCEED counts as a test pass" )
|
TEST_CASE( "./succeeding/succeed", "SUCCEED counts as a test pass" )
|
||||||
{
|
{
|
||||||
SUCCEED( "this is a " << "success" );
|
SUCCEED( "this is a " << "success" );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/message/info/1", "INFO gets logged on failure" )
|
TEST_CASE( "./failing/message/info/1", "INFO gets logged on failure" )
|
||||||
{
|
{
|
||||||
INFO( "this message should be logged" );
|
INFO( "this message should be logged" );
|
||||||
INFO( "so should this" );
|
INFO( "so should this" );
|
||||||
int a = 2;
|
int a = 2;
|
||||||
REQUIRE( a == 1 );
|
REQUIRE( a == 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./mixed/message/info/2", "INFO gets logged on failure" )
|
TEST_CASE( "./mixed/message/info/2", "INFO gets logged on failure" )
|
||||||
{
|
{
|
||||||
INFO( "this message may be logged later" );
|
INFO( "this message may be logged later" );
|
||||||
int a = 2;
|
int a = 2;
|
||||||
CHECK( a == 2 );
|
CHECK( a == 2 );
|
||||||
@ -46,16 +43,16 @@ namespace MessageTests
|
|||||||
INFO( "but not this" );
|
INFO( "but not this" );
|
||||||
|
|
||||||
CHECK( a == 2 );
|
CHECK( a == 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/message/fail", "FAIL aborts the test" )
|
TEST_CASE( "./failing/message/fail", "FAIL aborts the test" )
|
||||||
{
|
{
|
||||||
if( Catch::isTrue( true ) )
|
if( Catch::isTrue( true ) )
|
||||||
FAIL( "This is a " << "failure" ); // This should output the message and abort
|
FAIL( "This is a " << "failure" ); // This should output the message and abort
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/message/sections", "Output from all sections is reported" )
|
TEST_CASE( "./failing/message/sections", "Output from all sections is reported" )
|
||||||
{
|
{
|
||||||
SECTION( "one", "" )
|
SECTION( "one", "" )
|
||||||
{
|
{
|
||||||
FAIL( "Message from section one" );
|
FAIL( "Message from section one" );
|
||||||
@ -65,10 +62,10 @@ namespace MessageTests
|
|||||||
{
|
{
|
||||||
FAIL( "Message from section two" );
|
FAIL( "Message from section two" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/message/sections/stdout", "Output from all sections is reported" )
|
TEST_CASE( "./succeeding/message/sections/stdout", "Output from all sections is reported" )
|
||||||
{
|
{
|
||||||
SECTION( "one", "" )
|
SECTION( "one", "" )
|
||||||
{
|
{
|
||||||
std::cout << "Message from section one" << std::endl;
|
std::cout << "Message from section one" << std::endl;
|
||||||
@ -78,29 +75,28 @@ namespace MessageTests
|
|||||||
{
|
{
|
||||||
std::cout << "Message from section two" << std::endl;
|
std::cout << "Message from section two" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./mixed/message/scoped", "" )
|
TEST_CASE( "./mixed/message/scoped", "" )
|
||||||
{
|
{
|
||||||
for( int i=0; i<100; i++ )
|
for( int i=0; i<100; i++ )
|
||||||
{
|
{
|
||||||
SCOPED_INFO( "current counter " << i );
|
SCOPED_INFO( "current counter " << i );
|
||||||
SCOPED_CAPTURE( i );
|
SCOPED_CAPTURE( i );
|
||||||
REQUIRE( i < 10 );
|
REQUIRE( i < 10 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/nofail", "The NO_FAIL macro reports a failure but does not fail the test" )
|
TEST_CASE( "./succeeding/nofail", "The NO_FAIL macro reports a failure but does not fail the test" )
|
||||||
{
|
{
|
||||||
CHECK_NOFAIL( 1 == 2 );
|
CHECK_NOFAIL( 1 == 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "just info", "[info][isolated info][.]" )
|
TEST_CASE( "just info", "[info][isolated info][.]" )
|
||||||
{
|
{
|
||||||
INFO( "this should never be seen" );
|
INFO( "this should never be seen" );
|
||||||
}
|
}
|
||||||
TEST_CASE( "just failure", "[fail][isolated info][.]" )
|
TEST_CASE( "just failure", "[fail][isolated info][.]" )
|
||||||
{
|
{
|
||||||
FAIL( "Previous info should not be seen" );
|
FAIL( "Previous info should not be seen" );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -11,11 +11,8 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace MiscTests
|
TEST_CASE( "./succeeding/Misc/Sections", "random SECTION tests" )
|
||||||
{
|
{
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/Misc/Sections", "random SECTION tests" )
|
|
||||||
{
|
|
||||||
int a = 1;
|
int a = 1;
|
||||||
int b = 2;
|
int b = 2;
|
||||||
|
|
||||||
@ -29,10 +26,10 @@ namespace MiscTests
|
|||||||
{
|
{
|
||||||
REQUIRE( a != b);
|
REQUIRE( a != b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/Misc/Sections/nested", "nested SECTION tests" )
|
TEST_CASE( "./succeeding/Misc/Sections/nested", "nested SECTION tests" )
|
||||||
{
|
{
|
||||||
int a = 1;
|
int a = 1;
|
||||||
int b = 2;
|
int b = 2;
|
||||||
|
|
||||||
@ -46,10 +43,10 @@ namespace MiscTests
|
|||||||
REQUIRE( a != b);
|
REQUIRE( a != b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./mixed/Misc/Sections/nested2", "nested SECTION tests" )
|
TEST_CASE( "./mixed/Misc/Sections/nested2", "nested SECTION tests" )
|
||||||
{
|
{
|
||||||
int a = 1;
|
int a = 1;
|
||||||
int b = 2;
|
int b = 2;
|
||||||
|
|
||||||
@ -69,10 +66,10 @@ namespace MiscTests
|
|||||||
REQUIRE( a < b );
|
REQUIRE( a < b );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./Sections/nested/a/b", "nested SECTION tests" )
|
TEST_CASE( "./Sections/nested/a/b", "nested SECTION tests" )
|
||||||
{
|
{
|
||||||
SECTION( "c", "" )
|
SECTION( "c", "" )
|
||||||
{
|
{
|
||||||
SECTION( "d (leaf)", "" )
|
SECTION( "d (leaf)", "" )
|
||||||
@ -87,10 +84,10 @@ namespace MiscTests
|
|||||||
SECTION( "f (leaf)", "" )
|
SECTION( "f (leaf)", "" )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./mixed/Misc/Sections/loops", "looped SECTION tests" )
|
TEST_CASE( "./mixed/Misc/Sections/loops", "looped SECTION tests" )
|
||||||
{
|
{
|
||||||
int a = 1;
|
int a = 1;
|
||||||
|
|
||||||
for( int b = 0; b < 10; ++b )
|
for( int b = 0; b < 10; ++b )
|
||||||
@ -102,10 +99,10 @@ namespace MiscTests
|
|||||||
CHECK( b > a );
|
CHECK( b > a );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./mixed/Misc/loops", "looped tests" )
|
TEST_CASE( "./mixed/Misc/loops", "looped tests" )
|
||||||
{
|
{
|
||||||
static const int fib[] = { 1, 1, 2, 3, 5, 8, 13, 21 };
|
static const int fib[] = { 1, 1, 2, 3, 5, 8, 13, 21 };
|
||||||
|
|
||||||
for( size_t i=0; i < sizeof(fib)/sizeof(int); ++i )
|
for( size_t i=0; i < sizeof(fib)/sizeof(int); ++i )
|
||||||
@ -113,72 +110,72 @@ namespace MiscTests
|
|||||||
INFO( "Testing if fib[" << i << "] (" << fib[i] << ") is even" );
|
INFO( "Testing if fib[" << i << "] (" << fib[i] << ") is even" );
|
||||||
CHECK( ( fib[i] % 2 ) == 0 );
|
CHECK( ( fib[i] % 2 ) == 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/Misc/stdout,stderr", "Sends stuff to stdout and stderr" )
|
TEST_CASE( "./succeeding/Misc/stdout,stderr", "Sends stuff to stdout and stderr" )
|
||||||
{
|
{
|
||||||
std::cout << "Some information" << std::endl;
|
std::cout << "Some information" << std::endl;
|
||||||
|
|
||||||
std::cerr << "An error" << std::endl;
|
std::cerr << "An error" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const char* makeString( bool makeNull )
|
inline const char* makeString( bool makeNull )
|
||||||
{
|
{
|
||||||
return makeNull ? NULL : "valid string";
|
return makeNull ? NULL : "valid string";
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/Misc/null strings", "" )
|
TEST_CASE( "./succeeding/Misc/null strings", "" )
|
||||||
{
|
{
|
||||||
REQUIRE( makeString( false ) != static_cast<char*>(NULL));
|
REQUIRE( makeString( false ) != static_cast<char*>(NULL));
|
||||||
REQUIRE( makeString( true ) == static_cast<char*>(NULL));
|
REQUIRE( makeString( true ) == static_cast<char*>(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/info", "sends information to INFO" )
|
TEST_CASE( "./failing/info", "sends information to INFO" )
|
||||||
{
|
{
|
||||||
INFO( "hi" );
|
INFO( "hi" );
|
||||||
int i = 7;
|
int i = 7;
|
||||||
CAPTURE( i );
|
CAPTURE( i );
|
||||||
REQUIRE( false );
|
REQUIRE( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool testCheckedIf( bool flag )
|
inline bool testCheckedIf( bool flag )
|
||||||
{
|
{
|
||||||
CHECKED_IF( flag )
|
CHECKED_IF( flag )
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/checkedif", "" )
|
TEST_CASE( "./succeeding/checkedif", "" )
|
||||||
{
|
{
|
||||||
REQUIRE( testCheckedIf( true ) );
|
REQUIRE( testCheckedIf( true ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/checkedif", "" )
|
TEST_CASE( "./failing/checkedif", "" )
|
||||||
{
|
{
|
||||||
REQUIRE( testCheckedIf( false ) );
|
REQUIRE( testCheckedIf( false ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool testCheckedElse( bool flag )
|
inline bool testCheckedElse( bool flag )
|
||||||
{
|
{
|
||||||
CHECKED_ELSE( flag )
|
CHECKED_ELSE( flag )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./succeeding/checkedelse", "" )
|
TEST_CASE( "./succeeding/checkedelse", "" )
|
||||||
{
|
{
|
||||||
REQUIRE( testCheckedElse( true ) );
|
REQUIRE( testCheckedElse( true ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./failing/checkedelse", "" )
|
TEST_CASE( "./failing/checkedelse", "" )
|
||||||
{
|
{
|
||||||
REQUIRE( testCheckedElse( false ) );
|
REQUIRE( testCheckedElse( false ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./misc/xmlentitycheck", "" )
|
TEST_CASE( "./misc/xmlentitycheck", "" )
|
||||||
{
|
{
|
||||||
SECTION( "embedded xml", "<test>it should be possible to embed xml characters, such as <, \" or &, or even whole <xml>documents</xml> within an attribute</test>" )
|
SECTION( "embedded xml", "<test>it should be possible to embed xml characters, such as <, \" or &, or even whole <xml>documents</xml> within an attribute</test>" )
|
||||||
{
|
{
|
||||||
// No test
|
// No test
|
||||||
@ -187,115 +184,115 @@ namespace MiscTests
|
|||||||
{
|
{
|
||||||
// No test
|
// No test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "./manual/onechar", "send a single char to INFO" )
|
TEST_CASE( "./manual/onechar", "send a single char to INFO" )
|
||||||
{
|
{
|
||||||
INFO(3);
|
INFO(3);
|
||||||
REQUIRE(false);
|
REQUIRE(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("./succeeding/atomic if", "")
|
TEST_CASE("./succeeding/atomic if", "")
|
||||||
{
|
{
|
||||||
size_t x = 0;
|
size_t x = 0;
|
||||||
|
|
||||||
if( x )
|
if( x )
|
||||||
REQUIRE(x > 0);
|
REQUIRE(x > 0);
|
||||||
else
|
else
|
||||||
REQUIRE(x == 0);
|
REQUIRE(x == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const char* testStringForMatching()
|
inline const char* testStringForMatching()
|
||||||
{
|
{
|
||||||
return "this string contains 'abc' as a substring";
|
return "this string contains 'abc' as a substring";
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("./succeeding/matchers", "")
|
TEST_CASE("./succeeding/matchers", "")
|
||||||
{
|
{
|
||||||
REQUIRE_THAT( testStringForMatching(), Contains( "string" ) );
|
REQUIRE_THAT( testStringForMatching(), Contains( "string" ) );
|
||||||
CHECK_THAT( testStringForMatching(), Contains( "abc" ) );
|
CHECK_THAT( testStringForMatching(), Contains( "abc" ) );
|
||||||
|
|
||||||
CHECK_THAT( testStringForMatching(), StartsWith( "this" ) );
|
CHECK_THAT( testStringForMatching(), StartsWith( "this" ) );
|
||||||
CHECK_THAT( testStringForMatching(), EndsWith( "substring" ) );
|
CHECK_THAT( testStringForMatching(), EndsWith( "substring" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("./failing/matchers/Contains", "")
|
TEST_CASE("./failing/matchers/Contains", "")
|
||||||
{
|
{
|
||||||
CHECK_THAT( testStringForMatching(), Contains( "not there" ) );
|
CHECK_THAT( testStringForMatching(), Contains( "not there" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("./failing/matchers/StartsWith", "")
|
TEST_CASE("./failing/matchers/StartsWith", "")
|
||||||
{
|
{
|
||||||
CHECK_THAT( testStringForMatching(), StartsWith( "string" ) );
|
CHECK_THAT( testStringForMatching(), StartsWith( "string" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("./failing/matchers/EndsWith", "")
|
TEST_CASE("./failing/matchers/EndsWith", "")
|
||||||
{
|
{
|
||||||
CHECK_THAT( testStringForMatching(), EndsWith( "this" ) );
|
CHECK_THAT( testStringForMatching(), EndsWith( "this" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("./failing/matchers/Equals", "")
|
TEST_CASE("./failing/matchers/Equals", "")
|
||||||
{
|
{
|
||||||
CHECK_THAT( testStringForMatching(), Equals( "something else" ) );
|
CHECK_THAT( testStringForMatching(), Equals( "something else" ) );
|
||||||
}
|
}
|
||||||
TEST_CASE("string", "Equals with NULL")
|
TEST_CASE("string", "Equals with NULL")
|
||||||
{
|
{
|
||||||
REQUIRE_THAT("", Equals(NULL));
|
REQUIRE_THAT("", Equals(NULL));
|
||||||
}
|
}
|
||||||
TEST_CASE("./succeeding/matchers/AllOf", "")
|
TEST_CASE("./succeeding/matchers/AllOf", "")
|
||||||
{
|
{
|
||||||
CHECK_THAT( testStringForMatching(), AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) );
|
CHECK_THAT( testStringForMatching(), AllOf( Catch::Contains( "string" ), Catch::Contains( "abc" ) ) );
|
||||||
}
|
}
|
||||||
TEST_CASE("./succeeding/matchers/AnyOf", "")
|
TEST_CASE("./succeeding/matchers/AnyOf", "")
|
||||||
{
|
{
|
||||||
CHECK_THAT( testStringForMatching(), AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) );
|
CHECK_THAT( testStringForMatching(), AnyOf( Catch::Contains( "string" ), Catch::Contains( "not there" ) ) );
|
||||||
CHECK_THAT( testStringForMatching(), AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) );
|
CHECK_THAT( testStringForMatching(), AnyOf( Catch::Contains( "not there" ), Catch::Contains( "string" ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("./succeeding/matchers/Equals", "")
|
TEST_CASE("./succeeding/matchers/Equals", "")
|
||||||
{
|
{
|
||||||
CHECK_THAT( testStringForMatching(), Equals( "this string contains 'abc' as a substring" ) );
|
CHECK_THAT( testStringForMatching(), Equals( "this string contains 'abc' as a substring" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
inline unsigned int Factorial( unsigned int number )
|
inline unsigned int Factorial( unsigned int number )
|
||||||
{
|
{
|
||||||
// return number <= 1 ? number : Factorial(number-1)*number;
|
// return number <= 1 ? number : Factorial(number-1)*number;
|
||||||
return number > 1 ? Factorial(number-1)*number : 1;
|
return number > 1 ? Factorial(number-1)*number : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "Factorials are computed", "[factorial]" ) {
|
TEST_CASE( "Factorials are computed", "[factorial]" ) {
|
||||||
REQUIRE( Factorial(0) == 1 );
|
REQUIRE( Factorial(0) == 1 );
|
||||||
REQUIRE( Factorial(1) == 1 );
|
REQUIRE( Factorial(1) == 1 );
|
||||||
REQUIRE( Factorial(2) == 2 );
|
REQUIRE( Factorial(2) == 2 );
|
||||||
REQUIRE( Factorial(3) == 6 );
|
REQUIRE( Factorial(3) == 6 );
|
||||||
REQUIRE( Factorial(10) == 3628800 );
|
REQUIRE( Factorial(10) == 3628800 );
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "empty", "An empty test with no assertions" )
|
TEST_CASE( "empty", "An empty test with no assertions" )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "Nice descriptive name", "[tag1][tag2][tag3][.]" )
|
TEST_CASE( "Nice descriptive name", "[tag1][tag2][tag3][.]" )
|
||||||
{
|
{
|
||||||
WARN( "This one ran" );
|
WARN( "This one ran" );
|
||||||
}
|
}
|
||||||
TEST_CASE( "first tag", "[tag1]" )
|
TEST_CASE( "first tag", "[tag1]" )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
TEST_CASE( "second tag", "[tag2]" )
|
TEST_CASE( "second tag", "[tag2]" )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//TEST_CASE( "spawn a new process", "[.]" )
|
//TEST_CASE( "spawn a new process", "[.]" )
|
||||||
//{
|
//{
|
||||||
// // !TBD Work in progress
|
// // !TBD Work in progress
|
||||||
// char line[200];
|
// char line[200];
|
||||||
// FILE* output = popen("./CatchSelfTest ./failing/matchers/StartsWith", "r");
|
// FILE* output = popen("./CatchSelfTest ./failing/matchers/StartsWith", "r");
|
||||||
// while ( fgets(line, 199, output) )
|
// while ( fgets(line, 199, output) )
|
||||||
// std::cout << line;
|
// std::cout << line;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
TEST_CASE( "vectors can be sized and resized", "[vector]" ) {
|
TEST_CASE( "vectors can be sized and resized", "[vector]" ) {
|
||||||
|
|
||||||
std::vector<int> v( 5 );
|
std::vector<int> v( 5 );
|
||||||
|
|
||||||
@ -333,38 +330,37 @@ namespace MiscTests
|
|||||||
REQUIRE( v.size() == 5 );
|
REQUIRE( v.size() == 5 );
|
||||||
REQUIRE( v.capacity() >= 5 );
|
REQUIRE( v.capacity() >= 5 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/philsquared/Catch/issues/166
|
// https://github.com/philsquared/Catch/issues/166
|
||||||
TEST_CASE("./failing/CatchSectionInfiniteLoop", "")
|
TEST_CASE("./failing/CatchSectionInfiniteLoop", "")
|
||||||
{
|
{
|
||||||
SECTION("Outer", "")
|
SECTION("Outer", "")
|
||||||
SECTION("Inner", "")
|
SECTION("Inner", "")
|
||||||
SUCCEED("that's not flying - that's failing in style");
|
SUCCEED("that's not flying - that's failing in style");
|
||||||
|
|
||||||
FAIL("to infinity and beyond");
|
FAIL("to infinity and beyond");
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//#include "internal/catch_timer.h"
|
|
||||||
//
|
|
||||||
//TEST_CASE( "Timer", "[work-in-progress]" )
|
|
||||||
//{
|
|
||||||
// Catch::Timer t;
|
|
||||||
// t.start();
|
|
||||||
//
|
|
||||||
// std::cout << "starting..." << std::endl;
|
|
||||||
//
|
|
||||||
// double d = 0;
|
|
||||||
// for( int i = 0; i < 100000; ++i )
|
|
||||||
// for( int j = 0; j < 1000; ++j )
|
|
||||||
// d += (double)i*(double)j;
|
|
||||||
//
|
|
||||||
// double duration = t.getElapsedSeconds();
|
|
||||||
//
|
|
||||||
// std::cout << "finished in " << duration << std::endl;
|
|
||||||
//
|
|
||||||
// SUCCEED("yay");
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//#include "internal/catch_timer.h"
|
||||||
|
//
|
||||||
|
//TEST_CASE( "Timer", "[work-in-progress]" )
|
||||||
|
//{
|
||||||
|
// Catch::Timer t;
|
||||||
|
// t.start();
|
||||||
|
//
|
||||||
|
// std::cout << "starting..." << std::endl;
|
||||||
|
//
|
||||||
|
// double d = 0;
|
||||||
|
// for( int i = 0; i < 100000; ++i )
|
||||||
|
// for( int j = 0; j < 1000; ++j )
|
||||||
|
// d += (double)i*(double)j;
|
||||||
|
//
|
||||||
|
// double duration = t.getElapsedSeconds();
|
||||||
|
//
|
||||||
|
// std::cout << "finished in " << duration << std::endl;
|
||||||
|
//
|
||||||
|
// SUCCEED("yay");
|
||||||
|
//
|
||||||
|
//}
|
||||||
|
@ -24,39 +24,36 @@ namespace Catch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace TrickTests
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
{
|
TEST_CASE
|
||||||
|
(
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
TEST_CASE
|
|
||||||
(
|
|
||||||
"./succeeding/Tricky/std::pair",
|
"./succeeding/Tricky/std::pair",
|
||||||
"Parsing a std::pair"
|
"Parsing a std::pair"
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
std::pair<int, int> aNicePair( 1, 2 );
|
std::pair<int, int> aNicePair( 1, 2 );
|
||||||
|
|
||||||
REQUIRE( (std::pair<int, int>( 1, 2 )) == aNicePair );
|
REQUIRE( (std::pair<int, int>( 1, 2 )) == aNicePair );
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
TEST_CASE
|
TEST_CASE
|
||||||
(
|
(
|
||||||
"./inprogress/failing/Tricky/trailing expression",
|
"./inprogress/failing/Tricky/trailing expression",
|
||||||
"Where the is more to the expression after the RHS"
|
"Where the is more to the expression after the RHS"
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// int a = 1, b = 2;
|
// int a = 1, b = 2;
|
||||||
// REQUIRE( a == 2 || b == 2 );
|
// REQUIRE( a == 2 || b == 2 );
|
||||||
WARN( "Uncomment the code in this test to check that it gives a sensible compiler error" );
|
WARN( "Uncomment the code in this test to check that it gives a sensible compiler error" );
|
||||||
}
|
}
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
TEST_CASE
|
TEST_CASE
|
||||||
(
|
(
|
||||||
"./inprogress/failing/Tricky/compound lhs",
|
"./inprogress/failing/Tricky/compound lhs",
|
||||||
"Where the LHS is not a simple value"
|
"Where the LHS is not a simple value"
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
int a = 1;
|
int a = 1;
|
||||||
int b = 2;
|
int b = 2;
|
||||||
@ -65,24 +62,24 @@ namespace TrickTests
|
|||||||
REQUIRE( a+1 == b-1 );
|
REQUIRE( a+1 == b-1 );
|
||||||
*/
|
*/
|
||||||
WARN( "Uncomment the code in this test to check that it gives a sensible compiler error" );
|
WARN( "Uncomment the code in this test to check that it gives a sensible compiler error" );
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Opaque
|
struct Opaque
|
||||||
{
|
{
|
||||||
int val;
|
int val;
|
||||||
bool operator ==( const Opaque& o ) const
|
bool operator ==( const Opaque& o ) const
|
||||||
{
|
{
|
||||||
return val == o.val;
|
return val == o.val;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
TEST_CASE
|
TEST_CASE
|
||||||
(
|
(
|
||||||
"./failing/Tricky/non streamable type",
|
"./failing/Tricky/non streamable type",
|
||||||
"A failing expression with a non streamable type is still captured"
|
"A failing expression with a non streamable type is still captured"
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
Opaque o1, o2;
|
Opaque o1, o2;
|
||||||
o1.val = 7;
|
o1.val = 7;
|
||||||
@ -90,32 +87,31 @@ namespace TrickTests
|
|||||||
|
|
||||||
CHECK( &o1 == &o2 );
|
CHECK( &o1 == &o2 );
|
||||||
CHECK( o1 == o2 );
|
CHECK( o1 == o2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
TEST_CASE
|
TEST_CASE
|
||||||
(
|
(
|
||||||
"./failing/string literals",
|
"./failing/string literals",
|
||||||
"string literals of different sizes can be compared"
|
"string literals of different sizes can be compared"
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
REQUIRE( std::string( "first" ) == "second" );
|
REQUIRE( std::string( "first" ) == "second" );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
TEST_CASE
|
TEST_CASE
|
||||||
(
|
(
|
||||||
"./succeeding/side-effects",
|
"./succeeding/side-effects",
|
||||||
"An expression with side-effects should only be evaluated once"
|
"An expression with side-effects should only be evaluated once"
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int i = 7;
|
int i = 7;
|
||||||
|
|
||||||
REQUIRE( i++ == 7 );
|
REQUIRE( i++ == 7 );
|
||||||
REQUIRE( i++ == 8 );
|
REQUIRE( i++ == 8 );
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace A {
|
namespace A {
|
||||||
|
@ -94,11 +94,8 @@
|
|||||||
<ClCompile Include="..\..\..\SelfTest\ApproxTests.cpp" />
|
<ClCompile Include="..\..\..\SelfTest\ApproxTests.cpp" />
|
||||||
<ClCompile Include="..\..\..\SelfTest\BDDTests.cpp" />
|
<ClCompile Include="..\..\..\SelfTest\BDDTests.cpp" />
|
||||||
<ClCompile Include="..\..\..\SelfTest\CmdLineTests.cpp" />
|
<ClCompile Include="..\..\..\SelfTest\CmdLineTests.cpp" />
|
||||||
<ClCompile Include="..\..\..\SelfTest\MessageInstantiationTests1.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\SelfTest\MessageInstantiationTests2.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\SelfTest\SectionTrackerTests.cpp" />
|
<ClCompile Include="..\..\..\SelfTest\SectionTrackerTests.cpp" />
|
||||||
<ClCompile Include="..\..\..\SelfTest\TestMain.cpp" />
|
<ClCompile Include="..\..\..\SelfTest\TestMain.cpp" />
|
||||||
<ClCompile Include="..\..\..\SelfTest\catch_self_test.cpp" />
|
|
||||||
<ClCompile Include="..\..\..\SelfTest\ClassTests.cpp" />
|
<ClCompile Include="..\..\..\SelfTest\ClassTests.cpp" />
|
||||||
<ClCompile Include="..\..\..\SelfTest\ConditionTests.cpp" />
|
<ClCompile Include="..\..\..\SelfTest\ConditionTests.cpp" />
|
||||||
<ClCompile Include="..\..\..\SelfTest\ExceptionTests.cpp" />
|
<ClCompile Include="..\..\..\SelfTest\ExceptionTests.cpp" />
|
||||||
@ -110,86 +107,41 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\..\..\include\catch.hpp" />
|
<ClInclude Include="..\..\..\..\include\catch.hpp" />
|
||||||
|
<ClInclude Include="..\..\..\..\include\catch_objc.hpp" />
|
||||||
|
<ClInclude Include="..\..\..\..\include\catch_objc_main.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\catch_runner.hpp" />
|
<ClInclude Include="..\..\..\..\include\catch_runner.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_approx.hpp" />
|
<ClInclude Include="..\..\..\..\include\catch_with_main.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_assertionresult.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_assertionresult.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_capture.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_capture.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_commandline.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_commandline.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_common.h" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_common.h" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_compiler_capabilities.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_config.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_config.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_console_colour.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_console_colour_impl.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_context.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_context_impl.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_debugger.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_debugger.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_default_main.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_evaluate.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_evaluate.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_exception_translator_registry.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_exception_translator_registry.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_expressionresult_builder.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_expressionresult_builder.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_expression_decomposer.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_expression_lhs.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_generators.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_generators.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_generators_impl.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_generators_impl.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_impl.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_hub.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\include\internal\catch_hub_impl.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_capture.h" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_capture.h" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_config.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_exception.h" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_exception.h" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_generators.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_registry_hub.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_reporter.h" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_reporter.h" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_runner.h" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_runner.h" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_testcase.h" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_testcase.h" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_legacy_reporter_adapter.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_legacy_reporter_adapter.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_list.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_list.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_matchers.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_message.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_message.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_notimplemented_exception.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_notimplemented_exception.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_objc.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_objc_arc.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_option.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_platform.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_ptr.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_registry_hub.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_reporter_registrars.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_reporter_registrars.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_reporter_registry.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_reporter_registry.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_result_type.h" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_result_type.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\include\internal\catch_resultinfo.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_runner_impl.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_runner_impl.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_section.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_section.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_self_test.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_sfinae.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_stream.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_stream.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_streambuf.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_tags.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_test_case_info.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_test_case_info.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_test_case_info.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_test_case_registry_impl.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_test_case_registry_impl.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_test_case_tracker.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_test_registry.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_test_registry.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_test_spec.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_text.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_text.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_timer.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_timer.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_tostring.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_totals.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_version.h" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_version.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_vs_managed_impl.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_vs_native_impl.hpp" />
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_xmlwriter.hpp" />
|
<ClInclude Include="..\..\..\..\include\internal\catch_xmlwriter.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\reporters\catch_reporter_console.hpp" />
|
<ClInclude Include="..\..\..\..\include\reporters\catch_reporter_basic.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\reporters\catch_reporter_junit.hpp" />
|
<ClInclude Include="..\..\..\..\include\reporters\catch_reporter_junit.hpp" />
|
||||||
<ClInclude Include="..\..\..\..\include\reporters\catch_reporter_xml.hpp" />
|
<ClInclude Include="..\..\..\..\include\reporters\catch_reporter_xml.hpp" />
|
||||||
<ClInclude Include="..\..\..\selftest\catch_self_test.hpp" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="ReadMe.txt" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
@ -7,9 +7,6 @@
|
|||||||
<ClCompile Include="..\..\..\SelfTest\BDDTests.cpp">
|
<ClCompile Include="..\..\..\SelfTest\BDDTests.cpp">
|
||||||
<Filter>Sources</Filter>
|
<Filter>Sources</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\..\SelfTest\catch_self_test.cpp">
|
|
||||||
<Filter>Sources</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\..\SelfTest\ClassTests.cpp">
|
<ClCompile Include="..\..\..\SelfTest\ClassTests.cpp">
|
||||||
<Filter>Sources</Filter>
|
<Filter>Sources</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@ -28,12 +25,6 @@
|
|||||||
<ClCompile Include="..\..\..\SelfTest\GeneratorTests.cpp">
|
<ClCompile Include="..\..\..\SelfTest\GeneratorTests.cpp">
|
||||||
<Filter>Sources</Filter>
|
<Filter>Sources</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\..\SelfTest\MessageInstantiationTests1.cpp">
|
|
||||||
<Filter>Sources</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\..\SelfTest\MessageInstantiationTests2.cpp">
|
|
||||||
<Filter>Sources</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\..\SelfTest\MessageTests.cpp">
|
<ClCompile Include="..\..\..\SelfTest\MessageTests.cpp">
|
||||||
<Filter>Sources</Filter>
|
<Filter>Sources</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@ -51,24 +42,9 @@
|
|||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_self_test.hpp">
|
|
||||||
<Filter>Sources</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\catch.hpp">
|
<ClInclude Include="..\..\..\..\include\catch.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_impl.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_approx.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_assertionresult.h">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_assertionresult.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_capture.hpp">
|
<ClInclude Include="..\..\..\..\include\internal\catch_capture.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@ -78,48 +54,18 @@
|
|||||||
<ClInclude Include="..\..\..\..\include\internal\catch_common.h">
|
<ClInclude Include="..\..\..\..\include\internal\catch_common.h">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_compiler_capabilities.h">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_config.hpp">
|
<ClInclude Include="..\..\..\..\include\internal\catch_config.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_console_colour.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_console_colour_impl.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_context.h">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_context_impl.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_debugger.hpp">
|
<ClInclude Include="..\..\..\..\include\internal\catch_debugger.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_default_main.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_evaluate.hpp">
|
<ClInclude Include="..\..\..\..\include\internal\catch_evaluate.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_exception_translator_registry.hpp">
|
<ClInclude Include="..\..\..\..\include\internal\catch_exception_translator_registry.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_expression_decomposer.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_expression_lhs.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_expressionresult_builder.h">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_expressionresult_builder.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_generators.hpp">
|
<ClInclude Include="..\..\..\..\include\internal\catch_generators.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@ -132,18 +78,9 @@
|
|||||||
<ClInclude Include="..\..\..\..\include\internal\catch_test_case_registry_impl.hpp">
|
<ClInclude Include="..\..\..\..\include\internal\catch_test_case_registry_impl.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_config.h">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_exception.h">
|
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_exception.h">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_generators.h">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_registry_hub.h">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_reporter.h">
|
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_reporter.h">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@ -153,51 +90,9 @@
|
|||||||
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_testcase.h">
|
<ClInclude Include="..\..\..\..\include\internal\catch_interfaces_testcase.h">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_legacy_reporter_adapter.h">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_legacy_reporter_adapter.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_list.hpp">
|
<ClInclude Include="..\..\..\..\include\internal\catch_list.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_matchers.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_message.h">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_message.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_notimplemented_exception.h">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_notimplemented_exception.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_objc.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_objc_arc.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_option.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_platform.h">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_ptr.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_registry_hub.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\reporters\catch_reporter_console.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\reporters\catch_reporter_junit.hpp">
|
<ClInclude Include="..\..\..\..\include\reporters\catch_reporter_junit.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@ -222,72 +117,39 @@
|
|||||||
<ClInclude Include="..\..\..\..\include\internal\catch_section.hpp">
|
<ClInclude Include="..\..\..\..\include\internal\catch_section.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\selftest\catch_self_test.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_sfinae.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_stream.hpp">
|
<ClInclude Include="..\..\..\..\include\internal\catch_stream.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_streambuf.h">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_tags.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_test_case_info.h">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_test_case_info.hpp">
|
<ClInclude Include="..\..\..\..\include\internal\catch_test_case_info.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_test_case_tracker.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_xmlwriter.hpp">
|
<ClInclude Include="..\..\..\..\include\internal\catch_xmlwriter.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_test_registry.hpp">
|
<ClInclude Include="..\..\..\..\include\internal\catch_test_registry.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_test_spec.h">
|
<ClInclude Include="..\..\..\..\include\internal\catch_hub.h">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_text.h">
|
<ClInclude Include="..\..\..\..\include\catch_with_main.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_text.hpp">
|
<ClInclude Include="..\..\..\..\include\internal\catch_hub_impl.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_timer.h">
|
<ClInclude Include="..\..\..\..\include\catch_objc.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_timer.hpp">
|
<ClInclude Include="..\..\..\..\include\catch_objc_main.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_tostring.hpp">
|
<ClInclude Include="..\..\..\..\include\reporters\catch_reporter_basic.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_totals.hpp">
|
<ClInclude Include="..\..\..\..\include\internal\catch_resultinfo.hpp">
|
||||||
<Filter>Headers</Filter>
|
<Filter>Headers</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_version.h">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_version.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_vs_managed_impl.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\..\..\include\internal\catch_vs_native_impl.hpp">
|
|
||||||
<Filter>Headers</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="ReadMe.txt" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="Headers">
|
<Filter Include="Headers">
|
||||||
|
Loading…
Reference in New Issue
Block a user