MCPcopy Create free account
hub / github.com/FastLED/FastLED / listTests

Method listTests

src/fl/test/fltest.cpp.hpp:139–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139fl::size TestContext::listTests(const char* filter) const FL_NOEXCEPT {
140 fl::size count = 0;
141 fl::printf("\nRegistered tests:\n");
142 fl::printf("----------------\n");
143
144 for (fl::size i = 0; i < mTestCases.size(); ++i) {
145 // Apply filter if provided
146 if (filter && filter[0] != '\0') {
147 if (!matchesFilter(mTestCases[i].mName.c_str(), filter)) {
148 continue;
149 }
150 }
151 count++;
152 fl::printf(" [%u] %s\n", static_cast<fl::u32>(count), mTestCases[i].mName.c_str());
153 fl::printf(" File: %s:%d\n", mTestCases[i].mFile, mTestCases[i].mLine);
154 }
155
156 fl::printf("----------------\n");
157 fl::printf("Total: %u tests\n\n", static_cast<fl::u32>(count));
158 return count;
159}
160
161bool TestContext::matchesFilter(const char* name, const char* filter) const FL_NOEXCEPT {
162 if (!filter || filter[0] == '\0') {

Callers

nothing calls this directly

Calls 3

printfFunction · 0.85
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected