fix(device): print --print-channels and --version output to stdout

- DeviceRunner sets the console log severity to "nolog" for both
  options, but printed their output with LOGV(info), so both options
  printed nothing
- Add Device::PrintRegisteredChannels(std::ostream&) for the
  machine-readable channel list; the version goes to std::cout, like
  --help and --print-options
- Enable DeviceRunner.PrintChannels and DeviceRunner.Version
- Update the documentation pages that described the defect, and
  the source line links into the changed files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-11-04 20:31:28 +00:00
committed by Dennis Klein
parent b70595cebe
commit 9b6662f6a9
18 changed files with 42 additions and 41 deletions

View File

@@ -34,10 +34,7 @@ TEST(DeviceRunner, PrintOptions)
EXPECT_EQ(result.output.find("INITIALIZING DEVICE"), string::npos) << result.output;
}
// Known defect: DeviceRunner sets the console severity to "nolog" for
// --print-channels and --version, and then prints the output with LOGV(info).
// Both options print nothing. Enable these tests with the fix.
TEST(DeviceRunner, DISABLED_PrintChannels)
TEST(DeviceRunner, PrintChannels)
{
auto const results = RunDevices({{kIdleDevice, {}, "--print-channels"}});
auto const& result = results.at(0);
@@ -45,14 +42,14 @@ TEST(DeviceRunner, DISABLED_PrintChannels)
EXPECT_TRUE(ExitedWith(result, 0, "fan:2:4"));
}
TEST(DeviceRunner, DISABLED_Version)
TEST(DeviceRunner, Version)
{
auto const results = RunDevices({{kIdleDevice, {}, "--version"}});
EXPECT_TRUE(ExitedWith(results.at(0), 0, "FairMQ version: "));
EXPECT_TRUE(ExitedWith(results.at(0), 0, "User device version: "));
}
// PrintChannels and Version must not start the device, also while they print nothing.
// PrintChannels and Version must not start the device.
TEST(DeviceRunner, PrintChannelsAndVersionDoNotStartTheDevice)
{
for (auto const* option : {"--print-channels", "--version"}) {