mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-04 05:09:53 +01:00
Capture test case hidden status in member variable
This commit is contained in:
parent
f7418eb2dd
commit
dea756f699
@ -44,7 +44,8 @@ namespace Catch {
|
|||||||
Ptr<ITestCase> m_test;
|
Ptr<ITestCase> m_test;
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
std::string m_description;
|
std::string m_description;
|
||||||
SourceLineInfo m_lineInfo;
|
SourceLineInfo m_lineInfo;
|
||||||
|
bool m_isHidden;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,27 +20,31 @@ namespace Catch {
|
|||||||
: m_test( testCase ),
|
: m_test( testCase ),
|
||||||
m_name( name ),
|
m_name( name ),
|
||||||
m_description( description ),
|
m_description( description ),
|
||||||
m_lineInfo( lineInfo )
|
m_lineInfo( lineInfo ),
|
||||||
|
m_isHidden( startsWith( name, "./" ) )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
TestCaseInfo::TestCaseInfo()
|
TestCaseInfo::TestCaseInfo()
|
||||||
: m_test( NULL ),
|
: m_test( NULL ),
|
||||||
m_name(),
|
m_name(),
|
||||||
m_description()
|
m_description(),
|
||||||
|
m_isHidden( false )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
TestCaseInfo::TestCaseInfo( const TestCaseInfo& other, const std::string& name )
|
TestCaseInfo::TestCaseInfo( const TestCaseInfo& other, const std::string& name )
|
||||||
: m_test( other.m_test ),
|
: m_test( other.m_test ),
|
||||||
m_name( name ),
|
m_name( name ),
|
||||||
m_description( other.m_description ),
|
m_description( other.m_description ),
|
||||||
m_lineInfo( other.m_lineInfo )
|
m_lineInfo( other.m_lineInfo ),
|
||||||
|
m_isHidden( other.m_isHidden )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
TestCaseInfo::TestCaseInfo( const TestCaseInfo& other )
|
TestCaseInfo::TestCaseInfo( const TestCaseInfo& other )
|
||||||
: m_test( other.m_test ),
|
: m_test( other.m_test ),
|
||||||
m_name( other.m_name ),
|
m_name( other.m_name ),
|
||||||
m_description( other.m_description ),
|
m_description( other.m_description ),
|
||||||
m_lineInfo( other.m_lineInfo )
|
m_lineInfo( other.m_lineInfo ),
|
||||||
|
m_isHidden( other.m_isHidden )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void TestCaseInfo::invoke() const {
|
void TestCaseInfo::invoke() const {
|
||||||
@ -60,7 +64,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool TestCaseInfo::isHidden() const {
|
bool TestCaseInfo::isHidden() const {
|
||||||
return m_name.size() >= 2 && m_name[0] == '.' && m_name[1] == '/';
|
return m_isHidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestCaseInfo::swap( TestCaseInfo& other ) {
|
void TestCaseInfo::swap( TestCaseInfo& other ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user