|
HF-WS2812 Driver 0.1.0-dev
HF-WS2812 ESP32 RMT Driver
|
Shared testing framework for ESP32-C6 comprehensive test suites. More...
#include "esp_log.h"#include "esp_timer.h"#include "driver/gpio.h"#include "freertos/FreeRTOS.h"#include "freertos/queue.h"#include "freertos/semphr.h"#include "freertos/task.h"Go to the source code of this file.
Classes | |
| struct | TestResults |
| Test execution tracking and results accumulation. More... | |
| struct | TestTaskContext |
| Context passed to test task trampoline. More... | |
Macros | |
| #define | RUN_TEST(test_func) |
| Standardized test execution macro with timing and result tracking. | |
| #define | RUN_TEST_IN_TASK(name, func, stack_size_bytes, priority) |
| Run a test function inside its own FreeRTOS task with a custom stack size. | |
| #define | RUN_TEST_SECTION_IF_ENABLED(define_name, section_name, ...) |
| Test section configuration helper macros. | |
| #define | RUN_SINGLE_TEST_IF_ENABLED(define_name, test_name, test_func, stack_size, priority) |
| #define | RUN_TEST_GROUP_IF_ENABLED(define_name, section_name, ...) RUN_TEST_SECTION_IF_ENABLED(define_name, section_name, __VA_ARGS__) |
| #define | RUN_TEST_SECTION_IF_ENABLED_WITH_PROGRESS(define_name, section_name, progress_func, ...) |
| #define | RUN_TEST_SECTION_IF_ENABLED_AUTO_PROGRESS(define_name, section_name, ...) |
| #define | RUN_TEST_SECTION_IF_ENABLED_WITH_PATTERN(define_name, section_name, blink_count, ...) |
Functions | |
| bool | init_test_progress_indicator () noexcept |
| Initialize the test progression indicator on GPIO14. | |
| void | flip_test_progress_indicator () noexcept |
| Flip the test progression indicator to show next test. | |
| void | cleanup_test_progress_indicator () noexcept |
| Cleanup the test progression indicator GPIO. | |
| void | output_section_indicator (uint8_t blink_count=5) noexcept |
| Output section start/end indicator on GPIO14. | |
| void | ensure_gpio14_initialized () noexcept |
| Automatically initialize GPIO14 test indicator if not already done. | |
| void | test_task_trampoline (void *param) |
| FreeRTOS task trampoline to execute a test with a larger dedicated stack. | |
| void | print_test_summary (const TestResults &test_results, const char *test_suite_name, const char *tag) noexcept |
| Print standardized test summary. | |
| void | print_test_section_status (const char *tag, const char *test_suite_name) noexcept |
| Print standardized test summary. | |
| void | print_test_section_header (const char *tag, const char *section_name, bool enabled=true) noexcept |
| Print test section header with consistent formatting. | |
| void | print_test_section_footer (const char *tag, const char *section_name, bool enabled=true) noexcept |
| Print test section footer with consistent formatting. | |
Shared testing framework for ESP32-C6 comprehensive test suites.
This file provides common testing infrastructure including test result tracking, execution timing, and standardized test execution macros used across all comprehensive test suites.
| #define RUN_SINGLE_TEST_IF_ENABLED | ( | define_name, | |
| test_name, | |||
| test_func, | |||
| stack_size, | |||
| priority ) |
| #define RUN_TEST | ( | test_func | ) |
Standardized test execution macro with timing and result tracking.
This macro provides:
| test_func | The test function to execute (must return bool) |
Requirements:
| #define RUN_TEST_GROUP_IF_ENABLED | ( | define_name, | |
| section_name, | |||
| ... ) RUN_TEST_SECTION_IF_ENABLED(define_name, section_name, __VA_ARGS__) |
| #define RUN_TEST_IN_TASK | ( | name, | |
| func, | |||
| stack_size_bytes, | |||
| priority ) |
Run a test function inside its own FreeRTOS task with a custom stack size.
| name | Test name (string literal) |
| func | Boolean test function pointer (noexcept) |
| stack_size_bytes | Task stack size in bytes |
| priority | Task priority (defaults to 5) |
| #define RUN_TEST_SECTION_IF_ENABLED | ( | define_name, | |
| section_name, | |||
| ... ) |
Test section configuration helper macros.
These macros provide conditional test execution based on constexpr constants at the top of test files. They allow test suites to selectively enable/disable specific test categories.
Usage:
| #define RUN_TEST_SECTION_IF_ENABLED_AUTO_PROGRESS | ( | define_name, | |
| section_name, | |||
| ... ) |
| #define RUN_TEST_SECTION_IF_ENABLED_WITH_PATTERN | ( | define_name, | |
| section_name, | |||
| blink_count, | |||
| ... ) |
| #define RUN_TEST_SECTION_IF_ENABLED_WITH_PROGRESS | ( | define_name, | |
| section_name, | |||
| progress_func, | |||
| ... ) |
|
inlinenoexcept |
Cleanup the test progression indicator GPIO.
|
inlinenoexcept |
Automatically initialize GPIO14 test indicator if not already done.
|
inlinenoexcept |
Flip the test progression indicator to show next test.
|
inlinenoexcept |
Initialize the test progression indicator on GPIO14.
|
inlinenoexcept |
Output section start/end indicator on GPIO14.
| blink_count | Number of blinks to perform (default 5) |
|
inlinenoexcept |
Print test section footer with consistent formatting.
| section_name | Name of the test section |
| enabled | Whether the section is enabled |
|
inlinenoexcept |
Print test section header with consistent formatting.
| section_name | Name of the test section |
| enabled | Whether the section is enabled |
|
inlinenoexcept |
Print standardized test summary.
| test_results | The TestResults instance to summarize |
| test_suite_name | Name of the test suite for logging |
|
inlinenoexcept |
Print standardized test summary.
| test_results | The TestResults instance to summarize |
| test_suite_name | Name of the test suite for logging |
|
inline |
FreeRTOS task trampoline to execute a test with a larger dedicated stack.