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

◆ print_summary()

void simd_test::print_summary ( const fl::vector< TestResult > & test_results,
int total_tests,
int passed_tests,
int failed_tests )

Print summary table of all test results.

Parameters
test_resultsAll test results
total_testsTotal number of tests
passed_testsNumber of passed tests
failed_testsNumber of failed tests

Definition at line 58 of file test_helpers.cpp.

59 {
60 fl::sstream ss;
61
62 ss << "\n╔════════════════════════════════════════════════════════════════╗\n";
63 ss << "║ SIMD TEST SUMMARY ║\n";
64 ss << "╚════════════════════════════════════════════════════════════════╝\n";
65 FL_PRINT(ss.str());
66
67 ss.clear();
68 ss << "Total Tests: " << total_tests << "\n";
69 ss << "Passed: " << passed_tests << " ("
70 << (total_tests > 0 ? (passed_tests * 100 / total_tests) : 0) << "%)\n";
71 ss << "Failed: " << failed_tests << " ("
72 << (total_tests > 0 ? (failed_tests * 100 / total_tests) : 0) << "%)";
73 FL_PRINT(ss.str());
74
75 if (failed_tests > 0) {
76 FL_PRINT("\nFailed Tests:");
77 for (size_t i = 0; i < test_results.size(); i++) {
78 if (!test_results[i].passed) {
79 fl::sstream fail_ss;
80 fail_ss << " - " << test_results[i].test_name;
81 if (test_results[i].error_msg) {
82 fail_ss << ": " << test_results[i].error_msg;
83 }
84 FL_PRINT(fail_ss.str());
85 }
86 }
87 }
88}
int passed_tests
Definition SIMD.ino:75
int failed_tests
Definition SIMD.ino:76
int total_tests
Definition SIMD.ino:74
fl::vector< TestResult > test_results
Definition SIMD.ino:71
string str() const FL_NOEXCEPT
Definition strstream.h:43
void clear() FL_NOEXCEPT
Definition strstream.h:358
#define FL_PRINT(X)
Print without prefix (like FL_WARN but without "WARN: " prefix) Uses sstream for dynamic formatting (...
Definition log.h:457

References fl::sstream::clear(), failed_tests, FL_PRINT, passed_tests, fl::sstream::str(), test_results, and total_tests.

Referenced by setup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: