From a1131748c2e86bcbcbbbec81a83ca844e58073b4 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 8 Sep 2011 12:03:07 -0700 Subject: 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 --- src/test/stdtest/run.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/test/stdtest') diff --git a/src/test/stdtest/run.rs b/src/test/stdtest/run.rs index b60a3935500..f6cf8b5f07f 100644 --- a/src/test/stdtest/run.rs +++ b/src/test/stdtest/run.rs @@ -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; +} -- cgit 1.4.1-3-g733a5