| 11663 | } |
| 11664 | |
| 11665 | TestCase makeTestCase( ITestInvoker* _testCase, |
| 11666 | std::string const& _className, |
| 11667 | NameAndTags const& nameAndTags, |
| 11668 | SourceLineInfo const& _lineInfo ) |
| 11669 | { |
| 11670 | bool isHidden = false; |
| 11671 | |
| 11672 | // Parse out tags |
| 11673 | std::vector<std::string> tags; |
| 11674 | std::string desc, tag; |
| 11675 | bool inTag = false; |
| 11676 | std::string _descOrTags = nameAndTags.tags; |
| 11677 | for (char c : _descOrTags) { |
| 11678 | if( !inTag ) { |
| 11679 | if( c == '[' ) |
| 11680 | inTag = true; |
| 11681 | else |
| 11682 | desc += c; |
| 11683 | } |
| 11684 | else { |
| 11685 | if( c == ']' ) { |
| 11686 | TestCaseInfo::SpecialProperties prop = parseSpecialTag( tag ); |
| 11687 | if( ( prop & TestCaseInfo::IsHidden ) != 0 ) |
| 11688 | isHidden = true; |
| 11689 | else if( prop == TestCaseInfo::None ) |
| 11690 | enforceNotReservedTag( tag, _lineInfo ); |
| 11691 | |
| 11692 | // Merged hide tags like `[.approvals]` should be added as |
| 11693 | // `[.][approvals]`. The `[.]` is added at later point, so |
| 11694 | // we only strip the prefix |
| 11695 | if (startsWith(tag, '.') && tag.size() > 1) { |
| 11696 | tag.erase(0, 1); |
| 11697 | } |
| 11698 | tags.push_back( tag ); |
| 11699 | tag.clear(); |
| 11700 | inTag = false; |
| 11701 | } |
| 11702 | else |
| 11703 | tag += c; |
| 11704 | } |
| 11705 | } |
| 11706 | if( isHidden ) { |
| 11707 | tags.push_back( "." ); |
| 11708 | } |
| 11709 | |
| 11710 | TestCaseInfo info( nameAndTags.name, _className, desc, tags, _lineInfo ); |
| 11711 | return TestCase( _testCase, std::move(info) ); |
| 11712 | } |
| 11713 | |
| 11714 | void setTags( TestCaseInfo& testCaseInfo, std::vector<std::string> tags ) { |
| 11715 | std::sort(begin(tags), end(tags)); |
no test coverage detected