| 104 | } |
| 105 | |
| 106 | Test::TestGroup* Test::TestGroup::getGroupFromPathName(const char* pathName, bool omitRoot) |
| 107 | { |
| 108 | if (!omitRoot || getParent()) |
| 109 | { |
| 110 | if (strstr(pathName, getName()) != pathName) |
| 111 | return NULL; |
| 112 | |
| 113 | pathName += strlen(getName()); |
| 114 | |
| 115 | if (getFirstChild()) |
| 116 | { |
| 117 | if (strstr(pathName, "/") != pathName) |
| 118 | return NULL; |
| 119 | |
| 120 | pathName += strlen("/"); |
| 121 | } |
| 122 | else |
| 123 | { |
| 124 | if (pathName[0] == '\0') |
| 125 | return this; |
| 126 | else |
| 127 | return NULL; |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | for (unsigned i = 0; i < mChildren.size(); ++i) |
| 132 | { |
| 133 | TestGroup* group = mChildren[i]->getGroupFromPathName(pathName, omitRoot); |
| 134 | if (group) |
| 135 | return group; |
| 136 | } |
| 137 | return NULL; |
| 138 | } |
| 139 | |
| 140 | void Test::TestGroup::addTest(SampleCreator test, const char* name, size_t count) |
| 141 | { |