MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / makeTestCase

Function makeTestCase

unittests/catch.hpp:9859–9900  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9857 }
9858
9859 TestCase makeTestCase( ITestInvoker* _testCase,
9860 std::string const& _className,
9861 NameAndTags const& nameAndTags,
9862 SourceLineInfo const& _lineInfo )
9863 {
9864 bool isHidden = false;
9865
9866 // Parse out tags
9867 std::vector<std::string> tags;
9868 std::string desc, tag;
9869 bool inTag = false;
9870 std::string _descOrTags = nameAndTags.tags;
9871 for (char c : _descOrTags) {
9872 if( !inTag ) {
9873 if( c == '[' )
9874 inTag = true;
9875 else
9876 desc += c;
9877 }
9878 else {
9879 if( c == ']' ) {
9880 TestCaseInfo::SpecialProperties prop = parseSpecialTag( tag );
9881 if( ( prop & TestCaseInfo::IsHidden ) != 0 )
9882 isHidden = true;
9883 else if( prop == TestCaseInfo::None )
9884 enforceNotReservedTag( tag, _lineInfo );
9885
9886 tags.push_back( tag );
9887 tag.clear();
9888 inTag = false;
9889 }
9890 else
9891 tag += c;
9892 }
9893 }
9894 if( isHidden ) {
9895 tags.push_back( "." );
9896 }
9897
9898 TestCaseInfo info( nameAndTags.name, _className, desc, tags, _lineInfo );
9899 return TestCase( _testCase, std::move(info) );
9900 }
9901
9902 void setTags( TestCaseInfo& testCaseInfo, std::vector<std::string> tags ) {
9903 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