45 .
then([&remote_control]() {
47 remote_control.
tick(current_time);
68 if (!
state ||
state->drivers_available.empty()) {
69 FL_ERROR(
"[STUB CLIENT] No drivers discovered — autoresearch cannot run");
73 FL_PRINT(
"\n[STUB CLIENT] ============================================");
74 FL_PRINT(
"[STUB CLIENT] Simulated host client — running autoresearch");
75 FL_PRINT(
"[STUB CLIENT] Drivers: " <<
state->drivers_available.size());
76 FL_PRINT(
"[STUB CLIENT] ============================================");
84 const int num_leds = 10;
93 int grand_total = 0, grand_passed = 0;
95 for (fl::size di = 0; di <
state->drivers_available.size(); di++) {
96 const auto& drv =
state->drivers_available[di];
103 if (drv.name ==
"BIT_BANG") {
104 FL_PRINT(
"\n[STUB CLIENT] Driver: " << drv.name.c_str() <<
" (skipped — no loopback in host stub)");
108 FL_PRINT(
"\n[STUB CLIENT] Driver: " << drv.name.c_str());
111 FL_ERROR(
"[STUB CLIENT] Failed to activate driver: " << drv.name.c_str());
127 int driver_total = 0, driver_passed = 0;
131 FL_PRINT(
"[STUB CLIENT] " << drv.name.c_str()
132 <<
": " << driver_passed <<
"/" << driver_total <<
" passed");
134 grand_total += driver_total;
135 grand_passed += driver_passed;
138 FL_PRINT(
"\n[STUB CLIENT] ============================================");
139 FL_PRINT(
"[STUB CLIENT] TOTAL: " << grand_passed <<
"/" << grand_total);
141 if (grand_total == 0) {
142 FL_ERROR(
"[STUB CLIENT] No tests ran — exiting 1");
144 }
else if (grand_passed == grand_total) {
145 FL_PRINT(
"[STUB CLIENT] ALL TESTS PASSED ✓ — exiting 0");
148 FL_ERROR(
"[STUB CLIENT] " << (grand_total - grand_passed)
149 <<
" TESTS FAILED — exiting 1");
bool autoResearchSetExclusiveDriverByName(const char *name)
AutoResearch-style helper: set an exclusive driver by name.
void autoResearchChipsetTiming(fl::AutoResearchConfig &config, int &total, int &passed, uint32_t &out_show_duration_ms, fl::vector< fl::RunResult > *out_results=nullptr, int num_runs_per_pattern=1)
void tick(uint32_t current_millis)
Process RPC system (pull + tick + push)
Remote RPC control system for test autoresearch Encapsulates all RPC function registration and proces...
static T & instance() FL_NO_EXCEPT
Handle & then(function< void()> on_then) FL_NO_EXCEPT
Sets the callback invoked when the task runs successfully.
Task Handle with fluent API (was class fl::task, renamed to avoid namespace collision)
Task executor — runs registered task runners and manages the run loop.
fl::task::Handle setupRpcAsyncTask(AutoResearchRemoteControl &remote_control, int interval_ms=10)
Setup async task for JSON-RPC processing.
void maybeRegisterStubAutorun(AutoResearchRemoteControl &, fl::shared_ptr< AutoResearchState > state)
On FL_IS_STUB: register a one-shot async task that drives autoresearch.
StubAutorunLedState & stubAutorunLedState()
Handle every_ms(int interval_ms) FL_NO_EXCEPT
Creates a task that runs at a fixed millisecond interval.
constexpr ChipsetTimingConfig makeTimingConfig() FL_NO_EXCEPT
Convert compile-time CHIPSET type to runtime timing config.
@ RMT
RMT-based receiver (ESP32)
Configuration for driver-agnostic autoresearch testing Contains all input parameters needed for autor...
Configuration for a single LED channel.
fl::ChipsetTimingConfig timing
Chipset timing configuration with name for testing.
#define FL_TRACE
A macro to capture the current source file, line number, and time.