Add a waitpid wrapper to std::run that interprets the exit status on unix

This makes the result of running a program a little more uniform between unix
and windows
This commit is contained in:
Brian Anderson 2011-09-08 12:03:07 -07:00
parent 476bbca87a
commit a1131748c2
2 changed files with 48 additions and 2 deletions

View file

@ -65,3 +65,10 @@ fn test_pipes() {
ret buf;
}
}
#[test]
fn waitpid() {
let pid = run::spawn_process("false", [], 0, 0, 0);
let status = run::waitpid(pid);
assert status == 1;
}