ps: Implement -l, -ly, -X field selection flags

This commit is contained in:
Tuomas Tynkkynen
2025-08-11 23:38:52 +03:00
parent 2e3fe79fd3
commit 7dfeb46721
3 changed files with 92 additions and 2 deletions
+34
View File
@@ -57,6 +57,29 @@ fn test_job_format() {
check_header("-j", &["PID", "PGID", "SID", "TTY", "TIME", "CMD"]);
}
#[test]
#[cfg(target_os = "linux")]
fn test_long_format() {
check_header(
"-l",
&[
"F", "S", "UID", "PID", "PPID", "C", "PRI", "NI", "ADDR", "SZ", "WCHAN", "TTY", "TIME",
"CMD",
],
);
}
#[test]
#[cfg(target_os = "linux")]
fn test_long_format_with_y() {
check_header(
"-ly",
&[
"S", "UID", "PID", "PPID", "C", "PRI", "NI", "RSS", "SZ", "WCHAN", "TTY", "TIME", "CMD",
],
);
}
#[test]
#[cfg(target_os = "linux")]
fn test_psr_format() {
@@ -97,6 +120,17 @@ fn test_virtual_memory_format() {
);
}
#[test]
#[cfg(target_os = "linux")]
fn test_register_format() {
check_header(
"-X",
&[
"PID", "STACKP", "ESP", "EIP", "TMOUT", "ALARM", "STAT", "TTY", "TIME", "COMMAND",
],
);
}
#[test]
#[cfg(target_os = "linux")]
fn test_code_mapping() {