fix: make help and version successful discovery
Some checks failed
checks / flake (push) Has been cancelled
Some checks failed
checks / flake (push) Has been cancelled
This commit is contained in:
parent
ffab80a1f2
commit
5c81b469e5
5 changed files with 88 additions and 1 deletions
25
tests/cli.rs
25
tests/cli.rs
|
|
@ -10,6 +10,31 @@ use std::{
|
|||
};
|
||||
|
||||
use rustix::process::{Pid, Signal, kill_process};
|
||||
|
||||
#[test]
|
||||
fn help_and_version_are_successful_discovery_output() {
|
||||
let cases = [
|
||||
(vec!["--help"], "Usage: ghidr"),
|
||||
(vec!["doctor", "--help"], "Usage: ghidr doctor"),
|
||||
(vec!["inspect", "--help"], "Usage: ghidr inspect"),
|
||||
(vec!["functions", "--help"], "Usage: ghidr functions"),
|
||||
(vec!["decompile", "--help"], "Usage: ghidr decompile"),
|
||||
(vec!["clean", "--help"], "Usage: ghidr clean"),
|
||||
(vec!["--version"], "ghidr 0.1.0"),
|
||||
];
|
||||
|
||||
for (arguments, expected) in cases {
|
||||
let output = Command::new(env!("CARGO_BIN_EXE_ghidr"))
|
||||
.args(arguments)
|
||||
.output()
|
||||
.expect("run discovery request");
|
||||
assert_eq!(output.status.code(), Some(0), "{:?}", output.stderr);
|
||||
assert!(output.stderr.is_empty());
|
||||
let stdout = String::from_utf8(output.stdout).expect("discovery output is UTF-8");
|
||||
assert!(stdout.contains(expected), "{stdout:?}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn doctor_reports_ready_with_closed_runtime_paths() {
|
||||
let temp = tempfile::tempdir().expect("temp");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue