FastLED 3.9.15
Loading...
Searching...
No Matches

◆ testCaseEnd()

void fl::test::TAPReporter::testCaseEnd ( bool passed,
fl::u32 durationMs = 0 )
overridevirtual

Called when a test case ends.

Parameters
passedWhether the test passed
durationMsDuration of the test in milliseconds (0 if no timer available)

Implements fl::test::IReporter.

Definition at line 891 of file fltest.cpp.hpp.

891 {
892 fl::sstream ss;
893
894 if (passed) {
895 ss << "ok " << mTestNumber << " - " << mCurrentTestName;
896 } else {
897 ss << "not ok " << mTestNumber << " - " << mCurrentTestName;
898 }
899
900 // TAP supports duration via directive (non-standard but widely recognized)
901 if (durationMs > 0) {
902 ss << " # (" << durationMs << " ms)";
903 }
904 output(ss.str().c_str());
905
906 // Output diagnostics for failed tests
907 for (fl::size i = 0; i < mDiagnostics.size(); ++i) {
908 fl::sstream diag;
909 diag << "# " << mDiagnostics[i];
910 output(diag.str().c_str());
911 }
912}
const char * c_str() const FL_NOEXCEPT
string str() const FL_NOEXCEPT
Definition strstream.h:43
void output(const char *line) FL_NOEXCEPT
fl::string mCurrentTestName
Definition fltest.h:676
fl::vector< fl::string > mDiagnostics
Definition fltest.h:678

References fl::basic_string::c_str(), FL_NOEXCEPT, mCurrentTestName, mDiagnostics, mTestNumber, output(), and fl::sstream::str().

+ Here is the call graph for this function: