forked from catchorg/Catch2
Initial support for variadic macros
This commit is contained in:
@@ -17,9 +17,9 @@ namespace Catch {
|
||||
|
||||
class Section {
|
||||
public:
|
||||
Section( const std::string& name,
|
||||
const std::string& description,
|
||||
const SourceLineInfo& lineInfo )
|
||||
Section( const SourceLineInfo& lineInfo,
|
||||
const std::string& name,
|
||||
const std::string& description = "" )
|
||||
: m_info( name, description, lineInfo ),
|
||||
m_sectionIncluded( getCurrentContext().getResultCapture().sectionStarted( m_info, m_assertions ) )
|
||||
{}
|
||||
@@ -44,7 +44,12 @@ namespace Catch {
|
||||
|
||||
} // end namespace Catch
|
||||
|
||||
#define INTERNAL_CATCH_SECTION( name, desc ) \
|
||||
if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( name, desc, CATCH_INTERNAL_LINEINFO ) )
|
||||
#ifdef CATCH_CONFIG_VARIADIC_MACROS
|
||||
#define INTERNAL_CATCH_SECTION( ... ) \
|
||||
if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) )
|
||||
#else
|
||||
#define INTERNAL_CATCH_SECTION( name, desc ) \
|
||||
if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( CATCH_INTERNAL_LINEINFO, name, desc ) )
|
||||
#endif
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_SECTION_HPP_INCLUDED
|
||||
|
||||
Reference in New Issue
Block a user