mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-25 05:59:24 +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
|
@ -29,7 +29,7 @@ namespace Catch {
|
|||
std::string name = testCase.getTestCaseInfo().name;
|
||||
if( name == "" ) {
|
||||
std::ostringstream oss;
|
||||
oss << name << "unnamed/" << ++m_unnamedCount;
|
||||
oss << "Anonymous test case " << ++m_unnamedCount;
|
||||
return registerTest( testCase.withName( oss.str() ) );
|
||||
}
|
||||
|
||||
|
@ -124,22 +124,25 @@ namespace Catch {
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AutoReg::AutoReg( TestFunction function,
|
||||
const char* name,
|
||||
const char* description,
|
||||
const SourceLineInfo& lineInfo ) {
|
||||
registerTestCase( new FreeFunctionTestCase( function ), "global", name, description, lineInfo );
|
||||
AutoReg::AutoReg( TestFunction function,
|
||||
SourceLineInfo const& lineInfo,
|
||||
NameAndDesc const& nameAndDesc ) {
|
||||
registerTestCase( new FreeFunctionTestCase( function ), "global", nameAndDesc, lineInfo );
|
||||
}
|
||||
|
||||
AutoReg::~AutoReg() {}
|
||||
|
||||
void AutoReg::registerTestCase( ITestCase* testCase,
|
||||
const char* classOrQualifiedMethodName,
|
||||
const char* name,
|
||||
const char* description,
|
||||
const SourceLineInfo& lineInfo ) {
|
||||
char const* classOrQualifiedMethodName,
|
||||
NameAndDesc const& nameAndDesc,
|
||||
SourceLineInfo const& lineInfo ) {
|
||||
|
||||
getMutableRegistryHub().registerTest( makeTestCase( testCase, extractClassName( classOrQualifiedMethodName ), name, description, lineInfo ) );
|
||||
getMutableRegistryHub().registerTest
|
||||
( makeTestCase( testCase,
|
||||
extractClassName( classOrQualifiedMethodName ),
|
||||
nameAndDesc.name,
|
||||
nameAndDesc.description,
|
||||
lineInfo ) );
|
||||
}
|
||||
|
||||
} // end namespace Catch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue