MCPcopy Create free account
hub / github.com/apache/trafficserver / registerTestMethods

Function registerTestMethods

lib/catch2/catch.hpp:4909–4938  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4907 }
4908
4909 inline std::size_t registerTestMethods() {
4910 std::size_t noTestMethods = 0;
4911 int noClasses = objc_getClassList( nullptr, 0 );
4912
4913 Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses);
4914 objc_getClassList( classes, noClasses );
4915
4916 for( int c = 0; c < noClasses; c++ ) {
4917 Class cls = classes[c];
4918 {
4919 u_int count;
4920 Method* methods = class_copyMethodList( cls, &count );
4921 for( u_int m = 0; m < count ; m++ ) {
4922 SEL selector = method_getName(methods[m]);
4923 std::string methodName = sel_getName(selector);
4924 if( startsWith( methodName, "Catch_TestCase_" ) ) {
4925 std::string testCaseName = methodName.substr( 15 );
4926 std::string name = Detail::getAnnotation( cls, "Name", testCaseName );
4927 std::string desc = Detail::getAnnotation( cls, "Description", testCaseName );
4928 const char* className = class_getName( cls );
4929
4930 getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, NameAndTags( name.c_str(), desc.c_str() ), SourceLineInfo("",0) ) );
4931 noTestMethods++;
4932 }
4933 }
4934 free(methods);
4935 }
4936 }
4937 return noTestMethods;
4938 }
4939
4940#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
4941

Callers 1

mainFunction · 0.85

Calls 8

startsWithFunction · 0.85
getAnnotationFunction · 0.85
NameAndTagsClass · 0.85
SourceLineInfoClass · 0.85
makeTestCaseFunction · 0.70
substrMethod · 0.45
registerTestMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected