Add unit test for OSDK debug functions

This commit is contained in:
fgh1999
2024-03-22 23:29:27 +00:00
committed by Tate, Hongliang Tian
parent 45a7aba5c9
commit 1d5744ae80
3 changed files with 161 additions and 0 deletions

View File

@ -25,3 +25,13 @@ pub fn execute_debug_command(config: &DebugConfig) {
]);
gdb.status().unwrap();
}
// FIXME: Failed because the test env have no gdb.
// #[test]
#[allow(dead_code)]
fn have_gdb_installed() {
let output = Command::new("gdb").arg("--version").output();
assert!(output.is_ok(), "Failed to run gdb");
let stdout = String::from_utf8_lossy(&output.unwrap().stdout).to_string();
assert!(stdout.contains("GNU gdb"));
}