ICE-NET/workspace/apps/icenetd/tests/common/mod.rs
loki5512344 2e61688eb3
Some checks failed
rust-ci / checks (push) Has been cancelled
Initial import: ICE-NET research docs and Rust workspace (v0.4)
- Rust workspace: 7 library crates, icenetd CLI, icenet-city (Slint GUI)
- Sim: fix false Delivered after a route cut, derive traffic class from
  payload size, per-link airtime slots (link capacity, queueing)
- Docs: single docs/STATUS.md for all figures, remove v0.2/egui leftovers,
  drop unimplemented seed claims, uncheck store-and-forward
- License: LGPL-3.0-or-later (LICENSE, LICENSES/GPL-3.0.txt)
2026-11-13 12:28:48 +01:00

23 lines
619 B
Rust

//! Shared helpers for CLI integration tests.
#![allow(dead_code)]
use std::path::PathBuf;
use std::process::{Command, Output};
pub fn run(args: &[&str]) -> Output {
Command::new(env!("CARGO_BIN_EXE_icenetd"))
.args(args)
.output()
.expect("icenetd must start")
}
pub fn stdout(output: &Output) -> String {
String::from_utf8_lossy(&output.stdout).into_owned()
}
pub fn stderr(output: &Output) -> String {
String::from_utf8_lossy(&output.stderr).into_owned()
}
pub fn temp(name: &str) -> PathBuf {
std::env::temp_dir().join(format!("icenetd-{}-{name}", std::process::id()))
}