Don't let a missing serial listing discard an 'all' discovery on Windows
Windows CI (run 415) ran the discovery tests: 48 passed and one failed, because port listing reads Linux sysfs and the test assumed it exists. That is a real limitation, not just a bad test - and in the example it meant `all` would listen and sweep and then abort on the serial step, throwing the results away. The serial step in `all` is now a printed note on failure; the standalone `serial` command still errors. The Linux-only test is gated to Linux and a counterpart asserts that off Linux the listing is an error, not a clean empty result.
This commit is contained in:
@@ -69,7 +69,12 @@ async fn main() -> anyhow::Result<()> {
|
||||
// picking one would mean probing a network nobody named.
|
||||
None => println!("(no subnet given, so no sweep - pass one like 192.168.0.0/24 to include it)"),
|
||||
}
|
||||
found.extend(list_serial()?);
|
||||
// Not `?`: serial listing reads Linux sysfs and fails on any other
|
||||
// OS, and that must not throw away what the listen and sweep found.
|
||||
match list_serial() {
|
||||
Ok(ports) => found.extend(ports),
|
||||
Err(err) => println!("(serial ports skipped: {err})"),
|
||||
}
|
||||
found
|
||||
}
|
||||
"listen" | "raw" => {
|
||||
|
||||
Reference in New Issue
Block a user