MCPcopy Create free account
hub / github.com/apache/qpid-proton / makeTestCase

Function makeTestCase

tests/include/catch.hpp:14056–14103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14054 }
14055
14056 TestCase makeTestCase( ITestInvoker* _testCase,
14057 std::string const& _className,
14058 NameAndTags const& nameAndTags,
14059 SourceLineInfo const& _lineInfo )
14060 {
14061 bool isHidden = false;
14062
14063 // Parse out tags
14064 std::vector<std::string> tags;
14065 std::string desc, tag;
14066 bool inTag = false;
14067 for (char c : nameAndTags.tags) {
14068 if( !inTag ) {
14069 if( c == '[' )
14070 inTag = true;
14071 else
14072 desc += c;
14073 }
14074 else {
14075 if( c == ']' ) {
14076 TestCaseInfo::SpecialProperties prop = parseSpecialTag( tag );
14077 if( ( prop & TestCaseInfo::IsHidden ) != 0 )
14078 isHidden = true;
14079 else if( prop == TestCaseInfo::None )
14080 enforceNotReservedTag( tag, _lineInfo );
14081
14082 // Merged hide tags like `[.approvals]` should be added as
14083 // `[.][approvals]`. The `[.]` is added at later point, so
14084 // we only strip the prefix
14085 if (startsWith(tag, '.') && tag.size() > 1) {
14086 tag.erase(0, 1);
14087 }
14088 tags.push_back( tag );
14089 tag.clear();
14090 inTag = false;
14091 }
14092 else
14093 tag += c;
14094 }
14095 }
14096 if( isHidden ) {
14097 // Add all "hidden" tags to make them behave identically
14098 tags.insert( tags.end(), { ".", "!hide" } );
14099 }
14100
14101 TestCaseInfo info( static_cast<std::string>(nameAndTags.name), _className, desc, tags, _lineInfo );
14102 return TestCase( _testCase, std::move(info) );
14103 }
14104
14105 void setTags( TestCaseInfo& testCaseInfo, std::vector<std::string> tags ) {
14106 std::sort(begin(tags), end(tags));

Callers 2

registerTestMethodsFunction · 0.85
AutoRegMethod · 0.85

Calls 9

parseSpecialTagFunction · 0.85
enforceNotReservedTagFunction · 0.85
startsWithFunction · 0.85
TestCaseClass · 0.85
eraseMethod · 0.80
sizeMethod · 0.45
clearMethod · 0.45
insertMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected