diff options
| author | Phil Nash | 2012-09-12 18:40:24 +0100 |
|---|---|---|
| committer | Phil Nash | 2012-09-12 18:40:24 +0100 |
| commit | dea756f699f23e2ee23e02099e3989d8897d5194 (patch) | |
| tree | 448c05337c14b8283e6c69a0cdfed4e6812da7ff /include | |
| parent | f7418eb2dda624d3934a9e07c9ddb31018dfe147 (diff) | |
| download | catch3-dea756f699f23e2ee23e02099e3989d8897d5194.tar.gz | |
Capture test case hidden status in member variable
Diffstat (limited to 'include')
| -rw-r--r-- | include/internal/catch_test_case_info.h | 3 | ||||
| -rw-r--r-- | include/internal/catch_test_case_info.hpp | 14 |
2 files changed, 11 insertions, 6 deletions
diff --git a/include/internal/catch_test_case_info.h b/include/internal/catch_test_case_info.h index b7b9bc5d..4fbfaa65 100644 --- a/include/internal/catch_test_case_info.h +++ b/include/internal/catch_test_case_info.h @@ -44,7 +44,8 @@ namespace Catch { Ptr<ITestCase> m_test; std::string m_name; std::string m_description; - SourceLineInfo m_lineInfo; + SourceLineInfo m_lineInfo; + bool m_isHidden; }; } diff --git a/include/internal/catch_test_case_info.hpp b/include/internal/catch_test_case_info.hpp index 51258a7d..fa8bd40f 100644 --- a/include/internal/catch_test_case_info.hpp +++ b/include/internal/catch_test_case_info.hpp @@ -20,27 +20,31 @@ namespace Catch { : m_test( testCase ), m_name( name ), m_description( description ), - m_lineInfo( lineInfo ) + m_lineInfo( lineInfo ), + m_isHidden( startsWith( name, "./" ) ) {} TestCaseInfo::TestCaseInfo() : m_test( NULL ), m_name(), - m_description() + m_description(), + m_isHidden( false ) {} TestCaseInfo::TestCaseInfo( const TestCaseInfo& other, const std::string& name ) : m_test( other.m_test ), m_name( name ), 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 ) : m_test( other.m_test ), m_name( other.m_name ), m_description( other.m_description ), - m_lineInfo( other.m_lineInfo ) + m_lineInfo( other.m_lineInfo ), + m_isHidden( other.m_isHidden ) {} void TestCaseInfo::invoke() const { @@ -60,7 +64,7 @@ namespace Catch { } bool TestCaseInfo::isHidden() const { - return m_name.size() >= 2 && m_name[0] == '.' && m_name[1] == '/'; + return m_isHidden; } void TestCaseInfo::swap( TestCaseInfo& other ) { |