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

Method runTestCase

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

Source from the content-addressed store, hash-verified

232static const char* sSkipReason = nullptr;
233
234void TestContext::runTestCase(const TestCaseInfo& info) FL_NOEXCEPT {
235 mStats.mTestCasesRun++;
236 mReporter->testCaseStart(info.mName.c_str());
237
238 mCurrentTestFailed = false;
239 mCurrentTestTimedOut = false;
240 mCurrentTestName = info.mName.c_str();
241 mSubcaseStack.clear();
242 mNextSubcaseStack.clear();
243 mFullyTraversedHashes.clear();
244 mCurrentSubcaseDepth = 0;
245 mSubcaseDiscoveryDepth = 0;
246 mShouldReenter = true;
247
248 // Reset skip flag for this test
249 sCurrentTestSkipped = false;
250
251 // Record test start time if we have a time function
252 if (mGetMillis) {
253 mCurrentTestStartMs = mGetMillis();
254 }
255
256 // Run the test multiple times to explore all subcase paths
257 // On each run, we follow the path in mNextSubcaseStack and then discover one new subcase
258 while (mShouldReenter && !mCurrentTestTimedOut && !sCurrentTestSkipped) {
259 mShouldReenter = false;
260 mCurrentSubcaseDepth = 0;
261 mSubcaseDiscoveryDepth = 0;
262
263 // Copy next stack to current stack for this iteration
264 mSubcaseStack = mNextSubcaseStack;
265 mNextSubcaseStack.clear();
266
267 // Call the test function
268 info.mFunc();
269
270 // Check for skip (FL_SKIP was called)
271 if (sCurrentTestSkipped) {
272 break;
273 }
274
275 // Check for timeout after each iteration
276 if (mDefaultTimeoutMs > 0 && checkTimeout()) {
277 break;
278 }
279 }
280
281 mCurrentTestName = nullptr;
282
283 // Calculate test duration
284 fl::u32 testDurationMs = 0;
285 if (mGetMillis) {
286 testDurationMs = mGetMillis() - mCurrentTestStartMs;
287 mStats.mTotalDurationMs += testDurationMs;
288 }
289
290 if (sCurrentTestSkipped) {
291 mStats.mTestCasesSkipped++;

Callers

nothing calls this directly

Calls 4

testCaseStartMethod · 0.80
testCaseEndMethod · 0.80
c_strMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected