MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/TriangleMeshDistance / makeTestCase

Function makeTestCase

tests/catch.hpp:11397–11438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11395 }
11396
11397 TestCase makeTestCase( ITestInvoker* _testCase,
11398 std::string const& _className,
11399 NameAndTags const& nameAndTags,
11400 SourceLineInfo const& _lineInfo )
11401 {
11402 bool isHidden = false;
11403
11404 // Parse out tags
11405 std::vector<std::string> tags;
11406 std::string desc, tag;
11407 bool inTag = false;
11408 std::string _descOrTags = nameAndTags.tags;
11409 for (char c : _descOrTags) {
11410 if( !inTag ) {
11411 if( c == '[' )
11412 inTag = true;
11413 else
11414 desc += c;
11415 }
11416 else {
11417 if( c == ']' ) {
11418 TestCaseInfo::SpecialProperties prop = parseSpecialTag( tag );
11419 if( ( prop & TestCaseInfo::IsHidden ) != 0 )
11420 isHidden = true;
11421 else if( prop == TestCaseInfo::None )
11422 enforceNotReservedTag( tag, _lineInfo );
11423
11424 tags.push_back( tag );
11425 tag.clear();
11426 inTag = false;
11427 }
11428 else
11429 tag += c;
11430 }
11431 }
11432 if( isHidden ) {
11433 tags.push_back( "." );
11434 }
11435
11436 TestCaseInfo info( nameAndTags.name, _className, desc, tags, _lineInfo );
11437 return TestCase( _testCase, std::move(info) );
11438 }
11439
11440 void setTags( TestCaseInfo& testCaseInfo, std::vector<std::string> tags ) {
11441 std::sort(begin(tags), end(tags));

Callers 2

registerTestMethodsFunction · 0.85
AutoRegMethod · 0.85

Calls 3

parseSpecialTagFunction · 0.85
enforceNotReservedTagFunction · 0.85
TestCaseClass · 0.85

Tested by

no test coverage detected