test(device): add tests for the runner options and interactive keys

- --print-options prints the computed options and does not start the
  device
- --print-channels and --version do not start the device
- Interactive control: h, c, p, k and an invalid key print their action
- Register two channel endpoints in the StateAction device
- Add disabled tests for known defects: --print-channels and --version
  print nothing (console severity "nolog"); keys that arrive in one read
  stay in the std::cin buffer and are never handled

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-11-03 15:02:12 +00:00
committed by Dennis Klein
parent 89cbc968d8
commit 4e4d21bbd0
3 changed files with 120 additions and 0 deletions

View File

@@ -41,6 +41,13 @@ class StateAction : public Device
void ResetTask() override { ActIfRequested("ResetTask"); }
void Reset() override { ActIfRequested("Reset"); }
// For the --print-channels test.
void RegisterChannelEndpoints() override
{
RegisterChannelEndpoint("data");
RegisterChannelEndpoint("fan", 2, 4);
}
private:
void ActIfRequested(std::string_view state)
{