Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include/internal/catch_test_case_info.hpp
diff options
context:
space:
mode:
authorPhil Nash2015-12-04 10:19:08 +0000
committerPhil Nash2015-12-04 10:19:08 +0000
commitfdc42d0af47f58fa13a42b685bbeaf55a8347673 (patch)
tree779ff3d692eeffd33353d89ad7697a592ab5201e /include/internal/catch_test_case_info.hpp
parentd758428fe297655e558a86cc6a013fcb1bcc8c7d (diff)
parentd274fc571c3980b5ac04cbe1416cf2205e6c99f7 (diff)
downloadcatch3-1.3.0.tar.gz
Merged from develop branchv1.3.0
- now v1.3.0
Diffstat (limited to 'include/internal/catch_test_case_info.hpp')
-rw-r--r--include/internal/catch_test_case_info.hpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/include/internal/catch_test_case_info.hpp b/include/internal/catch_test_case_info.hpp
index 308ddc74..90f53411 100644
--- a/include/internal/catch_test_case_info.hpp
+++ b/include/internal/catch_test_case_info.hpp
@@ -93,6 +93,21 @@ namespace Catch {
return TestCase( _testCase, info );
}
+ void setTags( TestCaseInfo& testCaseInfo, std::set<std::string> const& tags )
+ {
+ testCaseInfo.tags = tags;
+ testCaseInfo.lcaseTags.clear();
+
+ std::ostringstream oss;
+ for( std::set<std::string>::const_iterator it = tags.begin(), itEnd = tags.end(); it != itEnd; ++it ) {
+ oss << "[" << *it << "]";
+ std::string lcaseTag = toLower( *it );
+ testCaseInfo.properties = static_cast<TestCaseInfo::SpecialProperties>( testCaseInfo.properties | parseSpecialTag( lcaseTag ) );
+ testCaseInfo.lcaseTags.insert( lcaseTag );
+ }
+ testCaseInfo.tagsAsString = oss.str();
+ }
+
TestCaseInfo::TestCaseInfo( std::string const& _name,
std::string const& _className,
std::string const& _description,
@@ -101,18 +116,10 @@ namespace Catch {
: name( _name ),
className( _className ),
description( _description ),
- tags( _tags ),
lineInfo( _lineInfo ),
properties( None )
{
- std::ostringstream oss;
- for( std::set<std::string>::const_iterator it = _tags.begin(), itEnd = _tags.end(); it != itEnd; ++it ) {
- oss << "[" << *it << "]";
- std::string lcaseTag = toLower( *it );
- properties = static_cast<SpecialProperties>( properties | parseSpecialTag( lcaseTag ) );
- lcaseTags.insert( lcaseTag );
- }
- tagsAsString = oss.str();
+ setTags( *this, _tags );
}
TestCaseInfo::TestCaseInfo( TestCaseInfo const& other )