mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-25 22:19:25 +00:00
Initial support for variadic macros
This commit is contained in:
parent
9c5bbab239
commit
c0b698073e
6 changed files with 163 additions and 63 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue