MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / makeTestCase

Function makeTestCase

Bcore/src/main/cpp/Dobby/tests/catch.hpp:9784–9820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9782}
9783
9784TestCase makeTestCase(ITestInvoker *_testCase, std::string const &_className, NameAndTags const &nameAndTags,
9785 SourceLineInfo const &_lineInfo) {
9786 bool isHidden = false;
9787
9788 // Parse out tags
9789 std::vector<std::string> tags;
9790 std::string desc, tag;
9791 bool inTag = false;
9792 std::string _descOrTags = nameAndTags.tags;
9793 for (char c : _descOrTags) {
9794 if (!inTag) {
9795 if (c == '[')
9796 inTag = true;
9797 else
9798 desc += c;
9799 } else {
9800 if (c == ']') {
9801 TestCaseInfo::SpecialProperties prop = parseSpecialTag(tag);
9802 if ((prop & TestCaseInfo::IsHidden) != 0)
9803 isHidden = true;
9804 else if (prop == TestCaseInfo::None)
9805 enforceNotReservedTag(tag, _lineInfo);
9806
9807 tags.push_back(tag);
9808 tag.clear();
9809 inTag = false;
9810 } else
9811 tag += c;
9812 }
9813 }
9814 if (isHidden) {
9815 tags.push_back(".");
9816 }
9817
9818 TestCaseInfo info(nameAndTags.name, _className, desc, tags, _lineInfo);
9819 return TestCase(_testCase, std::move(info));
9820}
9821
9822void setTags(TestCaseInfo &testCaseInfo, std::vector<std::string> tags) {
9823 std::sort(begin(tags), end(tags));

Callers 2

registerTestMethodsFunction · 0.85
AutoRegMethod · 0.85

Calls 4

parseSpecialTagFunction · 0.85
enforceNotReservedTagFunction · 0.85
TestCaseClass · 0.85
clearMethod · 0.45

Tested by

no test coverage detected