mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-11 07:55:39 +02:00
Compare commits
20 Commits
v1.8.1
...
v2.0.0-dev
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f4ba8aaf19 | ||
![]() |
25899ea20e | ||
![]() |
36cee598cf | ||
![]() |
506b915f7f | ||
![]() |
5cab3cc1b8 | ||
![]() |
d2642325ae | ||
![]() |
8fa41d96c7 | ||
![]() |
693355cc75 | ||
![]() |
5e0db60443 | ||
![]() |
ce547c1799 | ||
![]() |
28aece6a7a | ||
![]() |
bd8688cded | ||
![]() |
c70170e904 | ||
![]() |
6789dfa2ba | ||
![]() |
fdc8a2b2df | ||
![]() |
eea9357284 | ||
![]() |
73968f29a5 | ||
![]() |
b77b45a390 | ||
![]() |
2ebe11660c | ||
![]() |
e55273db19 |
@@ -1,6 +1,6 @@
|
||||

|
||||
|
||||
*v1.3.0-develop.3*
|
||||
*v2.0.0-develop.2*
|
||||
|
||||
Build status (on Travis CI) [](https://travis-ci.org/philsquared/Catch)
|
||||
|
||||
|
@@ -29,11 +29,9 @@
|
||||
#endif
|
||||
|
||||
#include "internal/catch_notimplemented_exception.h"
|
||||
#include "internal/catch_context.h"
|
||||
#include "internal/catch_test_registry.hpp"
|
||||
#include "internal/catch_capture.hpp"
|
||||
#include "internal/catch_section.h"
|
||||
#include "internal/catch_generators.hpp"
|
||||
#include "internal/catch_interfaces_exception.h"
|
||||
#include "internal/catch_approx.hpp"
|
||||
#include "internal/catch_matchers.hpp"
|
||||
@@ -43,7 +41,6 @@
|
||||
// These files are included here so the single_include script doesn't put them
|
||||
// in the conditionally compiled sections
|
||||
#include "internal/catch_test_case_info.h"
|
||||
#include "internal/catch_interfaces_runner.h"
|
||||
|
||||
#ifdef __OBJC__
|
||||
#include "internal/catch_objc.hpp"
|
||||
@@ -99,6 +96,7 @@
|
||||
#define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
|
||||
#define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
|
||||
#define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
|
||||
#define CATCH_REGISTER_TEST_CASE( ... ) INTERNAL_CATCH_REGISTER_TESTCASE( __VA_ARGS__ )
|
||||
#define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
|
||||
#define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL", __VA_ARGS__ )
|
||||
#define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED", __VA_ARGS__ )
|
||||
@@ -106,6 +104,7 @@
|
||||
#define CATCH_TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description )
|
||||
#define CATCH_TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description )
|
||||
#define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description )
|
||||
#define CATCH_REGISTER_TEST_CASE( function, name, description ) INTERNAL_CATCH_REGISTER_TESTCASE( function, name, description )
|
||||
#define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description )
|
||||
#define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL", msg )
|
||||
#define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED", msg )
|
||||
@@ -115,8 +114,6 @@
|
||||
#define CATCH_REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType )
|
||||
#define CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType )
|
||||
|
||||
#define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr )
|
||||
|
||||
// "BDD-style" convenience wrappers
|
||||
#ifdef CATCH_CONFIG_VARIADIC_MACROS
|
||||
#define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ )
|
||||
@@ -166,6 +163,7 @@
|
||||
#define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
|
||||
#define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
|
||||
#define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
|
||||
#define REGISTER_TEST_CASE( ... ) INTERNAL_CATCH_REGISTER_TESTCASE( __VA_ARGS__ )
|
||||
#define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
|
||||
#define FAIL( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL", __VA_ARGS__ )
|
||||
#define SUCCEED( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED", __VA_ARGS__ )
|
||||
@@ -173,6 +171,7 @@
|
||||
#define TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description )
|
||||
#define TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description )
|
||||
#define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description )
|
||||
#define REGISTER_TEST_CASE( method, name, description ) INTERNAL_CATCH_REGISTER_TESTCASE( method, name, description )
|
||||
#define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description )
|
||||
#define FAIL( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL", msg )
|
||||
#define SUCCEED( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED", msg )
|
||||
@@ -182,8 +181,6 @@
|
||||
#define REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType )
|
||||
#define REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType )
|
||||
|
||||
#define GENERATE( expr) INTERNAL_CATCH_GENERATE( expr )
|
||||
|
||||
#endif
|
||||
|
||||
#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature )
|
||||
|
@@ -74,7 +74,7 @@ namespace Catch {
|
||||
for( std::vector<TestCase>::const_iterator it = allTestCases.begin(), itEnd = allTestCases.end();
|
||||
it != itEnd;
|
||||
++it ) {
|
||||
if( !context.aborting() && matchTest( *it, testSpec, *iconfig ) )
|
||||
if( !context.isAborting() && matchTest( *it, testSpec, *iconfig ) )
|
||||
totals += context.runTest( *it );
|
||||
else
|
||||
reporter->skipTest( *it );
|
||||
|
@@ -10,13 +10,14 @@
|
||||
|
||||
#include "catch_result_builder.h"
|
||||
#include "catch_message.h"
|
||||
#include "catch_interfaces_capture.h"
|
||||
#include "catch_debugger.h"
|
||||
#include "catch_common.h"
|
||||
#include "catch_tostring.h"
|
||||
#include "catch_interfaces_runner.h"
|
||||
#include "catch_compiler_capabilities.h"
|
||||
|
||||
namespace Catch {
|
||||
AssertionResult const* getLastResult();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// In the event of a failure works out if the debugger needs to be invoked
|
||||
@@ -44,12 +45,12 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_IF( expr, resultDisposition, macroName ) \
|
||||
INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \
|
||||
if( Catch::getResultCapture().getLastResult()->succeeded() )
|
||||
if( Catch::getLastResult()->succeeded() )
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_ELSE( expr, resultDisposition, macroName ) \
|
||||
INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \
|
||||
if( !Catch::getResultCapture().getLastResult()->succeeded() )
|
||||
if( !Catch::getLastResult()->succeeded() )
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_NO_THROW( expr, resultDisposition, macroName ) \
|
||||
@@ -129,7 +130,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CHECK_THAT( arg, matcher, resultDisposition, macroName ) \
|
||||
do { \
|
||||
Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #arg " " #matcher, resultDisposition ); \
|
||||
Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #arg ", " #matcher, resultDisposition ); \
|
||||
try { \
|
||||
std::string matcherAsString = (matcher).toString(); \
|
||||
__catchResult \
|
||||
|
@@ -10,7 +10,11 @@
|
||||
|
||||
#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line
|
||||
#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
|
||||
#define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
|
||||
#ifdef CATCH_CONFIG_COUNTER
|
||||
# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ )
|
||||
#else
|
||||
# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
|
||||
#endif
|
||||
|
||||
#define INTERNAL_CATCH_STRINGIFY2( expr ) #expr
|
||||
#define INTERNAL_CATCH_STRINGIFY( expr ) INTERNAL_CATCH_STRINGIFY2( expr )
|
||||
|
@@ -87,7 +87,9 @@ namespace Catch {
|
||||
std::srand( config.rngSeed() );
|
||||
}
|
||||
unsigned int rngSeed() {
|
||||
return getCurrentContext().getConfig()->rngSeed();
|
||||
return getCurrentConfig()
|
||||
? getCurrentConfig()->rngSeed()
|
||||
: 0;
|
||||
}
|
||||
|
||||
std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) {
|
||||
|
@@ -23,7 +23,7 @@
|
||||
// CATCH_CONFIG_CPP11_OR_GREATER : Is C++11 supported?
|
||||
|
||||
// CATCH_CONFIG_VARIADIC_MACROS : are variadic macros supported?
|
||||
|
||||
// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported?
|
||||
// ****************
|
||||
// Note to maintainers: if new toggles are added please document them
|
||||
// in configuration.md, too
|
||||
@@ -111,6 +111,15 @@
|
||||
|
||||
#endif
|
||||
|
||||
// Use __COUNTER__ if the compiler supports it
|
||||
#if ( defined _MSC_VER && _MSC_VER >= 1300 ) || \
|
||||
( defined __GNUC__ && __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 ) || \
|
||||
( defined __clang__ && __clang_major__ >= 3 )
|
||||
|
||||
#define CATCH_INTERNAL_CONFIG_COUNTER
|
||||
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// C++ language feature support
|
||||
|
||||
@@ -185,6 +194,9 @@
|
||||
#if defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_CPP11)
|
||||
# define CATCH_CONFIG_CPP11_UNIQUE_PTR
|
||||
#endif
|
||||
#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER)
|
||||
# define CATCH_CONFIG_COUNTER
|
||||
#endif
|
||||
|
||||
|
||||
// noexcept support:
|
||||
|
@@ -9,7 +9,6 @@
|
||||
#define TWOBLUECUBES_CATCH_CONFIG_HPP_INCLUDED
|
||||
|
||||
#include "catch_test_spec_parser.hpp"
|
||||
#include "catch_context.h"
|
||||
#include "catch_interfaces_config.h"
|
||||
#include "catch_stream.h"
|
||||
|
||||
|
@@ -145,7 +145,7 @@ namespace {
|
||||
};
|
||||
|
||||
IColourImpl* platformColourInstance() {
|
||||
Ptr<IConfig const> config = getCurrentContext().getConfig();
|
||||
IConfig const* config = getCurrentConfig();
|
||||
return (config && config->forceColour()) || isatty(STDOUT_FILENO)
|
||||
? PosixColourImpl::instance()
|
||||
: NoColourImpl::instance();
|
||||
|
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Created by Phil on 31/12/2010.
|
||||
* Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED
|
||||
#define TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED
|
||||
|
||||
#include "catch_interfaces_generators.h"
|
||||
#include "catch_ptr.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
class TestCase;
|
||||
class Stream;
|
||||
struct IResultCapture;
|
||||
struct IRunner;
|
||||
struct IGeneratorsForTest;
|
||||
struct IConfig;
|
||||
|
||||
struct IContext
|
||||
{
|
||||
virtual ~IContext();
|
||||
|
||||
virtual IResultCapture* getResultCapture() = 0;
|
||||
virtual IRunner* getRunner() = 0;
|
||||
virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) = 0;
|
||||
virtual bool advanceGeneratorsForCurrentTest() = 0;
|
||||
virtual Ptr<IConfig const> getConfig() const = 0;
|
||||
};
|
||||
|
||||
struct IMutableContext : IContext
|
||||
{
|
||||
virtual ~IMutableContext();
|
||||
virtual void setResultCapture( IResultCapture* resultCapture ) = 0;
|
||||
virtual void setRunner( IRunner* runner ) = 0;
|
||||
virtual void setConfig( Ptr<IConfig const> const& config ) = 0;
|
||||
};
|
||||
|
||||
IContext& getCurrentContext();
|
||||
IMutableContext& getCurrentMutableContext();
|
||||
void cleanUpContext();
|
||||
Stream createStream( std::string const& streamName );
|
||||
|
||||
}
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED
|
@@ -1,104 +0,0 @@
|
||||
/*
|
||||
* Created by Phil on 31/12/2010.
|
||||
* Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef TWOBLUECUBES_CATCH_CONTEXT_IMPL_HPP_INCLUDED
|
||||
#define TWOBLUECUBES_CATCH_CONTEXT_IMPL_HPP_INCLUDED
|
||||
|
||||
#include "catch_run_context.hpp"
|
||||
|
||||
#include "catch_context.h"
|
||||
#include "catch_stream.hpp"
|
||||
|
||||
namespace Catch {
|
||||
|
||||
class Context : public IMutableContext {
|
||||
|
||||
Context() : m_config( CATCH_NULL ), m_runner( CATCH_NULL ), m_resultCapture( CATCH_NULL ) {}
|
||||
Context( Context const& );
|
||||
void operator=( Context const& );
|
||||
|
||||
public: // IContext
|
||||
virtual IResultCapture* getResultCapture() {
|
||||
return m_resultCapture;
|
||||
}
|
||||
virtual IRunner* getRunner() {
|
||||
return m_runner;
|
||||
}
|
||||
virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) {
|
||||
return getGeneratorsForCurrentTest()
|
||||
.getGeneratorInfo( fileInfo, totalSize )
|
||||
.getCurrentIndex();
|
||||
}
|
||||
virtual bool advanceGeneratorsForCurrentTest() {
|
||||
IGeneratorsForTest* generators = findGeneratorsForCurrentTest();
|
||||
return generators && generators->moveNext();
|
||||
}
|
||||
|
||||
virtual Ptr<IConfig const> getConfig() const {
|
||||
return m_config;
|
||||
}
|
||||
|
||||
public: // IMutableContext
|
||||
virtual void setResultCapture( IResultCapture* resultCapture ) {
|
||||
m_resultCapture = resultCapture;
|
||||
}
|
||||
virtual void setRunner( IRunner* runner ) {
|
||||
m_runner = runner;
|
||||
}
|
||||
virtual void setConfig( Ptr<IConfig const> const& config ) {
|
||||
m_config = config;
|
||||
}
|
||||
|
||||
friend IMutableContext& getCurrentMutableContext();
|
||||
|
||||
private:
|
||||
IGeneratorsForTest* findGeneratorsForCurrentTest() {
|
||||
std::string testName = getResultCapture()->getCurrentTestName();
|
||||
|
||||
std::map<std::string, IGeneratorsForTest*>::const_iterator it =
|
||||
m_generatorsByTestName.find( testName );
|
||||
return it != m_generatorsByTestName.end()
|
||||
? it->second
|
||||
: CATCH_NULL;
|
||||
}
|
||||
|
||||
IGeneratorsForTest& getGeneratorsForCurrentTest() {
|
||||
IGeneratorsForTest* generators = findGeneratorsForCurrentTest();
|
||||
if( !generators ) {
|
||||
std::string testName = getResultCapture()->getCurrentTestName();
|
||||
generators = createGeneratorsForTest();
|
||||
m_generatorsByTestName.insert( std::make_pair( testName, generators ) );
|
||||
}
|
||||
return *generators;
|
||||
}
|
||||
|
||||
private:
|
||||
Ptr<IConfig const> m_config;
|
||||
IRunner* m_runner;
|
||||
IResultCapture* m_resultCapture;
|
||||
std::map<std::string, IGeneratorsForTest*> m_generatorsByTestName;
|
||||
};
|
||||
|
||||
namespace {
|
||||
Context* currentContext = CATCH_NULL;
|
||||
}
|
||||
IMutableContext& getCurrentMutableContext() {
|
||||
if( !currentContext )
|
||||
currentContext = new Context();
|
||||
return *currentContext;
|
||||
}
|
||||
IContext& getCurrentContext() {
|
||||
return getCurrentMutableContext();
|
||||
}
|
||||
|
||||
void cleanUpContext() {
|
||||
delete currentContext;
|
||||
currentContext = CATCH_NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_CONTEXT_IMPL_HPP_INCLUDED
|
@@ -11,7 +11,7 @@
|
||||
#ifndef __OBJC__
|
||||
|
||||
// Standard C/C++ main entry point
|
||||
int main (int argc, char * const argv[]) {
|
||||
int main (int argc, char * argv[]) {
|
||||
return Catch::Session().run( argc, argv );
|
||||
}
|
||||
|
||||
|
@@ -14,9 +14,8 @@ namespace Catch {
|
||||
|
||||
// Report the error condition then exit the process
|
||||
inline void fatal( std::string const& message, int exitCode ) {
|
||||
IContext& context = Catch::getCurrentContext();
|
||||
IResultCapture* resultCapture = context.getResultCapture();
|
||||
resultCapture->handleFatalErrorCondition( message );
|
||||
IRunContext& runContext = getCurrentRunContext();
|
||||
runContext.handleFatalErrorCondition( message );
|
||||
|
||||
if( Catch::alwaysTrue() ) // avoids "no return" warnings
|
||||
exit( exitCode );
|
||||
|
@@ -1,190 +0,0 @@
|
||||
/*
|
||||
* Created by Phil on 27/01/2011.
|
||||
* Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED
|
||||
#define TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED
|
||||
|
||||
#include "catch_context.h"
|
||||
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
template<typename T>
|
||||
struct IGenerator {
|
||||
virtual ~IGenerator() {}
|
||||
virtual T getValue( std::size_t index ) const = 0;
|
||||
virtual std::size_t size () const = 0;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class BetweenGenerator : public IGenerator<T> {
|
||||
public:
|
||||
BetweenGenerator( T from, T to ) : m_from( from ), m_to( to ){}
|
||||
|
||||
virtual T getValue( std::size_t index ) const {
|
||||
return m_from+static_cast<int>( index );
|
||||
}
|
||||
|
||||
virtual std::size_t size() const {
|
||||
return static_cast<std::size_t>( 1+m_to-m_from );
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
T m_from;
|
||||
T m_to;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class ValuesGenerator : public IGenerator<T> {
|
||||
public:
|
||||
ValuesGenerator(){}
|
||||
|
||||
void add( T value ) {
|
||||
m_values.push_back( value );
|
||||
}
|
||||
|
||||
virtual T getValue( std::size_t index ) const {
|
||||
return m_values[index];
|
||||
}
|
||||
|
||||
virtual std::size_t size() const {
|
||||
return m_values.size();
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<T> m_values;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class CompositeGenerator {
|
||||
public:
|
||||
CompositeGenerator() : m_totalSize( 0 ) {}
|
||||
|
||||
// *** Move semantics, similar to auto_ptr ***
|
||||
CompositeGenerator( CompositeGenerator& other )
|
||||
: m_fileInfo( other.m_fileInfo ),
|
||||
m_totalSize( 0 )
|
||||
{
|
||||
move( other );
|
||||
}
|
||||
|
||||
CompositeGenerator& setFileInfo( const char* fileInfo ) {
|
||||
m_fileInfo = fileInfo;
|
||||
return *this;
|
||||
}
|
||||
|
||||
~CompositeGenerator() {
|
||||
deleteAll( m_composed );
|
||||
}
|
||||
|
||||
operator T () const {
|
||||
size_t overallIndex = getCurrentContext().getGeneratorIndex( m_fileInfo, m_totalSize );
|
||||
|
||||
typename std::vector<const IGenerator<T>*>::const_iterator it = m_composed.begin();
|
||||
typename std::vector<const IGenerator<T>*>::const_iterator itEnd = m_composed.end();
|
||||
for( size_t index = 0; it != itEnd; ++it )
|
||||
{
|
||||
const IGenerator<T>* generator = *it;
|
||||
if( overallIndex >= index && overallIndex < index + generator->size() )
|
||||
{
|
||||
return generator->getValue( overallIndex-index );
|
||||
}
|
||||
index += generator->size();
|
||||
}
|
||||
CATCH_INTERNAL_ERROR( "Indexed past end of generated range" );
|
||||
return T(); // Suppress spurious "not all control paths return a value" warning in Visual Studio - if you know how to fix this please do so
|
||||
}
|
||||
|
||||
void add( const IGenerator<T>* generator ) {
|
||||
m_totalSize += generator->size();
|
||||
m_composed.push_back( generator );
|
||||
}
|
||||
|
||||
CompositeGenerator& then( CompositeGenerator& other ) {
|
||||
move( other );
|
||||
return *this;
|
||||
}
|
||||
|
||||
CompositeGenerator& then( T value ) {
|
||||
ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
|
||||
valuesGen->add( value );
|
||||
add( valuesGen );
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void move( CompositeGenerator& other ) {
|
||||
std::copy( other.m_composed.begin(), other.m_composed.end(), std::back_inserter( m_composed ) );
|
||||
m_totalSize += other.m_totalSize;
|
||||
other.m_composed.clear();
|
||||
}
|
||||
|
||||
std::vector<const IGenerator<T>*> m_composed;
|
||||
std::string m_fileInfo;
|
||||
size_t m_totalSize;
|
||||
};
|
||||
|
||||
namespace Generators
|
||||
{
|
||||
template<typename T>
|
||||
CompositeGenerator<T> between( T from, T to ) {
|
||||
CompositeGenerator<T> generators;
|
||||
generators.add( new BetweenGenerator<T>( from, to ) );
|
||||
return generators;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
CompositeGenerator<T> values( T val1, T val2 ) {
|
||||
CompositeGenerator<T> generators;
|
||||
ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
|
||||
valuesGen->add( val1 );
|
||||
valuesGen->add( val2 );
|
||||
generators.add( valuesGen );
|
||||
return generators;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
CompositeGenerator<T> values( T val1, T val2, T val3 ){
|
||||
CompositeGenerator<T> generators;
|
||||
ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
|
||||
valuesGen->add( val1 );
|
||||
valuesGen->add( val2 );
|
||||
valuesGen->add( val3 );
|
||||
generators.add( valuesGen );
|
||||
return generators;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
CompositeGenerator<T> values( T val1, T val2, T val3, T val4 ) {
|
||||
CompositeGenerator<T> generators;
|
||||
ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
|
||||
valuesGen->add( val1 );
|
||||
valuesGen->add( val2 );
|
||||
valuesGen->add( val3 );
|
||||
valuesGen->add( val4 );
|
||||
generators.add( valuesGen );
|
||||
return generators;
|
||||
}
|
||||
|
||||
} // end namespace Generators
|
||||
|
||||
using namespace Generators;
|
||||
|
||||
} // end namespace Catch
|
||||
|
||||
#define INTERNAL_CATCH_LINESTR2( line ) #line
|
||||
#define INTERNAL_CATCH_LINESTR( line ) INTERNAL_CATCH_LINESTR2( line )
|
||||
|
||||
#define INTERNAL_CATCH_GENERATE( expr ) expr.setFileInfo( __FILE__ "(" INTERNAL_CATCH_LINESTR( __LINE__ ) ")" )
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED
|
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* Created by Phil on 28/01/2011.
|
||||
* Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef TWOBLUECUBES_CATCH_GENERATORS_IMPL_HPP_INCLUDED
|
||||
#define TWOBLUECUBES_CATCH_GENERATORS_IMPL_HPP_INCLUDED
|
||||
|
||||
#include "catch_interfaces_generators.h"
|
||||
|
||||
#include "catch_common.h"
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
struct GeneratorInfo : IGeneratorInfo {
|
||||
|
||||
GeneratorInfo( std::size_t size )
|
||||
: m_size( size ),
|
||||
m_currentIndex( 0 )
|
||||
{}
|
||||
|
||||
bool moveNext() {
|
||||
if( ++m_currentIndex == m_size ) {
|
||||
m_currentIndex = 0;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
std::size_t getCurrentIndex() const {
|
||||
return m_currentIndex;
|
||||
}
|
||||
|
||||
std::size_t m_size;
|
||||
std::size_t m_currentIndex;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class GeneratorsForTest : public IGeneratorsForTest {
|
||||
|
||||
public:
|
||||
~GeneratorsForTest() {
|
||||
deleteAll( m_generatorsInOrder );
|
||||
}
|
||||
|
||||
IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) {
|
||||
std::map<std::string, IGeneratorInfo*>::const_iterator it = m_generatorsByName.find( fileInfo );
|
||||
if( it == m_generatorsByName.end() ) {
|
||||
IGeneratorInfo* info = new GeneratorInfo( size );
|
||||
m_generatorsByName.insert( std::make_pair( fileInfo, info ) );
|
||||
m_generatorsInOrder.push_back( info );
|
||||
return *info;
|
||||
}
|
||||
return *it->second;
|
||||
}
|
||||
|
||||
bool moveNext() {
|
||||
std::vector<IGeneratorInfo*>::const_iterator it = m_generatorsInOrder.begin();
|
||||
std::vector<IGeneratorInfo*>::const_iterator itEnd = m_generatorsInOrder.end();
|
||||
for(; it != itEnd; ++it ) {
|
||||
if( (*it)->moveNext() )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
std::map<std::string, IGeneratorInfo*> m_generatorsByName;
|
||||
std::vector<IGeneratorInfo*> m_generatorsInOrder;
|
||||
};
|
||||
|
||||
IGeneratorsForTest* createGeneratorsForTest()
|
||||
{
|
||||
return new GeneratorsForTest();
|
||||
}
|
||||
|
||||
} // end namespace Catch
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_GENERATORS_IMPL_HPP_INCLUDED
|
@@ -19,9 +19,7 @@
|
||||
#include "../catch_session.hpp"
|
||||
#include "catch_registry_hub.hpp"
|
||||
#include "catch_notimplemented_exception.hpp"
|
||||
#include "catch_context_impl.hpp"
|
||||
#include "catch_console_colour_impl.hpp"
|
||||
#include "catch_generators_impl.hpp"
|
||||
#include "catch_assertionresult.hpp"
|
||||
#include "catch_test_case_info.hpp"
|
||||
#include "catch_test_spec.hpp"
|
||||
@@ -36,6 +34,7 @@
|
||||
#include "catch_result_builder.hpp"
|
||||
#include "catch_tag_alias_registry.hpp"
|
||||
#include "catch_test_case_tracker.hpp"
|
||||
#include "catch_stream.hpp"
|
||||
|
||||
#include "../reporters/catch_reporter_multi.hpp"
|
||||
#include "../reporters/catch_reporter_xml.hpp"
|
||||
@@ -53,8 +52,7 @@ namespace Catch {
|
||||
CoutStream::~CoutStream() CATCH_NOEXCEPT {}
|
||||
DebugOutStream::~DebugOutStream() CATCH_NOEXCEPT {}
|
||||
StreamBufBase::~StreamBufBase() CATCH_NOEXCEPT {}
|
||||
IContext::~IContext() {}
|
||||
IResultCapture::~IResultCapture() {}
|
||||
IRunContext::~IRunContext() {}
|
||||
ITestCase::~ITestCase() {}
|
||||
ITestCaseRegistry::~ITestCaseRegistry() {}
|
||||
IRegistryHub::~IRegistryHub() {}
|
||||
@@ -76,15 +74,11 @@ namespace Catch {
|
||||
StreamingReporterBase::~StreamingReporterBase() {}
|
||||
ConsoleReporter::~ConsoleReporter() {}
|
||||
CompactReporter::~CompactReporter() {}
|
||||
IRunner::~IRunner() {}
|
||||
IMutableContext::~IMutableContext() {}
|
||||
IConfig::~IConfig() {}
|
||||
XmlReporter::~XmlReporter() {}
|
||||
JunitReporter::~JunitReporter() {}
|
||||
TestRegistry::~TestRegistry() {}
|
||||
FreeFunctionTestCase::~FreeFunctionTestCase() {}
|
||||
IGeneratorInfo::~IGeneratorInfo() {}
|
||||
IGeneratorsForTest::~IGeneratorsForTest() {}
|
||||
WildcardPattern::~WildcardPattern() {}
|
||||
TestSpec::Pattern::~Pattern() {}
|
||||
TestSpec::NamePattern::~NamePattern() {}
|
||||
|
@@ -16,32 +16,42 @@ namespace Catch {
|
||||
|
||||
class TestCase;
|
||||
class AssertionResult;
|
||||
class ScopedMessageBuilder;
|
||||
|
||||
struct AssertionInfo;
|
||||
struct SectionInfo;
|
||||
struct SectionEndInfo;
|
||||
struct MessageInfo;
|
||||
class ScopedMessageBuilder;
|
||||
struct Counts;
|
||||
struct IConfig;
|
||||
|
||||
struct IResultCapture {
|
||||
struct IRunContext {
|
||||
|
||||
virtual ~IResultCapture();
|
||||
virtual ~IRunContext();
|
||||
|
||||
virtual void assertionEnded( AssertionResult const& result ) = 0;
|
||||
|
||||
virtual bool sectionStarted( SectionInfo const& sectionInfo,
|
||||
Counts& assertions ) = 0;
|
||||
virtual void sectionEnded( SectionEndInfo const& endInfo ) = 0;
|
||||
virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) = 0;
|
||||
|
||||
virtual void pushScopedMessage( MessageInfo const& message ) = 0;
|
||||
virtual void popScopedMessage( MessageInfo const& message ) = 0;
|
||||
|
||||
virtual std::string getCurrentTestName() const = 0;
|
||||
virtual const AssertionResult* getLastResult() const = 0;
|
||||
|
||||
virtual void handleFatalErrorCondition( std::string const& message ) = 0;
|
||||
|
||||
virtual std::string getCurrentTestName() const = 0;
|
||||
virtual AssertionResult const* getLastResult() const = 0;
|
||||
virtual bool isAborting() const = 0;
|
||||
|
||||
virtual IConfig const& config() const = 0;
|
||||
};
|
||||
|
||||
IResultCapture& getResultCapture();
|
||||
IRunContext* tryGetCurrentRunContext();
|
||||
IRunContext& getCurrentRunContext();
|
||||
|
||||
IConfig const* getCurrentConfig();
|
||||
}
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
|
||||
|
@@ -66,9 +66,11 @@ namespace Catch {
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) \
|
||||
static std::string INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator )( signature ); \
|
||||
namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ) ); }\
|
||||
static std::string INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator )( signature )
|
||||
#define INTERNAL_CATCH_TRANSLATE_EXCEPTION2( translatorName, signature ) \
|
||||
static std::string translatorName( signature ); \
|
||||
namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &translatorName ); }\
|
||||
static std::string translatorName( signature )
|
||||
|
||||
#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION2( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature )
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED
|
||||
|
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Created by Phil on 7/8/2012.
|
||||
* Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef TWOBLUECUBES_CATCH_INTERFACES_GENERATORS_H_INCLUDED
|
||||
#define TWOBLUECUBES_CATCH_INTERFACES_GENERATORS_H_INCLUDED
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
struct IGeneratorInfo {
|
||||
virtual ~IGeneratorInfo();
|
||||
virtual bool moveNext() = 0;
|
||||
virtual std::size_t getCurrentIndex() const = 0;
|
||||
};
|
||||
|
||||
struct IGeneratorsForTest {
|
||||
virtual ~IGeneratorsForTest();
|
||||
|
||||
virtual IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) = 0;
|
||||
virtual bool moveNext() = 0;
|
||||
};
|
||||
|
||||
IGeneratorsForTest* createGeneratorsForTest();
|
||||
|
||||
} // end namespace Catch
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_INTERFACES_GENERATORS_H_INCLUDED
|
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
* Created by Phil on 07/01/2011.
|
||||
* Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef TWOBLUECUBES_CATCH_INTERFACES_RUNNER_H_INCLUDED
|
||||
#define TWOBLUECUBES_CATCH_INTERFACES_RUNNER_H_INCLUDED
|
||||
|
||||
namespace Catch {
|
||||
class TestCase;
|
||||
|
||||
struct IRunner {
|
||||
virtual ~IRunner();
|
||||
virtual bool aborting() const = 0;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_INTERFACES_RUNNER_H_INCLUDED
|
@@ -13,6 +13,8 @@
|
||||
#include "catch_common.h"
|
||||
|
||||
namespace Catch {
|
||||
|
||||
struct IRunContext;
|
||||
|
||||
struct MessageInfo {
|
||||
MessageInfo( std::string const& _macroName,
|
||||
@@ -58,6 +60,7 @@ namespace Catch {
|
||||
ScopedMessage( ScopedMessage const& other );
|
||||
~ScopedMessage();
|
||||
|
||||
IRunContext& m_runContext;
|
||||
MessageInfo m_info;
|
||||
};
|
||||
|
||||
|
@@ -28,17 +28,19 @@ namespace Catch {
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ScopedMessage::ScopedMessage( MessageBuilder const& builder )
|
||||
: m_info( builder.m_info )
|
||||
: m_info( builder.m_info ),
|
||||
m_runContext( getCurrentRunContext() )
|
||||
{
|
||||
m_info.message = builder.m_stream.str();
|
||||
getResultCapture().pushScopedMessage( m_info );
|
||||
m_runContext.pushScopedMessage( m_info );
|
||||
}
|
||||
ScopedMessage::ScopedMessage( ScopedMessage const& other )
|
||||
: m_info( other.m_info )
|
||||
: m_info( other.m_info ),
|
||||
m_runContext( other.m_runContext )
|
||||
{}
|
||||
|
||||
ScopedMessage::~ScopedMessage() {
|
||||
getResultCapture().popScopedMessage( m_info );
|
||||
m_runContext.popScopedMessage( m_info );
|
||||
}
|
||||
|
||||
|
||||
|
@@ -74,7 +74,6 @@ namespace Catch {
|
||||
void cleanUp() {
|
||||
delete getTheRegistryHub();
|
||||
getTheRegistryHub() = CATCH_NULL;
|
||||
cleanUpContext();
|
||||
}
|
||||
std::string translateActiveException() {
|
||||
return getRegistryHub().getExceptionTranslatorRegistry().translateActiveException();
|
||||
|
@@ -15,6 +15,7 @@
|
||||
|
||||
namespace Catch {
|
||||
|
||||
struct IRunContext;
|
||||
struct TestFailureException{};
|
||||
|
||||
template<typename T> class ExpressionLhs;
|
||||
@@ -77,6 +78,7 @@ namespace Catch {
|
||||
bool allowThrows() const;
|
||||
|
||||
private:
|
||||
IRunContext& m_runContext;
|
||||
AssertionInfo m_assertionInfo;
|
||||
AssertionResultData m_data;
|
||||
struct ExprComponents {
|
||||
|
@@ -9,9 +9,7 @@
|
||||
#define TWOBLUECUBES_CATCH_RESULT_BUILDER_HPP_INCLUDED
|
||||
|
||||
#include "catch_result_builder.h"
|
||||
#include "catch_context.h"
|
||||
#include "catch_interfaces_config.h"
|
||||
#include "catch_interfaces_runner.h"
|
||||
#include "catch_interfaces_capture.h"
|
||||
#include "catch_interfaces_registry_hub.h"
|
||||
#include "catch_wildcard_pattern.hpp"
|
||||
@@ -28,7 +26,8 @@ namespace Catch {
|
||||
char const* capturedExpression,
|
||||
ResultDisposition::Flags resultDisposition,
|
||||
char const* secondArg )
|
||||
: m_assertionInfo( macroName, lineInfo, capturedExpressionWithSecondArgument( capturedExpression, secondArg ), resultDisposition ),
|
||||
: m_runContext( getCurrentRunContext() ),
|
||||
m_assertionInfo( macroName, lineInfo, capturedExpressionWithSecondArgument( capturedExpression, secondArg ), resultDisposition ),
|
||||
m_shouldDebugBreak( false ),
|
||||
m_shouldThrow( false )
|
||||
{}
|
||||
@@ -98,12 +97,12 @@ namespace Catch {
|
||||
}
|
||||
void ResultBuilder::handleResult( AssertionResult const& result )
|
||||
{
|
||||
getResultCapture().assertionEnded( result );
|
||||
m_runContext.assertionEnded( result );
|
||||
|
||||
if( !result.isOk() ) {
|
||||
if( getCurrentContext().getConfig()->shouldDebugBreak() )
|
||||
if( m_runContext.config().shouldDebugBreak() )
|
||||
m_shouldDebugBreak = true;
|
||||
if( getCurrentContext().getRunner()->aborting() || (m_assertionInfo.resultDisposition & ResultDisposition::Normal) )
|
||||
if( m_runContext.isAborting() || (m_assertionInfo.resultDisposition & ResultDisposition::Normal) )
|
||||
m_shouldThrow = true;
|
||||
}
|
||||
}
|
||||
@@ -113,7 +112,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
bool ResultBuilder::shouldDebugBreak() const { return m_shouldDebugBreak; }
|
||||
bool ResultBuilder::allowThrows() const { return getCurrentContext().getConfig()->allowThrows(); }
|
||||
bool ResultBuilder::allowThrows() const { return m_runContext.config().allowThrows(); }
|
||||
|
||||
AssertionResult ResultBuilder::build() const
|
||||
{
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#ifndef TWOBLUECUBES_CATCH_RUNNER_IMPL_HPP_INCLUDED
|
||||
#define TWOBLUECUBES_CATCH_RUNNER_IMPL_HPP_INCLUDED
|
||||
|
||||
#include "catch_interfaces_runner.h"
|
||||
#include "catch_interfaces_capture.h"
|
||||
#include "catch_interfaces_reporter.h"
|
||||
#include "catch_interfaces_exception.h"
|
||||
#include "catch_config.hpp"
|
||||
@@ -52,7 +52,34 @@ namespace Catch {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class RunContext : public IResultCapture, public IRunner {
|
||||
namespace {
|
||||
IRunContext* s_currentRunContext = CATCH_NULL;
|
||||
|
||||
void setCurrentRunContext( IRunContext* context ) {
|
||||
s_currentRunContext = context;
|
||||
}
|
||||
}
|
||||
|
||||
IRunContext* tryGetCurrentRunContext() {
|
||||
return s_currentRunContext;
|
||||
}
|
||||
IRunContext& getCurrentRunContext() {
|
||||
if( IRunContext* capture = tryGetCurrentRunContext() )
|
||||
return *capture;
|
||||
else
|
||||
throw std::logic_error( "No current test runner" );
|
||||
}
|
||||
IConfig const* getCurrentConfig() {
|
||||
if( IRunContext* capture = tryGetCurrentRunContext() )
|
||||
return &capture->config();
|
||||
else
|
||||
return CATCH_NULL;
|
||||
}
|
||||
AssertionResult const* getLastResult() {
|
||||
return getCurrentRunContext().getLastResult();
|
||||
}
|
||||
|
||||
class RunContext : public IRunContext {
|
||||
|
||||
RunContext( RunContext const& );
|
||||
void operator =( RunContext const& );
|
||||
@@ -61,81 +88,66 @@ namespace Catch {
|
||||
|
||||
explicit RunContext( Ptr<IConfig const> const& _config, Ptr<IStreamingReporter> const& reporter )
|
||||
: m_runInfo( _config->name() ),
|
||||
m_context( getCurrentMutableContext() ),
|
||||
m_activeTestCase( CATCH_NULL ),
|
||||
m_config( _config ),
|
||||
m_reporter( reporter )
|
||||
m_reporter( reporter ),
|
||||
m_activeTestCaseInfo( CATCH_NULL )
|
||||
{
|
||||
m_context.setRunner( this );
|
||||
m_context.setConfig( m_config );
|
||||
m_context.setResultCapture( this );
|
||||
setCurrentRunContext( this );
|
||||
m_reporter->testRunStarting( m_runInfo );
|
||||
}
|
||||
|
||||
virtual ~RunContext() {
|
||||
m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, aborting() ) );
|
||||
m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, isAborting() ) );
|
||||
setCurrentRunContext( CATCH_NULL );
|
||||
}
|
||||
|
||||
void testGroupStarting( std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount ) {
|
||||
m_reporter->testGroupStarting( GroupInfo( testSpec, groupIndex, groupsCount ) );
|
||||
}
|
||||
void testGroupEnded( std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount ) {
|
||||
m_reporter->testGroupEnded( TestGroupStats( GroupInfo( testSpec, groupIndex, groupsCount ), totals, aborting() ) );
|
||||
m_reporter->testGroupEnded( TestGroupStats( GroupInfo( testSpec, groupIndex, groupsCount ), totals, isAborting() ) );
|
||||
}
|
||||
|
||||
Totals runTest( TestCase const& testCase ) {
|
||||
m_activeTestCaseInfo = &testCase;
|
||||
|
||||
Totals prevTotals = m_totals;
|
||||
std::string redirectedCout, redirectedCerr;
|
||||
|
||||
std::string redirectedCout;
|
||||
std::string redirectedCerr;
|
||||
|
||||
TestCaseInfo testInfo = testCase.getTestCaseInfo();
|
||||
|
||||
m_reporter->testCaseStarting( testInfo );
|
||||
|
||||
m_activeTestCase = &testCase;
|
||||
m_reporter->testCaseStarting( testCase );
|
||||
|
||||
ITracker* m_testCaseTracker;
|
||||
|
||||
m_trackerContext.startRun();
|
||||
do {
|
||||
m_trackerContext.startRun();
|
||||
do {
|
||||
m_trackerContext.startCycle();
|
||||
m_testCaseTracker = &SectionTracker::acquire( m_trackerContext, testInfo.name );
|
||||
runCurrentTest( redirectedCout, redirectedCerr );
|
||||
}
|
||||
while( !m_testCaseTracker->isSuccessfullyCompleted() && !aborting() );
|
||||
m_trackerContext.startCycle();
|
||||
m_testCaseTracker = &SectionTracker::acquire( m_trackerContext, testCase.name );
|
||||
runTest( testCase, redirectedCout, redirectedCerr );
|
||||
}
|
||||
// !TBD: deprecated - this will be replaced by indexed trackers
|
||||
while( getCurrentContext().advanceGeneratorsForCurrentTest() && !aborting() );
|
||||
while( !m_testCaseTracker->isSuccessfullyCompleted() && !isAborting() );
|
||||
|
||||
|
||||
Totals deltaTotals = m_totals.delta( prevTotals );
|
||||
m_totals.testCases += deltaTotals.testCases;
|
||||
m_reporter->testCaseEnded( TestCaseStats( testInfo,
|
||||
m_reporter->testCaseEnded( TestCaseStats( testCase,
|
||||
deltaTotals,
|
||||
redirectedCout,
|
||||
redirectedCerr,
|
||||
aborting() ) );
|
||||
isAborting() ) );
|
||||
|
||||
m_activeTestCase = CATCH_NULL;
|
||||
m_testCaseTracker = CATCH_NULL;
|
||||
m_activeTestCaseInfo = CATCH_NULL;
|
||||
|
||||
return deltaTotals;
|
||||
}
|
||||
|
||||
Ptr<IConfig const> config() const {
|
||||
return m_config;
|
||||
}
|
||||
|
||||
private: // IResultCapture
|
||||
private: // IRunContext
|
||||
|
||||
|
||||
virtual void assertionEnded( AssertionResult const& result ) {
|
||||
if( result.getResultType() == ResultWas::Ok ) {
|
||||
virtual void assertionEnded( AssertionResult const& result ) CATCH_OVERRIDE {
|
||||
if( result.getResultType() == ResultWas::Ok )
|
||||
m_totals.assertions.passed++;
|
||||
}
|
||||
else if( !result.isOk() ) {
|
||||
else if( !result.isOk() )
|
||||
m_totals.assertions.failed++;
|
||||
}
|
||||
|
||||
if( m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) ) )
|
||||
m_messages.clear();
|
||||
@@ -145,10 +157,9 @@ namespace Catch {
|
||||
m_lastResult = result;
|
||||
}
|
||||
|
||||
virtual bool sectionStarted (
|
||||
SectionInfo const& sectionInfo,
|
||||
Counts& assertions
|
||||
)
|
||||
virtual bool sectionStarted
|
||||
( SectionInfo const& sectionInfo,
|
||||
Counts& assertions ) CATCH_OVERRIDE
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << sectionInfo.name << "@" << sectionInfo.lineInfo;
|
||||
@@ -178,7 +189,7 @@ namespace Catch {
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void sectionEnded( SectionEndInfo const& endInfo ) {
|
||||
virtual void sectionEnded( SectionEndInfo const& endInfo ) CATCH_OVERRIDE {
|
||||
Counts assertions = m_totals.assertions - endInfo.prevAssertions;
|
||||
bool missingAssertions = testForMissingAssertions( assertions );
|
||||
|
||||
@@ -191,7 +202,7 @@ namespace Catch {
|
||||
m_messages.clear();
|
||||
}
|
||||
|
||||
virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) {
|
||||
virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) CATCH_OVERRIDE {
|
||||
if( m_unfinishedSections.empty() )
|
||||
m_activeSections.back()->fail();
|
||||
else
|
||||
@@ -201,25 +212,28 @@ namespace Catch {
|
||||
m_unfinishedSections.push_back( endInfo );
|
||||
}
|
||||
|
||||
virtual void pushScopedMessage( MessageInfo const& message ) {
|
||||
virtual void pushScopedMessage( MessageInfo const& message ) CATCH_OVERRIDE {
|
||||
m_messages.push_back( message );
|
||||
}
|
||||
|
||||
virtual void popScopedMessage( MessageInfo const& message ) {
|
||||
virtual void popScopedMessage( MessageInfo const& message ) CATCH_OVERRIDE {
|
||||
m_messages.erase( std::remove( m_messages.begin(), m_messages.end(), message ), m_messages.end() );
|
||||
}
|
||||
|
||||
virtual std::string getCurrentTestName() const {
|
||||
return m_activeTestCase
|
||||
? m_activeTestCase->getTestCaseInfo().name
|
||||
virtual std::string getCurrentTestName() const CATCH_OVERRIDE {
|
||||
return m_activeTestCaseInfo
|
||||
? m_activeTestCaseInfo->name
|
||||
: "";
|
||||
}
|
||||
|
||||
virtual const AssertionResult* getLastResult() const {
|
||||
virtual AssertionResult const* getLastResult() const CATCH_OVERRIDE {
|
||||
return &m_lastResult;
|
||||
}
|
||||
virtual IConfig const& config() const CATCH_OVERRIDE {
|
||||
return *m_config;
|
||||
}
|
||||
|
||||
virtual void handleFatalErrorCondition( std::string const& message ) {
|
||||
virtual void handleFatalErrorCondition( std::string const& message ) CATCH_OVERRIDE {
|
||||
ResultBuilder resultBuilder = makeUnexpectedResultBuilder();
|
||||
resultBuilder.setResultType( ResultWas::FatalErrorCondition );
|
||||
resultBuilder << message;
|
||||
@@ -228,19 +242,19 @@ namespace Catch {
|
||||
handleUnfinishedSections();
|
||||
|
||||
// Recreate section for test case (as we will lose the one that was in scope)
|
||||
TestCaseInfo const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
|
||||
SectionInfo testCaseSection( testCaseInfo.lineInfo, testCaseInfo.name, testCaseInfo.description );
|
||||
SectionInfo testCaseSection
|
||||
( m_activeTestCaseInfo->lineInfo,
|
||||
m_activeTestCaseInfo->name,
|
||||
m_activeTestCaseInfo->description );
|
||||
|
||||
Counts assertions;
|
||||
assertions.failed = 1;
|
||||
SectionStats testCaseSectionStats( testCaseSection, assertions, 0, false );
|
||||
m_reporter->sectionEnded( testCaseSectionStats );
|
||||
|
||||
TestCaseInfo testInfo = m_activeTestCase->getTestCaseInfo();
|
||||
|
||||
Totals deltaTotals;
|
||||
deltaTotals.testCases.failed = 1;
|
||||
m_reporter->testCaseEnded( TestCaseStats( testInfo,
|
||||
m_reporter->testCaseEnded( TestCaseStats( *m_activeTestCaseInfo,
|
||||
deltaTotals,
|
||||
"",
|
||||
"",
|
||||
@@ -252,20 +266,19 @@ namespace Catch {
|
||||
|
||||
public:
|
||||
// !TBD We need to do this another way!
|
||||
bool aborting() const {
|
||||
bool isAborting() const {
|
||||
return m_totals.assertions.failed == static_cast<std::size_t>( m_config->abortAfter() );
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) {
|
||||
TestCaseInfo const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
|
||||
SectionInfo testCaseSection( testCaseInfo.lineInfo, testCaseInfo.name, testCaseInfo.description );
|
||||
void runTest( TestCase const& testCase, std::string& redirectedCout, std::string& redirectedCerr ) {
|
||||
SectionInfo testCaseSection( testCase.lineInfo, testCase.name, testCase.description );
|
||||
m_reporter->sectionStarting( testCaseSection );
|
||||
Counts prevAssertions = m_totals.assertions;
|
||||
double duration = 0;
|
||||
try {
|
||||
m_lastAssertionInfo = AssertionInfo( "TEST_CASE", testCaseInfo.lineInfo, "", ResultDisposition::Normal );
|
||||
m_lastAssertionInfo = AssertionInfo( "TEST_CASE", testCase.lineInfo, "", ResultDisposition::Normal );
|
||||
|
||||
seedRng( *m_config );
|
||||
|
||||
@@ -274,10 +287,10 @@ namespace Catch {
|
||||
if( m_reporter->getPreferences().shouldRedirectStdOut ) {
|
||||
StreamRedirect coutRedir( Catch::cout(), redirectedCout );
|
||||
StreamRedirect cerrRedir( Catch::cerr(), redirectedCerr );
|
||||
invokeActiveTestCase();
|
||||
invokeTestCase( testCase );
|
||||
}
|
||||
else {
|
||||
invokeActiveTestCase();
|
||||
invokeTestCase( testCase );
|
||||
}
|
||||
duration = timer.getElapsedSeconds();
|
||||
}
|
||||
@@ -287,14 +300,15 @@ namespace Catch {
|
||||
catch(...) {
|
||||
makeUnexpectedResultBuilder().useActiveException();
|
||||
}
|
||||
m_testCaseTracker->close();
|
||||
m_trackerContext.currentTracker().close();
|
||||
|
||||
handleUnfinishedSections();
|
||||
m_messages.clear();
|
||||
|
||||
Counts assertions = m_totals.assertions - prevAssertions;
|
||||
bool missingAssertions = testForMissingAssertions( assertions );
|
||||
|
||||
if( testCaseInfo.okToFail() ) {
|
||||
if( testCase.okToFail() ) {
|
||||
std::swap( assertions.failedButOk, assertions.failed );
|
||||
m_totals.assertions.failed -= assertions.failedButOk;
|
||||
m_totals.assertions.failedButOk += assertions.failedButOk;
|
||||
@@ -304,10 +318,9 @@ namespace Catch {
|
||||
m_reporter->sectionEnded( testCaseSectionStats );
|
||||
}
|
||||
|
||||
void invokeActiveTestCase() {
|
||||
static void invokeTestCase( TestCase const& testCase ) {
|
||||
FatalConditionHandler fatalConditionHandler; // Handle signals
|
||||
m_activeTestCase->invoke();
|
||||
fatalConditionHandler.reset();
|
||||
testCase.invoke();
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -331,29 +344,21 @@ namespace Catch {
|
||||
}
|
||||
|
||||
TestRunInfo m_runInfo;
|
||||
IMutableContext& m_context;
|
||||
TestCase const* m_activeTestCase;
|
||||
ITracker* m_testCaseTracker;
|
||||
ITracker* m_currentSectionTracker;
|
||||
AssertionResult m_lastResult;
|
||||
|
||||
Ptr<IConfig const> m_config;
|
||||
Totals m_totals;
|
||||
Ptr<IStreamingReporter> m_reporter;
|
||||
std::vector<MessageInfo> m_messages;
|
||||
TrackerContext m_trackerContext;
|
||||
Totals m_totals;
|
||||
|
||||
// Transient state
|
||||
TestCaseInfo const* m_activeTestCaseInfo;
|
||||
AssertionResult m_lastResult;
|
||||
AssertionInfo m_lastAssertionInfo;
|
||||
std::vector<SectionEndInfo> m_unfinishedSections;
|
||||
std::vector<ITracker*> m_activeSections;
|
||||
TrackerContext m_trackerContext;
|
||||
std::vector<MessageInfo> m_messages;
|
||||
};
|
||||
|
||||
IResultCapture& getResultCapture() {
|
||||
if( IResultCapture* capture = getCurrentContext().getResultCapture() )
|
||||
return *capture;
|
||||
else
|
||||
throw std::logic_error( "No result capture instance" );
|
||||
}
|
||||
|
||||
} // end namespace Catch
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_RUNNER_IMPL_HPP_INCLUDED
|
||||
|
@@ -16,6 +16,8 @@
|
||||
|
||||
namespace Catch {
|
||||
|
||||
struct IRunContext;
|
||||
|
||||
class Section : NonCopyable {
|
||||
public:
|
||||
Section( SectionInfo const& info );
|
||||
@@ -29,6 +31,7 @@ namespace Catch {
|
||||
|
||||
std::string m_name;
|
||||
Counts m_assertions;
|
||||
IRunContext& m_runContext;
|
||||
bool m_sectionIncluded;
|
||||
Timer m_timer;
|
||||
};
|
||||
|
@@ -26,7 +26,8 @@ namespace Catch {
|
||||
|
||||
Section::Section( SectionInfo const& info )
|
||||
: m_info( info ),
|
||||
m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) )
|
||||
m_runContext( getCurrentRunContext() ),
|
||||
m_sectionIncluded( m_runContext.sectionStarted( m_info, m_assertions ) )
|
||||
{
|
||||
m_timer.start();
|
||||
}
|
||||
@@ -35,9 +36,9 @@ namespace Catch {
|
||||
if( m_sectionIncluded ) {
|
||||
SectionEndInfo endInfo( m_info, m_assertions, m_timer.getElapsedSeconds() );
|
||||
if( std::uncaught_exception() )
|
||||
getResultCapture().sectionEndedEarly( endInfo );
|
||||
m_runContext.sectionEndedEarly( endInfo );
|
||||
else
|
||||
getResultCapture().sectionEnded( endInfo );
|
||||
m_runContext.sectionEnded( endInfo );
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#include <streambuf>
|
||||
#include <ostream>
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
@@ -49,7 +50,7 @@ namespace Catch {
|
||||
|
||||
|
||||
class DebugOutStream : public IStream {
|
||||
std::auto_ptr<StreamBufBase> m_streamBuf;
|
||||
CATCH_AUTO_PTR( StreamBufBase ) m_streamBuf;
|
||||
mutable std::ostream m_os;
|
||||
public:
|
||||
DebugOutStream();
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#include "catch_test_registry.hpp"
|
||||
#include "catch_test_case_info.h"
|
||||
#include "catch_test_spec.hpp"
|
||||
#include "catch_context.h"
|
||||
|
||||
#include <vector>
|
||||
#include <set>
|
||||
@@ -87,7 +86,10 @@ namespace Catch {
|
||||
|
||||
class TestRegistry : public ITestCaseRegistry {
|
||||
public:
|
||||
TestRegistry() : m_unnamedCount( 0 ) {}
|
||||
TestRegistry()
|
||||
: m_currentSortOrder( RunTests::InDeclarationOrder ),
|
||||
m_unnamedCount( 0 )
|
||||
{}
|
||||
virtual ~TestRegistry();
|
||||
|
||||
virtual void registerTest( TestCase const& testCase ) {
|
||||
@@ -152,29 +154,38 @@ namespace Catch {
|
||||
return className;
|
||||
}
|
||||
|
||||
void registerTestCase
|
||||
( ITestCase* testCase,
|
||||
char const* classOrQualifiedMethodName,
|
||||
NameAndDesc const& nameAndDesc,
|
||||
SourceLineInfo const& lineInfo ) {
|
||||
|
||||
getMutableRegistryHub().registerTest
|
||||
( makeTestCase
|
||||
( testCase,
|
||||
extractClassName( classOrQualifiedMethodName ),
|
||||
nameAndDesc.name,
|
||||
nameAndDesc.description,
|
||||
lineInfo ) );
|
||||
}
|
||||
void registerTestCaseFunction
|
||||
( TestFunction function,
|
||||
SourceLineInfo const& lineInfo,
|
||||
NameAndDesc const& nameAndDesc ) {
|
||||
registerTestCase( new FreeFunctionTestCase( function ), "", nameAndDesc, lineInfo );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AutoReg::AutoReg( TestFunction function,
|
||||
SourceLineInfo const& lineInfo,
|
||||
NameAndDesc const& nameAndDesc ) {
|
||||
registerTestCase( new FreeFunctionTestCase( function ), "", nameAndDesc, lineInfo );
|
||||
AutoReg::AutoReg
|
||||
( TestFunction function,
|
||||
SourceLineInfo const& lineInfo,
|
||||
NameAndDesc const& nameAndDesc ) {
|
||||
registerTestCaseFunction( function, lineInfo, nameAndDesc );
|
||||
}
|
||||
|
||||
AutoReg::~AutoReg() {}
|
||||
|
||||
void AutoReg::registerTestCase( ITestCase* testCase,
|
||||
char const* classOrQualifiedMethodName,
|
||||
NameAndDesc const& nameAndDesc,
|
||||
SourceLineInfo const& lineInfo ) {
|
||||
|
||||
getMutableRegistryHub().registerTest
|
||||
( makeTestCase( testCase,
|
||||
extractClassName( classOrQualifiedMethodName ),
|
||||
nameAndDesc.name,
|
||||
nameAndDesc.description,
|
||||
lineInfo ) );
|
||||
}
|
||||
|
||||
} // end namespace Catch
|
||||
|
||||
|
||||
|
@@ -42,27 +42,32 @@ struct NameAndDesc {
|
||||
const char* description;
|
||||
};
|
||||
|
||||
void registerTestCase
|
||||
( ITestCase* testCase,
|
||||
char const* className,
|
||||
NameAndDesc const& nameAndDesc,
|
||||
SourceLineInfo const& lineInfo );
|
||||
|
||||
struct AutoReg {
|
||||
|
||||
AutoReg( TestFunction function,
|
||||
SourceLineInfo const& lineInfo,
|
||||
NameAndDesc const& nameAndDesc );
|
||||
AutoReg
|
||||
( TestFunction function,
|
||||
SourceLineInfo const& lineInfo,
|
||||
NameAndDesc const& nameAndDesc );
|
||||
|
||||
template<typename C>
|
||||
AutoReg( void (C::*method)(),
|
||||
char const* className,
|
||||
NameAndDesc const& nameAndDesc,
|
||||
SourceLineInfo const& lineInfo ) {
|
||||
registerTestCase( new MethodTestCase<C>( method ),
|
||||
className,
|
||||
nameAndDesc,
|
||||
lineInfo );
|
||||
}
|
||||
AutoReg
|
||||
( void (C::*method)(),
|
||||
char const* className,
|
||||
NameAndDesc const& nameAndDesc,
|
||||
SourceLineInfo const& lineInfo ) {
|
||||
|
||||
void registerTestCase( ITestCase* testCase,
|
||||
char const* className,
|
||||
NameAndDesc const& nameAndDesc,
|
||||
SourceLineInfo const& lineInfo );
|
||||
registerTestCase
|
||||
( new MethodTestCase<C>( method ),
|
||||
className,
|
||||
nameAndDesc,
|
||||
lineInfo );
|
||||
}
|
||||
|
||||
~AutoReg();
|
||||
|
||||
@@ -71,50 +76,70 @@ private:
|
||||
void operator= ( AutoReg const& );
|
||||
};
|
||||
|
||||
void registerTestCaseFunction
|
||||
( TestFunction function,
|
||||
SourceLineInfo const& lineInfo,
|
||||
NameAndDesc const& nameAndDesc );
|
||||
|
||||
} // end namespace Catch
|
||||
|
||||
#ifdef CATCH_CONFIG_VARIADIC_MACROS
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_TESTCASE2( TestName, ... ) \
|
||||
static void TestName(); \
|
||||
namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &TestName, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\
|
||||
static void TestName()
|
||||
#define INTERNAL_CATCH_TESTCASE( ... ) \
|
||||
static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )(); \
|
||||
namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\
|
||||
static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )()
|
||||
INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), __VA_ARGS__ )
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \
|
||||
namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); }
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... )\
|
||||
#define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\
|
||||
namespace{ \
|
||||
struct INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) : ClassName{ \
|
||||
struct TestName : ClassName{ \
|
||||
void test(); \
|
||||
}; \
|
||||
Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test, #ClassName, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); \
|
||||
Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &TestName::test, #ClassName, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); \
|
||||
} \
|
||||
void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test()
|
||||
void TestName::test()
|
||||
#define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \
|
||||
INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, __VA_ARGS__ )
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \
|
||||
Catch::AutoReg( Function, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) );
|
||||
|
||||
#else
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_TESTCASE2( TestName, Name, Desc ) \
|
||||
static void TestName(); \
|
||||
namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &TestName, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\
|
||||
static void TestName()
|
||||
#define INTERNAL_CATCH_TESTCASE( Name, Desc ) \
|
||||
static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )(); \
|
||||
namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\
|
||||
static void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )()
|
||||
INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), Name, Desc )
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \
|
||||
namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( Name, Desc ), CATCH_INTERNAL_LINEINFO ); }
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, TestName, Desc )\
|
||||
#define INTERNAL_CATCH_TEST_CASE_METHOD2( TestCaseName, ClassName, TestName, Desc )\
|
||||
namespace{ \
|
||||
struct INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) : ClassName{ \
|
||||
struct TestCaseName : ClassName{ \
|
||||
void test(); \
|
||||
}; \
|
||||
Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test, #ClassName, Catch::NameAndDesc( TestName, Desc ), CATCH_INTERNAL_LINEINFO ); \
|
||||
Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &TestCaseName::test, #ClassName, Catch::NameAndDesc( TestName, Desc ), CATCH_INTERNAL_LINEINFO ); \
|
||||
} \
|
||||
void INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ )::test()
|
||||
void TestCaseName::test()
|
||||
#define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, TestName, Desc )\
|
||||
INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, TestName, Desc )
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_REGISTER_TESTCASE( Function, Name, Desc ) \
|
||||
Catch::AutoReg( Function, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) );
|
||||
#endif
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED
|
||||
|
@@ -55,10 +55,13 @@ namespace Detail {
|
||||
|
||||
std::string toString( std::string const& value ) {
|
||||
std::string s = value;
|
||||
if( getCurrentContext().getConfig()->showInvisibles() ) {
|
||||
IConfig const* config = getCurrentConfig();
|
||||
if( config && config->showInvisibles() ) {
|
||||
for(size_t i = 0; i < s.size(); ++i ) {
|
||||
std::string subs;
|
||||
switch( s[i] ) {
|
||||
case '\r': subs = "\\r"; break;
|
||||
case '\l': subs = "\\l"; break;
|
||||
case '\n': subs = "\\n"; break;
|
||||
case '\t': subs = "\\t"; break;
|
||||
default: break;
|
||||
|
@@ -37,7 +37,7 @@ namespace Catch {
|
||||
return os;
|
||||
}
|
||||
|
||||
Version libraryVersion( 1, 3, 0, "develop", 3 );
|
||||
Version libraryVersion( 2, 0, 0, "develop", 2 );
|
||||
|
||||
}
|
||||
|
||||
|
@@ -680,7 +680,7 @@ MiscTests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
MiscTests.cpp:<line number>: FAILED:
|
||||
CHECK_THAT( testStringForMatching() Contains( "not there" ) )
|
||||
CHECK_THAT( testStringForMatching(), Contains( "not there" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" contains: "not there"
|
||||
|
||||
@@ -691,7 +691,7 @@ MiscTests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
MiscTests.cpp:<line number>: FAILED:
|
||||
CHECK_THAT( testStringForMatching() StartsWith( "string" ) )
|
||||
CHECK_THAT( testStringForMatching(), StartsWith( "string" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" starts with: "string"
|
||||
|
||||
@@ -702,7 +702,7 @@ MiscTests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
MiscTests.cpp:<line number>: FAILED:
|
||||
CHECK_THAT( testStringForMatching() EndsWith( "this" ) )
|
||||
CHECK_THAT( testStringForMatching(), EndsWith( "this" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" ends with: "this"
|
||||
|
||||
@@ -713,7 +713,7 @@ MiscTests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
MiscTests.cpp:<line number>: FAILED:
|
||||
CHECK_THAT( testStringForMatching() Equals( "something else" ) )
|
||||
CHECK_THAT( testStringForMatching(), Equals( "something else" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" equals: "something else"
|
||||
|
||||
@@ -724,7 +724,7 @@ MiscTests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
MiscTests.cpp:<line number>: FAILED:
|
||||
CHECK_THAT( testStringForMatching() ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) )
|
||||
CHECK_THAT( testStringForMatching(), ( Contains( "string" ) || Contains( "different" ) ) && Contains( "random" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" ( ( contains: "string" or
|
||||
contains: "different" ) and contains: "random" )
|
||||
@@ -736,7 +736,7 @@ MiscTests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
MiscTests.cpp:<line number>: FAILED:
|
||||
CHECK_THAT( testStringForMatching() !Contains( "substring" ) )
|
||||
CHECK_THAT( testStringForMatching(), !Contains( "substring" ) )
|
||||
with expansion:
|
||||
"this string contains 'abc' as a substring" not contains: "substring"
|
||||
|
||||
@@ -830,6 +830,6 @@ with expansion:
|
||||
"first" == "second"
|
||||
|
||||
===============================================================================
|
||||
test cases: 166 | 123 passed | 42 failed | 1 failed as expected
|
||||
assertions: 913 | 817 passed | 83 failed | 13 failed as expected
|
||||
test cases: 165 | 122 passed | 42 failed | 1 failed as expected
|
||||
assertions: 768 | 672 passed | 83 failed | 13 failed as expected
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
<testsuites>
|
||||
<testsuite name="CatchSelfTest" errors="13" failures="72" tests="915" hostname="tbd" time="{duration}" timestamp="tbd">
|
||||
<testsuite name="CatchSelfTest" errors="13" failures="72" tests="770" hostname="tbd" time="{duration}" timestamp="tbd">
|
||||
<testcase classname="global" name="toString(enum)" time="{duration}"/>
|
||||
<testcase classname="global" name="toString(enum w/operator<<)" time="{duration}"/>
|
||||
<testcase classname="global" name="toString(enum class)" time="{duration}"/>
|
||||
@@ -265,8 +265,6 @@ ExceptionTests.cpp:<line number>
|
||||
ExceptionTests.cpp:<line number>
|
||||
</failure>
|
||||
</testcase>
|
||||
<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="INFO and WARN do not abort tests" time="{duration}"/>
|
||||
<testcase classname="global" name="SUCCEED counts as a test pass" time="{duration}"/>
|
||||
<testcase classname="global" name="INFO gets logged on failure" time="{duration}">
|
||||
@@ -547,6 +545,7 @@ hello
|
||||
</testcase>
|
||||
<testcase classname="global" name="Text can be formatted using the Text class" time="{duration}"/>
|
||||
<testcase classname="global" name="Long text is truncted" time="{duration}"/>
|
||||
<testcase classname="global" name="ManuallyRegistered" time="{duration}"/>
|
||||
<testcase classname="global" name="Parsing a std::pair" time="{duration}"/>
|
||||
<testcase classname="global" name="Where there is more to the expression after the RHS" time="{duration}"/>
|
||||
<testcase classname="global" name="Where the LHS is not a simple value" time="{duration}"/>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -112,6 +112,7 @@ public:
|
||||
CustomStdException( const std::string& msg )
|
||||
: m_msg( msg )
|
||||
{}
|
||||
~CustomStdException() CATCH_NOEXCEPT {}
|
||||
|
||||
std::string getMessage() const
|
||||
{
|
||||
|
@@ -1,42 +1,2 @@
|
||||
/*
|
||||
* Created by Phil on 28/01/2011.
|
||||
* Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
// This define means we have to prefix all the CATCH macros with CATCH_
|
||||
// We're using it here to test it out
|
||||
#define CATCH_CONFIG_PREFIX_ALL
|
||||
#include "catch.hpp"
|
||||
|
||||
inline int multiply( int a, int b )
|
||||
{
|
||||
return a*b;
|
||||
}
|
||||
|
||||
CATCH_TEST_CASE( "Generators over two ranges", "[generators]" )
|
||||
{
|
||||
using namespace Catch::Generators;
|
||||
|
||||
int i = CATCH_GENERATE( between( 1, 5 ).then( values( 15, 20, 21 ).then( 36 ) ) );
|
||||
int j = CATCH_GENERATE( between( 100, 107 ) );
|
||||
|
||||
CATCH_REQUIRE( multiply( i, 2 ) == i*2 );
|
||||
CATCH_REQUIRE( multiply( j, 2 ) == j*2 );
|
||||
}
|
||||
|
||||
struct IntPair { int first, second; };
|
||||
|
||||
CATCH_TEST_CASE( "Generator over a range of pairs", "[generators]" )
|
||||
{
|
||||
using namespace Catch::Generators;
|
||||
|
||||
IntPair p[] = { { 0, 1 }, { 2, 3 } };
|
||||
|
||||
IntPair* i = CATCH_GENERATE( between( p, &p[1] ) );
|
||||
|
||||
CATCH_REQUIRE( i->first == i->second-1 );
|
||||
|
||||
}
|
||||
// The old generators have been removed
|
||||
// A new generator implementation is coming
|
||||
|
@@ -475,6 +475,8 @@ TEST_CASE( "long long" ) {
|
||||
|
||||
//TEST_CASE( "Divide by Zero signal handler", "[.][sig]" ) {
|
||||
// int i = 0;
|
||||
// int x = 10/i; // This should cause the signal to fire
|
||||
// CHECK( x == 0 );
|
||||
// SECTION( "s" ) {
|
||||
// int x = 10/i; // This should cause the signal to fire
|
||||
// CHECK( x == 0 );
|
||||
// }
|
||||
//}
|
||||
|
@@ -1 +0,0 @@
|
||||
#include "catch_interfaces_generators.h"
|
||||
|
@@ -1 +0,0 @@
|
||||
#include "catch_interfaces_runner.h"
|
@@ -449,3 +449,13 @@ TEST_CASE( "Long text is truncted", "[Text][Truncated]" ) {
|
||||
CHECK_THAT( t.toString(), EndsWith( "... message truncated due to excessive size" ) );
|
||||
|
||||
}
|
||||
|
||||
inline void manuallyRegisteredTestFunction() {
|
||||
SUCCEED( "was called" );
|
||||
}
|
||||
struct AutoTestReg {
|
||||
AutoTestReg() {
|
||||
REGISTER_TEST_CASE( manuallyRegisteredTestFunction, "ManuallyRegistered", "" );
|
||||
}
|
||||
};
|
||||
AutoTestReg autoTestReg;
|
||||
|
@@ -27,7 +27,6 @@
|
||||
4A45DA2D16161FA2004F8D6B /* catch_interfaces_capture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A45DA2C16161FA2004F8D6B /* catch_interfaces_capture.cpp */; };
|
||||
4A45DA3116161FFC004F8D6B /* catch_interfaces_reporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A45DA3016161FFB004F8D6B /* catch_interfaces_reporter.cpp */; };
|
||||
4A45DA3316162047004F8D6B /* catch_interfaces_exception.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A45DA3216162047004F8D6B /* catch_interfaces_exception.cpp */; };
|
||||
4A45DA3516162071004F8D6B /* catch_interfaces_runner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A45DA3416162071004F8D6B /* catch_interfaces_runner.cpp */; };
|
||||
4A6D0C27149B3D3B00DB3EAA /* CatchSelfTest.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4A6D0C26149B3D3B00DB3EAA /* CatchSelfTest.1 */; };
|
||||
4A6D0C37149B3D9E00DB3EAA /* ApproxTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6D0C2D149B3D9E00DB3EAA /* ApproxTests.cpp */; };
|
||||
4A6D0C38149B3D9E00DB3EAA /* ClassTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6D0C2F149B3D9E00DB3EAA /* ClassTests.cpp */; };
|
||||
@@ -120,7 +119,6 @@
|
||||
4A45DA2C16161FA2004F8D6B /* catch_interfaces_capture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_interfaces_capture.cpp; path = ../../../SelfTest/SurrogateCpps/catch_interfaces_capture.cpp; sourceTree = "<group>"; };
|
||||
4A45DA3016161FFB004F8D6B /* catch_interfaces_reporter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_interfaces_reporter.cpp; path = ../../../SelfTest/SurrogateCpps/catch_interfaces_reporter.cpp; sourceTree = "<group>"; };
|
||||
4A45DA3216162047004F8D6B /* catch_interfaces_exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_interfaces_exception.cpp; path = ../../../SelfTest/SurrogateCpps/catch_interfaces_exception.cpp; sourceTree = "<group>"; };
|
||||
4A45DA3416162071004F8D6B /* catch_interfaces_runner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_interfaces_runner.cpp; path = ../../../SelfTest/SurrogateCpps/catch_interfaces_runner.cpp; sourceTree = "<group>"; };
|
||||
4A4B0F9715CE6CFB00AE2392 /* catch_registry_hub.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_registry_hub.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
|
||||
4A4B0F9915CE6EC100AE2392 /* catch_interfaces_registry_hub.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = catch_interfaces_registry_hub.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
4A4B0F9A15CEF84800AE2392 /* catch_notimplemented_exception.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_notimplemented_exception.h; sourceTree = "<group>"; };
|
||||
@@ -149,14 +147,9 @@
|
||||
4A6D0C4C149B3E3D00DB3EAA /* catch_default_main.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_default_main.hpp; sourceTree = "<group>"; };
|
||||
4A6D0C4D149B3E3D00DB3EAA /* catch_evaluate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_evaluate.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
|
||||
4A6D0C4E149B3E3D00DB3EAA /* catch_exception_translator_registry.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_exception_translator_registry.hpp; sourceTree = "<group>"; };
|
||||
4A6D0C4F149B3E3D00DB3EAA /* catch_generators.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_generators.hpp; sourceTree = "<group>"; };
|
||||
4A6D0C50149B3E3D00DB3EAA /* catch_generators_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_generators_impl.hpp; sourceTree = "<group>"; };
|
||||
4A6D0C51149B3E3D00DB3EAA /* catch_context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_context.h; sourceTree = "<group>"; };
|
||||
4A6D0C52149B3E3D00DB3EAA /* catch_context_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_context_impl.hpp; sourceTree = "<group>"; };
|
||||
4A6D0C53149B3E3D00DB3EAA /* catch_interfaces_capture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_interfaces_capture.h; sourceTree = "<group>"; };
|
||||
4A6D0C54149B3E3D00DB3EAA /* catch_interfaces_exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = catch_interfaces_exception.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
4A6D0C55149B3E3D00DB3EAA /* catch_interfaces_reporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_interfaces_reporter.h; sourceTree = "<group>"; };
|
||||
4A6D0C56149B3E3D00DB3EAA /* catch_interfaces_runner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_interfaces_runner.h; sourceTree = "<group>"; };
|
||||
4A6D0C57149B3E3D00DB3EAA /* catch_interfaces_testcase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_interfaces_testcase.h; sourceTree = "<group>"; };
|
||||
4A6D0C58149B3E3D00DB3EAA /* catch_list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_list.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
|
||||
4A6D0C59149B3E3D00DB3EAA /* catch_objc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_objc.hpp; sourceTree = "<group>"; };
|
||||
@@ -175,7 +168,6 @@
|
||||
4A6D0C68149B3E3D00DB3EAA /* catch_reporter_xml.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_reporter_xml.hpp; sourceTree = "<group>"; };
|
||||
4A7ADB4314F631E10094FE10 /* catch_totals.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_totals.hpp; sourceTree = "<group>"; };
|
||||
4A7DB2CD1652FE4B00FA6523 /* catch_version.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = catch_version.h; path = ../../../../include/internal/catch_version.h; sourceTree = "<group>"; };
|
||||
4A90B59B15D0F61A00EF71BC /* catch_interfaces_generators.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_interfaces_generators.h; sourceTree = "<group>"; };
|
||||
4A90B59D15D24FE900EF71BC /* catch_assertionresult.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_assertionresult.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
|
||||
4AA7B8B4165428BA003155F6 /* catch_version.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = catch_version.hpp; path = ../../../../include/internal/catch_version.hpp; sourceTree = "<group>"; };
|
||||
4AB1C73514F97BDA00F31DF7 /* catch_console_colour_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_console_colour_impl.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
|
||||
@@ -340,7 +332,6 @@
|
||||
4A45DA2C16161FA2004F8D6B /* catch_interfaces_capture.cpp */,
|
||||
4A45DA3216162047004F8D6B /* catch_interfaces_exception.cpp */,
|
||||
4A45DA3016161FFB004F8D6B /* catch_interfaces_reporter.cpp */,
|
||||
4A45DA3416162071004F8D6B /* catch_interfaces_runner.cpp */,
|
||||
4AB3D99C1616216500C9A0F8 /* catch_interfaces_testcase.cpp */,
|
||||
4AB3D99F1616219100C9A0F8 /* catch_interfaces_config.cpp */,
|
||||
4AB3D9A1161621B500C9A0F8 /* catch_interfaces_generators.cpp */,
|
||||
@@ -358,8 +349,6 @@
|
||||
263FD06017AF8DF200988A20 /* catch_timer.hpp */,
|
||||
4A4B0F9C15CEFA8300AE2392 /* catch_impl.hpp */,
|
||||
4A4B0F9715CE6CFB00AE2392 /* catch_registry_hub.hpp */,
|
||||
4A6D0C50149B3E3D00DB3EAA /* catch_generators_impl.hpp */,
|
||||
4A6D0C52149B3E3D00DB3EAA /* catch_context_impl.hpp */,
|
||||
4A6D0C5E149B3E3D00DB3EAA /* catch_run_context.hpp */,
|
||||
4A6D0C62149B3E3D00DB3EAA /* catch_test_case_registry_impl.hpp */,
|
||||
4AB1C73514F97BDA00F31DF7 /* catch_console_colour_impl.hpp */,
|
||||
@@ -379,7 +368,6 @@
|
||||
269831E519078C1600BB0CE0 /* catch_tostring.h */,
|
||||
269831E619078CA200BB0CE0 /* catch_tostring.hpp */,
|
||||
4A6D0C4D149B3E3D00DB3EAA /* catch_evaluate.hpp */,
|
||||
4A6D0C4F149B3E3D00DB3EAA /* catch_generators.hpp */,
|
||||
4A6D0C5C149B3E3D00DB3EAA /* catch_result_type.h */,
|
||||
4A6D0C5D149B3E3D00DB3EAA /* catch_assertionresult.h */,
|
||||
261488FE184DC32F0041FBEB /* catch_section.h */,
|
||||
@@ -412,7 +400,6 @@
|
||||
261488FA184C81130041FBEB /* catch_test_spec.hpp */,
|
||||
2656C21F1925E5100040DB02 /* catch_test_spec_parser.hpp */,
|
||||
4A6D0C4A149B3E3D00DB3EAA /* catch_config.hpp */,
|
||||
4A6D0C51149B3E3D00DB3EAA /* catch_context.h */,
|
||||
4A6D0C61149B3E3D00DB3EAA /* catch_test_case_info.h */,
|
||||
4A7ADB4314F631E10094FE10 /* catch_totals.hpp */,
|
||||
4AB77CB71553B72B00857BF0 /* catch_section_info.hpp */,
|
||||
@@ -440,10 +427,8 @@
|
||||
4A6D0C53149B3E3D00DB3EAA /* catch_interfaces_capture.h */,
|
||||
4A6D0C54149B3E3D00DB3EAA /* catch_interfaces_exception.h */,
|
||||
4A6D0C55149B3E3D00DB3EAA /* catch_interfaces_reporter.h */,
|
||||
4A6D0C56149B3E3D00DB3EAA /* catch_interfaces_runner.h */,
|
||||
4A6D0C57149B3E3D00DB3EAA /* catch_interfaces_testcase.h */,
|
||||
4AFC661D157E96A7009D58CF /* catch_interfaces_config.h */,
|
||||
4A90B59B15D0F61A00EF71BC /* catch_interfaces_generators.h */,
|
||||
26711C90195D46CD0033EDA2 /* catch_interfaces_tag_alias_registry.h */,
|
||||
);
|
||||
name = Interfaces;
|
||||
@@ -566,7 +551,6 @@
|
||||
4A45DA3316162047004F8D6B /* catch_interfaces_exception.cpp in Sources */,
|
||||
2691574C1A532A280054F1ED /* ToStringTuple.cpp in Sources */,
|
||||
26711C8F195D465C0033EDA2 /* TagAliasTests.cpp in Sources */,
|
||||
4A45DA3516162071004F8D6B /* catch_interfaces_runner.cpp in Sources */,
|
||||
4AB3D99D1616216500C9A0F8 /* catch_interfaces_testcase.cpp in Sources */,
|
||||
4AB3D9A01616219100C9A0F8 /* catch_interfaces_config.cpp in Sources */,
|
||||
4AB3D9A2161621B500C9A0F8 /* catch_interfaces_generators.cpp in Sources */,
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user